Skip to content

[JIT Kernel] Fix NVFP4 multi-arch compilation failure - #20874

Merged
BBuf merged 2 commits into
sgl-project:mainfrom
mmangkad:fix-nvfp4-jit-arch
Mar 20, 2026
Merged

BBuf merged 2 commits into
sgl-project:mainfrom
mmangkad:fix-nvfp4-jit-arch

Conversation

@mmangkad

@mmangkad mmangkad commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Remove unnecessary extra 10.3a arch append in _get_nvfp4_cuda_arch_list(). Before #20103 this was harmless (just wasted compilation for an unused arch on CUDA 13+), but now that load_jit() injects a single SGL_CUDA_ARCH, compiling for multiple archs triggers a static_assert mismatch.

cc @DarkSharpness

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

# JIT compilation targets only the current device, unlike AOT fat-binaries;
# adding extra architectures here would clash with the single SGL_CUDA_ARCH
# value injected by load_jit().
return f"{major}.{minor}a"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we remove this context? JIT kernel already use current arch major.minor. We just need to check that whether major >= 10 here.

@mmangkad mmangkad Mar 18, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Don't we need the a suffix though? _get_cuda_arch_list() in utils.py returns major.minor without a, but NVFP4 requires sm_*a targets

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ic. let's just keep it for now.

@mmangkad mmangkad Mar 19, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@DarkSharpness shall we land this now or do you still see any issues?

@xingsy97

xingsy97 commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

LGTM for mitigating the issue. It seems that the JIT multi-arch build logic was copied from AOT build logic, but JIT only targets the current device, so simply removing it is right.

@mmangkad

Copy link
Copy Markdown
Collaborator Author

/rerun-stage stage-c-test-4-gpu-b200

@github-actions

Copy link
Copy Markdown
Contributor

✅ Triggered stage-c-test-4-gpu-b200 to run independently (skipping dependencies).

@github-actions

Copy link
Copy Markdown
Contributor

🔗 View workflow run

@mmangkad

Copy link
Copy Markdown
Collaborator Author

/rerun-stage stage-b-test-small-1-gpu

@github-actions

Copy link
Copy Markdown
Contributor

✅ Triggered stage-b-test-small-1-gpu to run independently (skipping dependencies).

@github-actions

Copy link
Copy Markdown
Contributor

🔗 View workflow run

@mmangkad

mmangkad commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator Author

/rerun-failed-ci

@BBuf
BBuf merged commit 3d749c4 into sgl-project:main Mar 20, 2026
220 of 244 checks passed
@mmangkad
mmangkad deleted the fix-nvfp4-jit-arch branch March 20, 2026 03:37
Wangzheee pushed a commit to Wangzheee/sglang that referenced this pull request Mar 21, 2026
JustinTong0323 pushed a commit to JustinTong0323/sglang that referenced this pull request Apr 7, 2026
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