perf: add fast-math and vectorization nvcc/cxx build flags

- centralize CXX_FLAGS/NVCC_FLAGS in csrc/build.py as single source
- add --use_fast_math, --ptxas-options=-O3,-v, --extra-device-vectorization
- add -march=native -funroll-loops host flags
- setup.py reads shared cxx_flags/nvcc_flags from registry
- sync pure-C test build commands with new flags
This commit is contained in:
2026-07-07 22:28:32 +08:00
parent c50adbaac0
commit 4225518cf3
4 changed files with 29 additions and 4 deletions
+7 -1
View File
@@ -1,4 +1,10 @@
// Pure-C test: nvcc -I csrc -arch=sm_89 csrc/tests/gqa_decode_test.cu -o test && ./test
/*
Pure-C test:
nvcc -I csrc -arch=sm_89 -O3 \
--use_fast_math --ptxas-options=-O3 --extra-device-vectorization \
csrc/tests/gqa_decode_test.cu -o test && ./test
*/
#include <cstdio>
#include <cstdlib>
#include <cmath>
+7 -1
View File
@@ -1,4 +1,10 @@
// Pure-C test: nvcc -I csrc -arch=sm_89 csrc/tests/gqa_prefill_test.cu -o test && ./test
/*
Pure-C test:
nvcc -I csrc -arch=sm_89 -O3 \
--use_fast_math --ptxas-options=-O3 --extra-device-vectorization \
csrc/tests/gqa_prefill_test.cu -o test && ./test
*/
#include <cstdio>
#include <cstdlib>
#include <cmath>