mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-06 08:18:54 +00:00
nvcc does not know `#pragma clang fp contract(off)`, so in native_moe.cu's combine<GATED> the shared expert's product `shared[col] * g` was fused into the add (`sum = fma(shared, g, sum)`, one rounding), while the comment, and shared_expert_multi's scale_rows store followed by the ungated combine, round the product first. STRATA_LFUSE is on by default, so the default path took the fused form. The product is now `__fmul_rn(shared[col], g)` on CUDA (the pragma stays for HIP, where clang reads it); the same guard on the three other unguarded pragmas (verify_kernels.cu gdn_q8_1_store, iq_kernels.cu s26_swiglu_q8_1_kernel, which also rounds its product by hand now, as swiglu_q8_1_entries_kernel does). No more nvcc #20199-D warnings. Test: tests/cuda/native_moe_gated_test.cu, the gated combine against a scale-rows store followed by the ungated combine, bitwise, synthetic data. RTX PRO 5000 (sm_120): 3,898 of 15,360 outputs differ before the change, 0 after.