Skip to content

fix: align is_sm120f_supported with SM12x family semantics - #3175

Merged
kahyunnam merged 1 commit into
flashinfer-ai:mainfrom
leonardHONG:fix/3170-is-sm120f-supported
May 5, 2026
Merged

kahyunnam merged 1 commit into
flashinfer-ai:mainfrom
leonardHONG:fix/3170-is-sm120f-supported

Conversation

@leonardHONG

@leonardHONG leonardHONG commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

📌 Description

is_sm120f_supported requires minor == 0, so it returns False on sm_121 even though the 120f gencode target covers both sm_120 and sm_121. Drop the minor == 0 check.

No callers in flashinfer/ or tests/. Only CLAUDE.md mentions it. Could delete the function instead if that's cleaner.

🔍 Related Issues

Refs #3170 (Action Item 5 / A1).

🚀 Pull Request Checklist

✅ Pre-commit Checks

  • I have installed pre-commit by running pip install pre-commit (or
    used your preferred method).
  • I have installed the hooks with pre-commit install.
  • I have run the hooks manually with pre-commit run --all-files and
    fixed any reported issues.

Ran pre-commit run --files flashinfer/utils.py; passed.

🧪 Tests

  • Tests have been added or updated as needed.
  • All tests are passing (unittest, etc.).

No new tests; the function is currently uncalled.

Reviewer Notes

Summary by CodeRabbit

  • Bug Fixes
    • Expanded SM120f GPU support compatibility to include additional GPU variants within the compute capability 12 family while maintaining CUDA version requirements.

@coderabbitai

coderabbitai Bot commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e1694fca-f63d-4888-9bd6-7b73278e0d85

📥 Commits

Reviewing files that changed from the base of the PR and between 24c4aee and 1a876d3.

📒 Files selected for processing (1)
  • flashinfer/utils.py

📝 Walkthrough

Walkthrough

The is_sm120f_supported function in flashinfer/utils.py was modified to check only the GPU's compute capability major version (major == 12) instead of requiring a specific minor version, while maintaining the CUDA version requirement.

Changes

Cohort / File(s) Summary
GPU Compute Capability Check
flashinfer/utils.py
Modified is_sm120f_supported to ignore compute capability minor version, now checking only major == 12 instead of major == 12 and minor == 0.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

run-ci

Suggested reviewers

  • yzh119
  • bkryu
  • cyx-6
  • nvmbreughe

Poem

🐰 A minor version checked, now let it go,
Any SM12 will gracefully flow,
No more strict bounds on our GPU's might,
Flexibility blooms—compatibility takes flight! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: removing the minor version check to align SM120f support with SM12x family semantics.
Description check ✅ Passed The description covers the core issue (minor == 0 check prevents sm_121 support), rationale, related issue reference, and pre-commit status. However, test section is incomplete.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@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 the is_sm120f_supported function in flashinfer/utils.py to simplify the compute capability check by only verifying the major version (12) and removing the specific minor version check. I have no feedback to provide.

@sricketts

Copy link
Copy Markdown
Member

/bot run

@flashinfer-bot

Copy link
Copy Markdown
Collaborator

GitLab MR !614 has been created, and the CI pipeline #49717071 is currently running. I'll report back once the pipeline job completes.

@kahyunnam
kahyunnam enabled auto-merge (squash) May 4, 2026 22:31
@kahyunnam
kahyunnam merged commit ec0178a into flashinfer-ai:main May 5, 2026
48 of 75 checks passed
kahyunnam pushed a commit that referenced this pull request May 18, 2026
## 📌 Description

  After #3113 extended the b12x decorator to SM121, calling `mm_fp4(...,
  backend="b12x")` on sm_121 still trips the dispatch-side check in
  `dense_blockscaled_gemm_sm120_b12x.py:1591`:

  ```
  ValueError: dense_gemm launch only supports sm_120, got sm_121
  ```

SM120 and SM121 share the same 12.x spec (MMA atoms, SMEM), so the same
kernel applies. Allow sm_121 through the check. The error message is
updated to match.

  Other call sites in this file (`sm_version="sm_120"` at line 1875,
`get_smem_capacity_in_bytes("sm_120")` at lines 122/1461) are left alone
— they work for both arches.

  ## 🔍 Related Issues

  Refs #3170 (Action Item 4). Follows up on #3113.

  ## 🚀 Pull Request Checklist

  ### ✅ Pre-commit Checks

- [x] I have installed `pre-commit` by running `pip install pre-commit`
(or used your preferred method).
  - [x] I have installed the hooks with `pre-commit install`.
- [x] I have run the hooks manually with `pre-commit run --all-files`
and fixed any reported issues.

  ## 🧪 Tests

  - [ ] Tests have been added or updated as needed.
  - [ ] All tests are passing (`unittest`, etc.).

No new tests; no SM121 hardware locally. Existing sm_120 path unchanged.

  ## Reviewer Notes

Same audit cleanup batch as #3173 / #3174 / #3175.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Improvements**
* Expanded GPU architecture support to include additional SM12x devices
(sm_120 and sm_121).

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants