okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
af6226a3c
main
1// CPU-only task partition parity. Optional real expert: pool_tasks_test GU_TYPE DOWN_TYPE BLOB_FILE 2#include "strata/kernels/cpu/pool.hpp" 3#include "strata/kernels/cpu/expert_layout.hpp" 4#include "ggml.h" 5 6#include <algorithm> 7#include <cmath> 8#include <cstdio> 9#include <cstdlib> 10#include <cstring> 11#include <ctime> 12#include <filesystem> 13#include <fstream> 14#include <limits> 15#include <random> 16#include <stdexcept> 17#include <string> 18#include <vector> 19 20namespace cpu= strata::kernels::cpu; 21 22static void put_env (const char * k ,const char * v ) { 23#if defined(_WIN32 ) 24_putenv_s (k ,v ); 25#else 26setenv (k ,v ,1 ); 27#endif 28} 29// a synthetic Strata-form (s2) expert: random codes, fp16 scales ~0.004-0.016 (as expert_multi_test's) 30static void make_s2_blob (uint8_t * b , std::mt19937 & rng ) { 31for (size_t i = 0 ;i < cpu::O_GU_SCALES ;++ i )b [i ]= (uint8_t )rng (); 32for (size_t i = cpu::O_GU_SCALES ;i < cpu::BLOB ;i += 2 ) { 33const uint16_t h = (uint16_t ) (0x1C00 + rng () %0x0800 ); 34 std::memcpy (b + i ,& h ,2 ); 35 } 36} 37static bool same_h (const float * a ,const float * b ) {return std::memcmp (a ,b , (size_t ) cpu::H * sizeof (float ))== 0 ; } 38static void nan_h (float * a ) { std::fill (a ,a + cpu::H , std::numeric_limits < float > ::quiet_NaN ()); } 39static void unset_env (const char * k ) { 40#if defined(_WIN32 ) 41_putenv_s (k ,"" ); 42#else 43unsetenv (k ); 44#endif 45} 46 47int main (int argc ,char ** argv ) { 48if (argc != 1 && argc != 4 )return 2 ; 49// its activation quantiser is the AVX one at least (act_quant_any): a CPU without AVX (Westmere) would stop on an illegal instruction 50if (!cpu::cpu_avx1_ok ()) { std::printf ("pool_tasks_test: no AVX on this CPU, skipped\n" );return 0 ; } 51 cpu::NativeFmt f ; 52 std::string err ; 53if (!cpu::native_fmt (argc == 4 ? std::atoi (argv [1 ]) :GGML_TYPE_Q4_0 , 54argc == 4 ? std::atoi (argv [2 ]) :GGML_TYPE_Q4_0 , cpu::H , cpu::FF ,f ,err )) { 55 std::fprintf (stderr ,"%s\n" ,err .c_str ()); 56return 1 ; 57 } 58 std::vector < uint8_t > blob (f .bytes ); 59if (argc == 4 ) { 60 std::FILE * file = std::fopen (argv [3 ],"rb" ); 61if (!file )return 2 ; 62const size_t got = std::fread (blob .data (),1 ,blob .size (),file ); 63 std::fclose (file ); 64if (got != blob .size ())return 2 ; 65 }else { 66 std::vector < float > weights ((size_t ) cpu::H * cpu::FF ); 67for (size_t i = 0 ;i < weights .size ();++ i )weights [i ]= 0.02f * std::sin ((float )i * 0.17f ); 68ggml_quantize_chunk (GGML_TYPE_Q4_0 ,weights .data (),blob .data (),0 , cpu::FF , cpu::H ,nullptr ); 69ggml_quantize_chunk (GGML_TYPE_Q4_0 ,weights .data (),blob .data ()+ f .up_off ,0 , cpu::FF , cpu::H ,nullptr ); 70ggml_quantize_chunk (GGML_TYPE_Q4_0 ,weights .data (),blob .data ()+ f .down_off ,0 , cpu::H , cpu::FF ,nullptr ); 71 } 72for (int tasks : {-1 , cpu::ExpertPool ::kMaxTasks + 1 }) { 73try { cpu::ExpertPool invalid (1 , false, true, cpu::PoolAffinity ::All ,tasks );return 1 ; } 74catch (const std::invalid_argument & ) {} 75 } 76 std::vector < std::vector < uint8_t >> act (cpu::MAXT , std::vector < uint8_t > (cpu::kNativeActBytes )); 77 std::vector < cpu::ActQ > qact (cpu::MAXT ); 78 std::vector < float > x (cpu::H ); 79for (int t = 0 ;t < cpu::MAXT ;++ t ) { 80for (int i = 0 ;i < cpu::H ;++ i )x [i ]= std::sin ((float ) (i + 13 * t )* 0.031f ); 81 cpu::native_quant_act (f ,x .data (),act [t ].data ()); 82 cpu::act_quant_any (x .data (), cpu::H ,qact [t ]); 83 } 84int checks = 0 ,split_checks = 0 ,mixed_checks = 0 ; 85for (int n : {1 ,7 , cpu::ExpertPool ::kMaxSplitMulti + 1 }) { 86 std::vector < cpu::ExpertJobMulti > jobs (n ); 87 std::vector < float > out ((size_t )n * cpu::MAXT * cpu::H ); 88for (int e = 0 ;e < n ;++ e ) { 89jobs [e ].blob = blob .data (); 90jobs [e ].nt = e %3 == 0 ?1 :e %3 == 1 ?4 : cpu::MAXT ; 91for (int t = 0 ;t < jobs [e ].nt ;++ t ) { 92jobs [e ].nact [t ]= act [t ].data (); 93jobs [e ].act [t ]= & qact [t ]; 94jobs [e ].out [t ]= out .data ()+ ((size_t )e * cpu::MAXT + t )* cpu::H ; 95 } 96 } 97 {// The default partition is the arithmetic reference; inactive token slots remain zero. 98 cpu::ExpertPool baseline (3 , false); 99baseline .run_split_multi_native (f ,jobs .data (),n ); 100 } 101const auto ref = out ; 102for (float v :ref )if (!std::isfinite (v ))return 1 ; 103for (bool host : {false, true})for (int workers : {1 ,3 }) 104for (int tasks : {0 ,1 ,41 ,128 ,192 ,256 , cpu::ExpertPool ::kMaxTasks }) { 105 cpu::ExpertPool pool (workers ,false ,host , cpu::PoolAffinity ::All ,tasks ); 106for (int repeat = 0 ;repeat < 2 ;++ repeat ) { 107 std::fill (out .begin (),out .end (),0.0f ); 108for (const auto & job :jobs )for (int t = 0 ;t < job .nt ;++ t ) 109 std::fill (job .out [t ],job .out [t ]+ cpu::H , std::numeric_limits < float > ::quiet_NaN ()); 110pool .run_split_multi_native (f ,jobs .data (),n ); 111if (std::memcmp (ref .data (),out .data (),out .size ()* sizeof (float ))!= 0 ) { 112 std::fprintf (stderr ,"mismatch n=%d workers=%d host=%d tasks=%d repeat=%d\n" , 113n ,workers ,host ,tasks ,repeat ); 114return 1 ; 115 } 116++ checks ; 117 } 118 } 119// STRATA_NUMA_SPLIT=test: two slices without a real second node (thread j -> slice j % 2), every worker 120// sleeping between batches (spin 0) so the late-wake path of issue #29 runs constantly 121put_env ("STRATA_NUMA_SPLIT" ,"test" ); 122put_env ("STRATA_POOL_SPIN_US" ,"0" ); 123for (bool host : {false, true})for (int workers : {1 ,2 ,3 ,5 }) 124for (int tasks : {0 ,1 ,41 , cpu::ExpertPool ::kMaxTasks }) { 125 cpu::ExpertPool pool (workers ,false ,host , cpu::PoolAffinity ::All ,tasks ); 126const int slices = workers + (host ?1 :0 ) >=2 ?2 :0 ; 127if (pool .numa_slices ()!= slices || cpu::active_numa_split ().on != (slices == 2 )|| 128 (slices == 2 && !cpu::active_numa_split ().test )) { 129 std::fprintf (stderr ,"numa-split slices %d, expected %d (workers=%d host=%d)\n" , 130pool .numa_slices (),slices ,workers ,host ); 131return 1 ; 132 } 133for (int repeat = 0 ;repeat < 2 ;++ repeat ) { 134for (const auto & job :jobs )for (int t = 0 ;t < job .nt ;++ t ) 135 std::fill (job .out [t ],job .out [t ]+ cpu::H , std::numeric_limits < float > ::quiet_NaN ()); 136pool .run_split_multi_native (f ,jobs .data (),n ); 137if (std::memcmp (ref .data (),out .data (),out .size ()* sizeof (float ))!= 0 ) { 138 std::fprintf (stderr ,"numa-split mismatch n=%d workers=%d host=%d tasks=%d repeat=%d\n" , 139n ,workers ,host ,tasks ,repeat ); 140return 1 ; 141 } 142++ split_checks ; 143 } 144pool .diag (stderr ); 145 } 146// The split with modes 0-4 between the native batches, on one pool: a mode-0..4 batch lives on `head_`, a 147// native one on the slice heads, so this alternates the two families of heads (a stale claim must fail on 148// the other family) and runs the per-slice `parked` through the non-native modes. The Strata-form kernels 149// need AVX-512 VBMI, the oracle contract included (a Xeon Gold 6226 stops on vpmultishiftqb inside 150// s2_expert_vnni_q with the oracle on), so a CPU without it skips this part. 151// CBA: no coverage on a VBMI-free CPU (the 6226 box); a test-only kernel seam in the pool if it must have it. 152const cpu::CpuFeatures feat = cpu::cpu_features (); 153if (n == 7 && feat .usable ()) { 154 std::mt19937 rng (7 ); 155 std::vector < std::vector < uint8_t >> s2 (3 , std::vector < uint8_t > (cpu::BLOB )); 156for (auto & b :s2 )make_s2_blob (b .data (),rng ); 157const int NJ = 5 ;// single-token jobs: run() and run_split() 158 std::vector < cpu::ExpertJob > sj (NJ ); 159 std::vector < float > sout ((size_t )NJ * cpu::H ),sref (sout .size ()); 160 std::vector < cpu::ExpertJobMulti > mj (3 );// multi-token jobs: run_split_multi(), 1, 2 and 3 tokens 161 std::vector < float > mout ((size_t )3 * cpu::MAXT * cpu::H ),mref (mout .size ()); 162 {// the serial reference: run_split and run_split_multi are bitwise run's, token for token (pool.hpp) 163 cpu::ExpertScratch ws ; 164for (int j = 0 ;j < NJ ;++ j ) { 165sj [j ].blob = s2 [(size_t )j %3 ].data (); 166sj [j ].act = & qact [(size_t )j % cpu::MAXT ]; 167sj [j ].out = sout .data ()+ (size_t )j * cpu::H ; 168sj [j ].slot = j ; 169 cpu::s2_expert_vnni_q (sj [j ].blob ,* sj [j ].act ,sref .data ()+ (size_t )j * cpu::H ,ws ); 170 } 171for (int e = 0 ;e < 3 ;++ e ) { 172mj [e ].blob = s2 [(size_t )e ].data (); 173mj [e ].nt = e + 1 ; 174for (int t = 0 ;t < mj [e ].nt ;++ t ) { 175mj [e ].act [t ]= & qact [(size_t )t ]; 176mj [e ].out [t ]= mout .data ()+ ((size_t )e * cpu::MAXT + t )* cpu::H ; 177 cpu::s2_expert_vnni_q (mj [e ].blob ,qact [(size_t )t ],mref .data ()+ ((size_t )e * cpu::MAXT + t )* cpu::H ,ws ); 178 } 179 } 180 } 181for (float v :sref )if (!std::isfinite (v )) { std::fprintf (stderr ,"s2 reference not finite\n" );return 1 ; } 182for (bool host : {false, true})for (int workers : {1 ,2 ,3 ,5 }) 183for (int tasks : {0 ,41 }) { 184 cpu::ExpertPool pool (workers ,false ,host , cpu::PoolAffinity ::All ,tasks ); 185for (int repeat = 0 ;repeat < 3 ;++ repeat ) 186for (int step = 0 ;step < 6 ;++ step ) { 187bool ok = true; 188if (step %2 == 1 ) {// the native batch between each pair 189for (const auto & job :jobs )for (int t = 0 ;t < job .nt ;++ t )nan_h (job .out [t ]); 190pool .run_split_multi_native (f ,jobs .data (),n ); 191ok = std::memcmp (ref .data (),out .data (),out .size ()* sizeof (float ))== 0 ; 192 }else if (step < 4 ) {// 0: run (mode 0), 2: run_split (modes 1/2) 193for (int j = 0 ;j < NJ ;++ j )nan_h (sj [j ].out ); 194if (step == 0 )pool .run (sj .data (),NJ ); 195else pool .run_split (sj .data (),NJ ); 196for (int j = 0 ;j < NJ ;++ j )ok = ok && same_h (sj [j ].out ,sref .data ()+ (size_t )j * cpu::H ); 197 }else {// 4: run_split_multi (modes 3/4) 198for (const auto & job :mj )for (int t = 0 ;t < job .nt ;++ t )nan_h (job .out [t ]); 199pool .run_split_multi (mj .data (),3 ); 200for (int e = 0 ;e < 3 ;++ e )for (int t = 0 ;t < mj [e ].nt ;++ t ) 201ok = ok && same_h (mj [e ].out [t ],mref .data ()+ ((size_t )e * cpu::MAXT + t )* cpu::H ); 202 } 203if (!ok ) { 204 std::fprintf (stderr ,"numa-split mixed-mode mismatch step=%d workers=%d host=%d tasks=%d " 205"repeat=%d\n" ,step ,workers ,host ,tasks ,repeat ); 206return 1 ; 207 } 208++ mixed_checks ; 209 } 210pool .diag (stderr ); 211 } 212 }else if (n == 7 ) { 213 std::printf ("pool tasks: modes 0-4 interleaved under the split SKIPPED (%s)\n" ,feat .reason ()); 214 } 215unset_env ("STRATA_NUMA_SPLIT" ); 216unset_env ("STRATA_POOL_SPIN_US" ); 217if (cpu::active_numa_split ().on ) { std::fprintf (stderr ,"numa-split plan outlived its pool\n" );return 1 ; } 218 } 219#if defined(__linux__ ) 220 {// the real split refuses STRATA_EXCHANGE_ROTATE=1 (experts move between slots, the slices need fixed ones) 221put_env ("STRATA_NUMA_SPLIT" ,"1" ); 222put_env ("STRATA_EXCHANGE_ROTATE" ,"1" ); 223bool refused = false; 224 { 225 cpu::ExpertPool pool (2 , true, true); 226refused = !cpu::active_numa_split ().on && 227 cpu::active_numa_split ().why .find ("STRATA_EXCHANGE_ROTATE" )!= std::string::npos ; 228 } 229unset_env ("STRATA_EXCHANGE_ROTATE" ); 230unset_env ("STRATA_NUMA_SPLIT" ); 231if (!refused ) { std::fprintf (stderr ,"numa-split did not refuse STRATA_EXCHANGE_ROTATE=1\n" );return 1 ; } 232 } 233 {// the real split on any host: on means two distinct nodes and cores on both slices, off always says why 234put_env ("STRATA_NUMA_SPLIT" ,"1" ); 235bool ok = false; 236 { 237 cpu::ExpertPool pool (4 , true, true); 238const auto & plan = cpu::active_numa_split (); 239ok = plan .on ?plan .nodes [0 ]!= plan .nodes [1 ]&& !plan .cores [0 ].empty ()&& !plan .cores [1 ].empty () 240 : !plan .why .empty ()&& plan .nodes [0 ]== -1 && plan .nodes [1 ]== -1 && plan .cores [0 ].empty ()&& 241plan .cores [1 ].empty (); 242 std::printf ("pool tasks: real split %s%s\n" ,plan .on ?"on" :"off: " ,plan .why .c_str ()); 243 } 244unset_env ("STRATA_NUMA_SPLIT" ); 245if (!ok ) { std::fprintf (stderr ,"numa-split real-mode plan invariant broken\n" );return 1 ; } 246// the DEFAULT worker count under the split spans every socket (pool_plan.hpp span_packages): on a 2-socket 247// host the split must then be on, where 0.2.0's host-socket default alone would leave every thread on one node 248put_env ("STRATA_NUMA_SPLIT" ,"1" ); 249 { 250const int packages = (int ) cpu::pool_plan_input (cpu::detect_cpu_topology (true, cpu::PoolAffinity ::All )) 251 .cores_per_package .size (); 252 cpu::ExpertPool pool (0 , true, true); 253const auto & plan = cpu::active_numa_split (); 254 std::printf ("pool tasks: default pool under the split: %d workers on %d socket(s), split %s%s (%s)\n" , 255pool .workers (),packages ,plan .on ?"on" :"off: " ,plan .why .c_str (),pool .plan_limit ()); 256ok = packages != 2 || (plan .on && plan .cores [0 ].size ()> 0 && plan .cores [1 ].size ()> 0 ); 257 } 258unset_env ("STRATA_NUMA_SPLIT" ); 259if (!ok ) { std::fprintf (stderr ,"numa-split: the default pool on a 2-socket host did not span both nodes\n" );return 1 ; } 260// a value other than 1 / test is off, with the value in the reason; "0" and "" are off silently 261for (const char * v : {"off" ,"yes" }) { 262put_env ("STRATA_NUMA_SPLIT" ,v ); 263bool bad = false; 264 { 265 cpu::ExpertPool pool (2 , true, true); 266bad = cpu::active_numa_split ().on || cpu::active_numa_split ().why .find (std::string ("'" )+ v + "'" )== std::string::npos ; 267 } 268unset_env ("STRATA_NUMA_SPLIT" ); 269if (bad ) { std::fprintf (stderr ,"numa-split did not refuse STRATA_NUMA_SPLIT=%s\n" ,v );return 1 ; } 270 } 271 } 272 {// 0.2.2: STRATA_NUMA_POOL=0 is the off switch of the split, STRATA_NUMA_SPLIT=1 or test included; and with neither set the 273// plan is empty on a host with one NUMA node (the code path of the pool before the split) and, on two or more, on only 274// when it says why or says the nodes (the pool then runs as before) 275for (const char * v : {"1" ,"test" }) { 276put_env ("STRATA_NUMA_POOL" ,"0" ); 277put_env ("STRATA_NUMA_SPLIT" ,v ); 278bool off = false; 279 { 280 cpu::ExpertPool pool (4 , true, true); 281off = !cpu::active_numa_split ().on && cpu::active_numa_split ().why .empty ()&& pool .numa_slices ()== 0 ; 282 } 283unset_env ("STRATA_NUMA_POOL" ); 284unset_env ("STRATA_NUMA_SPLIT" ); 285if (!off ) { std::fprintf (stderr ,"STRATA_NUMA_POOL=0 did not switch the split off (STRATA_NUMA_SPLIT=%s)\n" ,v );return 1 ; } 286 } 287unset_env ("STRATA_NUMA_SPLIT" ); 288 cpu::ExpertPool pool (4 , true, true); 289const auto & plan = cpu::active_numa_split (); 290 std::printf ("pool tasks: nothing set: split %s%s\n" ,plan .on ?"on" :"off" ,plan .why .empty () ?"" : (": " + plan .why ).c_str ()); 291if (!plan .on && !plan .why .empty ()) { std::fprintf (stderr ,"an automatic split that did not run left a refusal reason\n" );return 1 ; } 292 } 293 {// 0.2.2: a made-up two-node machine (STRATA_TEST_SYSFS_ROOT): the pool's own node lookup, the automatic split, its log lines 294const std::vector < int > cores = cpu::detect_cpu_topology (true, cpu::PoolAffinity ::All ).worker_cores ; 295const int host = cpu::detect_cpu_topology (true, cpu::PoolAffinity ::All ).host_core ; 296if (cores .size ()< 4 || host < 0 ) { 297 std::printf ("pool tasks: fake two-node machine SKIPPED (needs 4 worker cores and a host core)\n" ); 298 }else { 299namespace fs= std::filesystem; 300const fs::path root = fs::temp_directory_path () / ("strata_pool_fake_sysfs_" + std::to_string ((long long ) std::time (nullptr ))); 301// node k of worker core i: the workers alternate between the nodes, the host core is on node 0 302auto build = [& ](int n_nodes ) { 303 fs::remove_all (root ); 304 fs::create_directories (root /"devices/system/node" ); 305 std::vector < std::string > list ((size_t )n_nodes ); 306auto put = [& ](int cpu ,int node ) { 307 fs::create_directories (root /"devices/system/cpu" / ("cpu" + std::to_string (cpu )) / ("node" + std::to_string (node ))); 308list [(size_t )node ]+= (list [(size_t )node ].empty () ?"" :"," )+ std::to_string (cpu ); 309 }; 310put (host ,0 ); 311for (size_t i = 0 ;i < cores .size ();++ i )put (cores [i ], (int ) (i % (size_t )n_nodes )); 312for (int k = 0 ;k < n_nodes ;++ k ) { 313 fs::create_directories (root /"devices/system/node" / ("node" + std::to_string (k ))); 314 std::ofstream (root /"devices/system/node" / ("node" + std::to_string (k )) /"cpulist" ) <<list [(size_t )k ] <<"\n" ; 315 } 316 }; 317put_env ("STRATA_TEST_SYSFS_ROOT" ,root .string ().c_str ()); 318unset_env ("STRATA_NUMA_SPLIT" ); 319unset_env ("STRATA_NUMA_POOL" ); 320const int workers = (int ) std::min < size_t > (cores .size (),8 )& ~1 ;// even: the nodes get the same count 321 322build (2 );// two nodes, nothing set: the split runs by itself 323 { 324 cpu::ExpertPool pool (workers ,true ,true ); 325const auto & plan = cpu::active_numa_split (); 326const bool ok = plan .on && !plan .test && plan .nodes [0 ]== 0 && plan .nodes [1 ]== 1 && pool .numa_slices ()== 2 && 327 !plan .cores [0 ].empty ()&& !plan .cores [1 ].empty (); 328 std::printf ("pool tasks: fake two nodes, nothing set: split %s (%zu + %zu cores)\n" ,plan .on ?"on" :"off" , 329plan .cores [0 ].size (),plan .cores [1 ].size ()); 330if (!ok ) { std::fprintf (stderr ,"the automatic split did not run on a two-node machine\n" );return 1 ; } 331 } 332put_env ("STRATA_NUMA_POOL" ,"0" );// the off switch 333 { 334 cpu::ExpertPool pool (workers ,true ,true ); 335if (cpu::active_numa_split ().on || pool .numa_slices ()!= 0 ) { std::fprintf (stderr ,"STRATA_NUMA_POOL=0 did not switch the automatic split off\n" );return 1 ; } 336 } 337unset_env ("STRATA_NUMA_POOL" ); 338put_env ("STRATA_EXCHANGE_ROTATE" ,"1" );// the split cannot run: the pool stays as it was, with no half-made plan 339 { 340 cpu::ExpertPool pool (workers ,true ,true ); 341if (cpu::active_numa_split ().on || pool .numa_slices ()!= 0 || !cpu::active_numa_split ().why .empty ()) { 342 std::fprintf (stderr ,"an automatic split that cannot run left a plan or a reason behind\n" ); 343return 1 ; 344 } 345 } 346unset_env ("STRATA_EXCHANGE_ROTATE" ); 347for (int nodes : {1 ,3 }) {// one node: the pool before the split; three: not supported, the pool as it was 348build (nodes ); 349 cpu::ExpertPool pool (workers ,true ,true ); 350if (cpu::active_numa_split ().on || pool .numa_slices ()!= 0 ) { std::fprintf (stderr ,"split on a %d-node machine\n" ,nodes );return 1 ; } 351 } 352 {// the default worker count and cores of a one-node machine do not depend on the split code at all 353build (1 ); 354 cpu::ExpertPool a (0 , true, true); 355const std::vector < int > a_cores = a .worker_cores (); 356const int a_workers = a .workers (); 357unset_env ("STRATA_TEST_SYSFS_ROOT" ); 358// the real machine may have two NUMA nodes (a two-socket CPU, a container on one): then the automatic split 359// runs and gives the pool the cores of both nodes, which is not what this comparison is about 360put_env ("STRATA_NUMA_POOL" ,"0" ); 361 cpu::ExpertPool b (0 , true, true); 362unset_env ("STRATA_NUMA_POOL" ); 363if (a_workers != b .workers ()|| a_cores != b .worker_cores ()) { 364 std::fprintf (stderr ,"a one-node fake machine changed the pool's workers or cores\n" ); 365return 1 ; 366 } 367 std::printf ("pool tasks: one node: %d workers and the same cores as with no topology override\n" ,a_workers ); 368 } 369unset_env ("STRATA_TEST_SYSFS_ROOT" ); 370 fs::remove_all (root ); 371 } 372 } 373#endif 374 std::printf ("pool tasks: %d bitwise comparisons passed, %d of them in NUMA-split mode (%d with modes 0-4 " 375"interleaved)\n" ,checks + split_checks + mixed_checks ,split_checks + mixed_checks ,mixed_checks ); 376return 0 ; 377}