Skip to content

Commit 3a3bbc9

Browse files
committed
[kernel] Address review: guard sm_121a on CUDA>=13, downgrade main arch, wheel+README
- Gemini(high): the main extension (fastvideo_kernel_ops) used the raw TORCH_CUDA_ARCH_LIST, so a CUDA<13 build with 12.1a in the list would fail to compile. Downgrade 121a->120a for the main archs too on CUDA<13 (sm_120a PTX forward-JITs to sm_121); mirrors the fp4* guard. - Copilot: gate sm_121a on CUDA>=13.0 (not 12.9) to match the doc/comment text; fix the "[per-arch]" status message to not always claim sm_121a. - Copilot: make the "sm_120a-only" claim true, not just reworded — update fastvideo-kernel/README.md support matrix, and add 12.1a to the aarch64 cu130 wheel arch list so the published Spark wheel actually includes sm_121a FP4.
1 parent 09357e5 commit 3a3bbc9

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

.github/workflows/publish-kernel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ jobs:
176176
# the main extension for the full arch list. CMAKE_BUILD_PARALLEL_LEVEL caps
177177
# Ninja so heavy CUTLASS/TK template TUs don't OOM the 16 GB runner (exit 143).
178178
if [ "${{ matrix.platform.arch }}" = "aarch64" ]; then
179-
export TORCH_CUDA_ARCH_LIST="10.0a;12.0a"
179+
export TORCH_CUDA_ARCH_LIST="10.0a;12.0a;12.1a"
180180
export CMAKE_ARGS="${CMAKE_ARGS:-} -DFASTVIDEO_KERNEL_BUILD_TK=OFF -DFASTVIDEO_KERNEL_BUILD_ATTN_QAT_INFER=ON"
181181
export CMAKE_BUILD_PARALLEL_LEVEL=1
182182
elif [ "${{ matrix.torch-cuda.torch-cuda-short }}" = "cu130" ]; then

fastvideo-kernel/CMakeLists.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,15 @@ if(ENABLE_ATTN_QAT_INFER AND TORCH_CUDA_ARCH_LIST)
333333
set(FASTVIDEO_MAIN_CUDA_ARCHS "${TORCH_CUDA_ARCH_LIST}")
334334
string(REPLACE "sm_" "" FASTVIDEO_MAIN_CUDA_ARCHS "${FASTVIDEO_MAIN_CUDA_ARCHS}")
335335
string(REPLACE "." "" FASTVIDEO_MAIN_CUDA_ARCHS "${FASTVIDEO_MAIN_CUDA_ARCHS}")
336-
message(STATUS "[per-arch] main extension archs=${FASTVIDEO_MAIN_CUDA_ARCHS}, fp4* archs=sm_120a/sm_121a")
336+
# sm_121a needs CUDA 13's ptxas. On older toolchains, downgrade any requested
337+
# 121a to 120a for the *main* extension too (not just the fp4* targets below),
338+
# so a CUDA-12.x build with 12.1a in the arch list doesn't fail to compile —
339+
# sm_120a PTX forward-JITs to sm_121 at runtime.
340+
if(CUDAToolkit_VERSION VERSION_LESS 13.0)
341+
string(REPLACE "121a" "120a" FASTVIDEO_MAIN_CUDA_ARCHS "${FASTVIDEO_MAIN_CUDA_ARCHS}")
342+
list(REMOVE_DUPLICATES FASTVIDEO_MAIN_CUDA_ARCHS)
343+
endif()
344+
message(STATUS "[per-arch] main extension archs=${FASTVIDEO_MAIN_CUDA_ARCHS}, fp4* archs set per-target below")
337345
endif()
338346

339347
# Compiler flags
@@ -520,11 +528,11 @@ if(ENABLE_ATTN_QAT_INFER)
520528
)
521529
# FP4 kernels target consumer/workstation Blackwell: sm_120a (RTX 5090 /
522530
# PRO 6000) and sm_121a (DGX Spark GB10). sm_121a needs CUDA 13's ptxas
523-
# (12.8 lacks it), so it is added only on CUDA >= 12.9pre-13 toolchains
524-
# keep the original sm_120a-only build unchanged. sm_121a GB10-verified
525-
# (cos ~0.98 vs bf16).
531+
# (CUDA 12.x lacks it), so it is added only on CUDA >= 13.0older
532+
# toolchains keep the original sm_120a-only build unchanged. sm_121a
533+
# GB10-verified (cos ~0.98 vs bf16).
526534
set(FASTVIDEO_FP4_CUDA_ARCHS "120a")
527-
if(NOT CUDAToolkit_VERSION VERSION_LESS 12.9)
535+
if(NOT CUDAToolkit_VERSION VERSION_LESS 13.0)
528536
list(APPEND FASTVIDEO_FP4_CUDA_ARCHS "121a")
529537
endif()
530538
message(STATUS "fp4* CUDA architectures: ${FASTVIDEO_FP4_CUDA_ARCHS}")

fastvideo-kernel/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Compiled CUDA extensions (CMake, see the build summary printed at the end of eve
1212
| same extension, optional part | ThunderKittens sliding-tile attention (`sta_fwd`) and VSA block-sparse (`block_sparse_fwd/bwd`) | `csrc/attention/*_h100.cu` | Hopper `sm_90a` only | `FASTVIDEO_KERNEL_BUILD_TK` (AUTO = ON iff `9.0a` is in the arch list; always OFF on aarch64 hosts — TK headers don't compile there) |
1313
| same extension, optional part | MiniMax-H3 block-sparse VSA forward (64- and 128-token blocks) | `csrc/attention/block_sparse*_sm100a.cu` | Blackwell `sm_100a` only | ON iff `10.0a` is in `TORCH_CUDA_ARCH_LIST` |
1414
| same extension, optional part | fused NVLink Ulysses all-to-all | `csrc/comm/ulysses_all_to_all.cu` | CUDA | `FASTVIDEO_KERNEL_BUILD_ULYSSES_A2A` (AUTO = ON with NCCL 2.29+ device headers and library; always OFF on ROCm) |
15-
| `fp4attn_cuda`, `fp4quant_cuda` | FP4 attention + quantization ("attn_qat_infer", modified SageAttention3) | `attn_qat_infer/` | consumer Blackwell `sm_120a` only, CUDA ≥ 12.8 | `FASTVIDEO_KERNEL_BUILD_ATTN_QAT_INFER` (AUTO = ON iff `12.0a` is in the arch list) |
15+
| `fp4attn_cuda`, `fp4quant_cuda` | FP4 attention + quantization ("attn_qat_infer", modified SageAttention3) | `attn_qat_infer/` | consumer/workstation Blackwell `sm_120a` (CUDA ≥ 12.8) + `sm_121a` (DGX Spark GB10; CUDA ≥ 13) | `FASTVIDEO_KERNEL_BUILD_ATTN_QAT_INFER` (AUTO = ON iff `12.0a` or `12.1a` is in the arch list) |
1616

1717
Runtime-JIT kernels (no build step, ship in every wheel/image):
1818

@@ -28,7 +28,7 @@ Runtime-JIT kernels (no build step, ship in every wheel/image):
2828
|---|---|---|---|---|---|---|
2929
| PyPI wheels (`.github/workflows/publish-kernel.yml`) | version bump in `fastvideo-kernel/pyproject.toml` on main, or manual dispatch | x86_64 cu126 | `9.0a` | ON | AUTO | — (CUDA < 12.8) |
3030
| | | x86_64 cu130 | `9.0a;10.0a;12.0a` | ON | AUTO | ON |
31-
| | | aarch64 cu130 | `10.0a;12.0a` || AUTO | ON |
31+
| | | aarch64 cu130 | `10.0a;12.0a;12.1a` || AUTO | ON |
3232
| Docker images `ghcr.io/hao-ai-lab/fastvideo/fastvideo-dev` (`.github/workflows/infra-build-image.yml`) | `docker/Dockerfile` changes on main, or manual dispatch | amd64 cuda12.6.3 + cuda13.0.0 | `9.0a` | ON | AUTO ||
3333
| | | arm64 cuda12.6.3 (GH200) | `9.0a` | — (aarch64) | AUTO ||
3434
| | | arm64 cuda13.0.0 (GB10 / DGX Spark) | `12.1` || AUTO ||

0 commit comments

Comments
 (0)