okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
fd19246dc
main
1// src/kernels/latent_layout_check.cpp - ExpertLayout v6: 48 x 512 latent A blobs. 2#include "strata/kernels/cpu/expert_layout.hpp" 3 4#include <cstdio> 5#include <cstdlib> 6#include <string> 7 8int main (int argc ,char ** argv ) { 9if (argc < 2 ) { std::fprintf (stderr ,"usage: %s <latent_a_pack>\n" ,argv [0 ]);return 2 ; } 10 std::string err ; 11if (!strata::kernels::cpu::expert_layout_load (argv [1 ],48 ,512 ,err )) { 12 std::fprintf (stderr ,"layout load failed: %s\n" ,err .c_str ()); 13return 1 ; 14 } 15const auto & L = strata::kernels::cpu::expert_layout (); 16 std::printf ("native=%d layers=%lld experts=%lld max_blob=%llu total=%llu\n" , (int )L .native , 17 (long long )L .n_layers , (long long )L .n_expert , (unsigned long long )L .max_blob , 18 (unsigned long long )L .total ); 19if (L .fmt .empty ()) { std::fprintf (stderr ,"no fmt\n" );return 1 ; } 20const auto & f = L .fmt [0 ]; 21 std::printf ("layer0 embd=%lld ff=%lld gu=%d d=%d bytes=%llu blob0=%llu\n" , (long long )f .n_embd , 22 (long long )f .n_ff ,f .gu_type ,f .d_type , (unsigned long long )f .bytes , 23 (unsigned long long )L .blob_bytes (0 )); 24const uint64_t want_blob = 1280ull * 1008 + 1792ull * 360 + 16 ; 25const bool ok = L .native && L .n_layers == 48 && L .n_expert == 512 && L .max_blob == want_blob && 26L .blob_bytes (0 )== want_blob && f .n_embd == 1792 && f .n_ff == 640 && 27L .total == 48ull * 512ull * want_blob ; 28 std::printf ("RESULT: %s (want blob %llu, total %llu)\n" ,ok ?"ok" :"BAD" , 29 (unsigned long long )want_blob , (unsigned long long ) (48ull * 512ull * want_blob )); 30return ok ?0 :1 ; 31}