Skip to content

build: add sm_86 to the CUDA gencode list - #3

Open
GeoffreyWang1117 wants to merge 1 commit into
Infini-AI-Lab:v1from
GeoffreyWang1117:pr/cuda-gencode-sm86
Open

build: add sm_86 to the CUDA gencode list#3
GeoffreyWang1117 wants to merge 1 commit into
Infini-AI-Lab:v1from
GeoffreyWang1117:pr/cuda-gencode-sm86

Conversation

@GeoffreyWang1117

Copy link
Copy Markdown

Problem

setup.py pins the CUDA gencode list to sm_89 (Ada) and sm_90 (Hopper). Nothing is emitted for sm_86, so the extension does not load on any Ampere consumer or mid-range datacenter card — RTX 3090, RTX 3080 Ti, A10, A40.

Those are exactly the cards a lot of people have when they want to prototype a sparse-attention algorithm, which is what Vortex is for. I hit this on a 3090.

Change

One line:

                 'nvcc': [
                     '-O3',
+                    '-gencode=arch=compute_86,code=sm_86',
                     '-gencode=arch=compute_89,code=sm_89',
                     '-gencode=arch=compute_90,code=sm_90'
                 ],

Effect

  • Adds one gencode pass at build time. No runtime change, no behavior change on sm_89/sm_90.
  • Verified: csrc/topk.cu compiles for sm_86 alongside sm_89/sm_90 with nvcc 13.3.

Alternative, if you prefer

CUDAExtension honours TORCH_CUDA_ARCH_LIST, so dropping the hardcoded -gencode flags entirely and letting torch derive them from the build machine (or from that env var) would make the build portable to any arch without a list to maintain. That is a bigger behavioral change than I wanted to make unasked — happy to switch this PR to that shape if you'd rather.

The extension is currently built only for sm_89 (Ada) and sm_90 (Hopper),
so it fails to load on every Ampere consumer/datacenter GPU: RTX 3090,
RTX 3080 Ti, A10, A40. Those cards are what a lot of people prototype
sparse attention on.

Adding compute_86/sm_86 costs one more gencode pass at build time and
nothing at runtime.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant