Skip to content

ci: add 12.1a to aarch64 jit-cache wheel arch targets - #3907

Closed
yichengj0 wants to merge 3 commits into
flashinfer-ai:mainfrom
yichengj0:wheel-arch-121a
Closed

yichengj0 wants to merge 3 commits into
flashinfer-ai:mainfrom
yichengj0:wheel-arch-121a

Conversation

@yichengj0

@yichengj0 yichengj0 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

📌 Description

Resolves item 12 of the SM121 support audit (#3170). The CUDA >= 12.9
flashinfer-jit-cache wheels build only the 12.0f family target for SM12x. Two
consequences:

  • detect_sm_capabilities() in aot.py looks for compute_121 in the gencode flags,
    never finds it, and skips the arch-specific fp4_quantization_121 module. The SM120
    counterpart is prebuilt anyway, because has_sm120 matches the compute_120 substring
    inside compute_120f.
  • Generic modules carry no native sm_121a SASS. The family target covers them
    functionally today; an arch build leaves room for arch-specific features later (for
    example sparse block-scaled MMA).

Fixes:

  • Add 12.1a next to 12.0f in the aarch64 FLASHINFER_CUDA_ARCH_LIST for the CUDA
    12.9 and 13.0 wheel builds (release.yml, nightly-release.yml).
  • Sync the copy of this list in scripts/task_test_jit_cache_package_build_import.sh.
  • Sync the example lists in the docs (README, docs/installation.rst, and CLAUDE.md,
    which also gains the missing 10.3a), and add a short note that the full list needs
    CUDA 13.0 and should be trimmed on older toolkits (11.0a already required 13.0
    before this change).
  • Leave the CUDA 12.8 branch as is: its nvcc predates the SM12x family and 121 targets,
    and it already ships 12.0a.

🔍 Related Issues

#3170 (item 12). Pairs with #3906 (item 15): together they let SM121 wheel installs load
the native sm_121a FP4 quantization module instead of falling back to 120f, matching
source installs and keeping FLASHINFER_DISABLE_JIT covered.

🧪 Tests

On DGX Spark (GB10, SM121, CUDA 13, aarch64):

  • Simulated the workflow expression (GitHub Actions coerces the version strings to
    numbers for <; for these values that matches plain string comparison) and the script
    snippet for all 6 matrix combos
    ({12.8, 12.9, 13.0} x {x86_64, aarch64}). Both produce identical lists that match the
    intended table, and only the two aarch64 >= 12.9 lists change.
  • With the new list, detect_sm_capabilities() reports sm121: True, and
    CompilationContext emits the compute_120f and compute_121a gencodes together.
  • Built the norm module with both gencodes in one list; cuobjdump --list-elf shows the
    sm_120 (family) and sm_121a cubins side by side in one fatbin.
    fp4_quantization_121 builds with compute_121a.
  • pre-commit run on the changed files: clean.

Reviewer Notes

  • Item 12 also asked for 12.0a; skipped on purpose. The item's reasoning ("wheels lack
    NVFP4/MXFP4 MMA") was corrected later in the issue: dense block-scaled FP4 MMA, the only
    kind FlashInfer uses, is available on 120f (PTX ISA >= 8.8), and the SM120 arch FP4
    module is already prebuilt through the substring match above. Adding 12.0a would only
    grow the wheels.
  • 12.1a goes into the aarch64 lists only, like 11.0a (Thor), since SM121 hardware has
    no x86 host.
  • Cost: aarch64 cu129/cu130 wheels gain one extra SM12x gencode per module that supports
    major version 12, so larger fatbins and longer CI builds. x86_64 wheels are unchanged.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements

    • Expanded CUDA architecture coverage for JIT cache builds, including additional targets such as 12.1a.
    • Refined CUDA architecture selection on aarch64 for CUDA versions around 12.9 and 13.0, improving accuracy for generated builds.
  • Documentation

    • Updated installation/build guidance for flashinfer-jit-cache to note that the full CUDA architecture list requires CUDA 13.0 and should be trimmed for older toolkits.
    • Expanded FLASHINFER_CUDA_ARCH_LIST examples to include the newly supported architecture entries.

yichengj0 and others added 2 commits July 10, 2026 01:46
CUDA >= 12.9 flashinfer-jit-cache wheels build only the 12.0f family
target for SM12x, so aot.py never detects sm121 and skips the
arch-specific fp4_quantization_121 module; generic modules also carry
no sm_121a SASS. Add 12.1a alongside 12.0f in the aarch64 lists for
CUDA 12.9 and 13.0 — SM121 (DGX Spark) hardware is aarch64-only,
following the 11.0a (Thor) precedent — and keep x86_64 lists
unchanged. Sync the mirror list in the jit-cache package build test
script and the documented example arch lists.

AI-assisted with Claude Code.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The flashinfer-jit-cache example FLASHINFER_CUDA_ARCH_LIST mixes archs
with different minimum toolkit versions (11.0a needs CUDA 13.0, 12.0f
and 12.1a need 12.9), so copying it verbatim fails on older toolkits.
Add a short note next to each documented list.

AI-assisted with Claude Code.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8865e08e-149b-43d6-a9dd-a7dff137b388

📥 Commits

Reviewing files that changed from the base of the PR and between ff797a9 and fb7e206.

📒 Files selected for processing (4)
  • .github/workflows/release.yml
  • CLAUDE.md
  • README.md
  • docs/installation.rst
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/installation.rst
  • README.md
  • CLAUDE.md

📝 Walkthrough

Walkthrough

The PR aligns JIT cache CUDA architecture selection across build scripts and release workflows, adds aarch64-specific targets, and updates documentation with CUDA 13.0 compatibility guidance.

Changes

JIT cache CUDA architecture selection

Layer / File(s) Summary
Architecture detection and version branching
scripts/task_test_jit_cache_package_build_import.sh
CUDA architecture selection derives the machine type before version branching and adds 12.1a for aarch64 builds.
Release workflow architecture selection
.github/workflows/{nightly-release.yml,release.yml}
JIT cache wheel builds select architecture lists by CUDA version and aarch64 status.
Toolkit architecture guidance
CLAUDE.md, README.md, docs/installation.rst
Build instructions document the expanded CUDA 13.0 architecture list and advise trimming it for older toolkits.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: automated

Suggested reviewers: yzh119, aleozlx, yongwww, cyx-6, saltyminty

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed It clearly describes the main change: adding 12.1a architecture targets for aarch64 jit-cache wheels in CI.
Description check ✅ Passed It covers the main purpose, related issue, tests, and reviewer notes; only the checklist items are not fully filled out.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates documentation and build scripts to support the 12.1a CUDA architecture on aarch64 platforms for CUDA versions 12.9 and above. Specifically, it updates the FLASHINFER_CUDA_ARCH_LIST examples in CLAUDE.md, README.md, and docs/installation.rst, and updates the JIT cache package build script to conditionally append 12.1a based on the CUDA version and architecture. Feedback was provided to consolidate redundant conditional blocks in the JIT cache build script to improve maintainability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 148 to +161
if (major, minor) >= (13, 0):
arches.append("10.0a")
arches.append("10.3a")
machine = (os.environ.get("ARCH") or platform.machine()).lower()
if machine in ("aarch64", "arm64"):
if is_aarch64:
arches.append("11.0a")
arches.append("12.0f")
if is_aarch64:
arches.append("12.1a")
elif (major, minor) >= (12, 9):
arches.append("10.0a")
arches.append("10.3a")
arches.append("12.0f")
if is_aarch64:
arches.append("12.1a")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic blocks for CUDA >= 13.0 and >= 12.9 are highly redundant, differing only by the conditional addition of 11.0a on aarch64 for CUDA >= 13.0. Consolidating these blocks reduces duplication and improves maintainability while preserving the exact order of the architectures.

Suggested change
if (major, minor) >= (13, 0):
arches.append("10.0a")
arches.append("10.3a")
machine = (os.environ.get("ARCH") or platform.machine()).lower()
if machine in ("aarch64", "arm64"):
if is_aarch64:
arches.append("11.0a")
arches.append("12.0f")
if is_aarch64:
arches.append("12.1a")
elif (major, minor) >= (12, 9):
arches.append("10.0a")
arches.append("10.3a")
arches.append("12.0f")
if is_aarch64:
arches.append("12.1a")
if (major, minor) >= (12, 9):
arches.append("10.0a")
arches.append("10.3a")
if (major, minor) >= (13, 0) and is_aarch64:
arches.append("11.0a")
arches.append("12.0f")
if is_aarch64:
arches.append("12.1a")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — the suggestion is output-equivalent, but keeping the branches separate is intentional: the three-branch if/elif maps one-to-one onto the workflow ternary's branches in release.yml/nightly-release.yml (12.8 / 12.9 / 13.0), so each branch reads as that CUDA version's complete list and can be eyeball-diffed against the workflow string directly. Merging 12.9 and 13.0 would save three lines but lose that mapping, so we'll keep the current structure.

@dierksen

Copy link
Copy Markdown
Collaborator

@flashinfer-bot run

@yichengj0

Copy link
Copy Markdown
Contributor Author

Size measurement for reviewers (method: per-module readelf/cuobjdump analysis of the published v0.6.9 cu130 aarch64 jit-cache wheel, calibrated against a local build with and without the extra gencode):

  • Current wheel: 2,117,346,931 bytes zipped, only ~30 MB under GitHub's 2 GiB release-asset cap; 9.36 GB installed across 948 .so modules.
  • This PR as measured: about +1.54 GB installed (+16.4%), roughly +350 MB zipped. That pushes the aarch64 wheel past the 2 GiB cap, so this PR is blocked on a size reduction and should not merge yet.
  • About 670 MB of the installed growth only duplicates already-dead SM12x code: fused_moe_103 (+319 MB), fused_moe_100 (+298 MB), gemm_sm100 (+48 MB), fp8_gemm_cutlass (+8 MB) carry sm_120f SASS that no device ever loads. SM12x dispatches to the dedicated SM120 modules instead (DGX Spark (SM121) Current Support Audit #3170 cross-cutting item 10). A separate PR removing major 12 from those generators, with a per-module dispatch audit, is in preparation; this PR should land after it.
  • Even with that fix the margin is thin (estimate ~2.16 GB vs the 2.147 GB cap), so further pruning of dead arch entries may be needed before this can land.

@yichengj0

Copy link
Copy Markdown
Contributor Author

The size fix mentioned above is now up: #3947 removes the dead SM12x code (1,046 MB installed in the cu130 aarch64 wheel) and should merge before this PR. With #3947 first, this PR's addition lands the aarch64 wheel at roughly 2.10 GB zipped, under the 2 GiB (2.147 GB) release-asset cap.

@yichengj0
yichengj0 marked this pull request as ready for review July 15, 2026 04:43
@dierksen

Copy link
Copy Markdown
Collaborator

It looks like right now, the cu129 nightly builds are still large enough that adding 121a will cause them to spill over the 2GiB limit significantly: https://github.com/flashinfer-ai/flashinfer/releases/tag/nightly-v0.6.15-20260722

I'm really not sure how to proceed at this point other than getting back to trying to split up the jit-cache wheels 😞

@coderabbitai coderabbitai Bot mentioned this pull request Jul 24, 2026
5 tasks
@yichengj0

Copy link
Copy Markdown
Contributor Author

It looks like right now, the cu129 nightly builds are still large enough that adding 121a will cause them to spill over the 2GiB limit significantly: https://github.com/flashinfer-ai/flashinfer/releases/tag/nightly-v0.6.15-20260722

I'm really not sure how to proceed at this point other than getting back to trying to split up the jit-cache wheels 😞

Good point! How about I scope this PR down to cu130 only? The only sm_121 device is GB10, which ships with CUDA 13 anyway, and cu129 already covers it via 12.0f. And if this feels too messy, I'm also fine shelving this PR until the wheel split is implemented.

@bkryu bkryu closed this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants