Repository navigation
fix(kernels): route the remaining dot-product call sites through the non-DOTPROD fallback - #800
Conversation
…DOTPROD fallback Signed-off-by: avionicharshit-byte <harshitavionic@gmail.com>
|
For now, do not prioritize any work to bring up targets below ARM v8.2+ For now, it seems like build is configured to fail on unsupported architectures (https://github.com/cactus-compute/cactus/pull/768) This is sufficient observability for future debugging. IMO its better to first gauge audience interest with some kind of questionnaire in the readme. |
|
tested on an actual pi 4 , not cross compiled pi 4 model b rev 1.4 , cortex-a72 , aarch64 , debian 13 , gcc 14.2. upstream main on this pi compiles fine with the current at an honest armv8.0 baseline , with this branch , 88 errors , same 11 files , and every remaining one is what i cannot show yet is the suite passing on the pi , it still wont build there until @HenryNdubuaku on that , do you want it folded into this pr , a second one stacked on top , or would you rather not carry a slow path at all. either way this pr changes no build flags , so nothing moves for chips that have dotprod , and i have the pi here to measure whichever way you prefer |
towards #561 , this does not close it , see the bottom
matmul.cppalready had a non-DOTPROD fallback ,cactus_dotq_lane0..3behindCACTUS_DOTQ_LANE, used in 52 places. but 28 other call sites in the same file still callvdotq_laneq_s32directly , andattention_hybrid.cppcallsvdotq_s32in 10 places with no guard at all. so on a target without dotprod the code does not fall back , it fails to compile.what this does
moves the guard block into
cactus-kernels/src/neon_dotprod.hso both files share one switch , addsCACTUS_DOTQfor the non lane form which had no fallback at all , and routes the 38 raw sites through the macros. nothing changes on a dotprod target , the macros expand to the same intrinsics.testing , on an m-series mac
-march=armv8.2-a+fp16, no dotprod. before: 32 errors inmatmul.cpp, 10 inattention_hybrid.cpp. after: 0 and 0./test.shpasses 50/50 native , and 50/50 again with the#undef __ARM_FEATURE_DOTPRODline uncommented so every site is forced down the fallbackthe loss
the fallback is slower , measured with that switch on:
so about 6x on large gemm and 1.7x on the gemv shape decode uses. its a correctness path , not a speed path , and it only runs where the fast one would have been an illegal instruction.
what this does not fix
pi 4 still will not build. the
__fp16arithmetic is a separate armv8.2 feature and has no fallback anywhere , with this branch applied its still 108 errors at-march=armv8-aacross 11 files , allfullfp16. happy to do that next , either folded into this pr or as a second one.one thing , i put the header at
cactus-kernels/src/neon_dotprod.h, contributing says one header per folder so say the word and ill fold it intocactus_kernels.hinstead.