[AMD] Fix DSV4 JIT build on rocm - #31131
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Verification run triggered: run 29313160939 on this branch, config |
|
sorry i somehow missed this PR (I review the PR from latest to this...). might be a duplicate of #31141 |
…get_cc_major) Adopt the reviewed approach from #31141 (per @DarkSharpness): move the CUDA-only compute-capability query out of utils.cuh into runtime.cuh where the cuda*->hip* attribute shims already live, so it compiles on both CUDA and HIP with no #ifndef USE_ROCM guard. Add the cudaDevAttrComputeCapabilityMinor->hip #define + get_cc_minor, and express get_sm_version(id) = get_cc_major(id) * 10 + get_cc_minor(id). No JIT-tree caller, so no use-site change. Co-authored-by: kangwangamd <kangwang@amd.com>
454a8e4 to
1da00ab
Compare
|
@DarkSharpness Sure, we didn't coordinate on this upfront. I've since synced with @kangwangamd (author of #31141). The reason I kept this as a separate PR: the MI355X 2N 1P1D disaggregation nightly only runs on a branch inside sgl-project/sglang (the workflow is gated on github.repository == 'sgl-project/sglang'), so we need an upstream branch to actually drive the hardware tests — a fork branch can't trigger it. So I've brought the reviewed changes from #31141 over to this branch (move getSMVersion into runtime.cuh as get_sm_version, dedup with get_cc_major / get_cc_minor, drop the USE_ROCM guard) and added @kangwangamd as co-author. Happy to close whichever PR you'd prefer to keep. |
|
/rerun-failed-ci |
|
PR Test Base is finished, the only one failure is https://github.com/sgl-project/sglang/actions/runs/29352408580/job/87255423678?pr=31131#logs
irrelevant to this PR |
Co-authored-by: kangwangamd <kangwang@amd.com>
Co-authored-by: kangwangamd <kangwang@amd.com>
Co-authored-by: kangwangamd <kangwang@amd.com>



Motivation
The Jul-14 scheduled Nightly Test (AMD MI355X 2N 1P1D Disagg) (run 29305625618) failed on every DeepSeek-V4 config (flash/pro × fp8/fp4 × base/dp8ep8/mtp) at scheduler init:
#30438 added getSMVersion() to jit_kernel/include/sgl_kernel/utils.cuh using the CUDA-only enums cudaDevAttrComputeCapabilityMajor/Minor. The JIT path (tvm-ffi + hipcc) does not run hipify — unlike the compiled sgl-kernel, whose ROCm build hipifies cudaDevAttr* → hipDeviceAttribute* — so on gfx950 those identifiers are undeclared, the DeepSeek-V4 compress-plan JIT fails to build, and the scheduler dies. (Kimi-K2.6 doesn't build this JIT, so it was unaffected.)
Modifications
Adopting the reviewed approach from #31141 (thanks @kangwangamd, @DarkSharpness): instead of guarding the CUDA-only calls with
#ifndef USE_ROCM, movegetSMVersionout ofutils.cuhintoruntime.cuh, where thecuda*→hip*attribute shims already live — so it compiles on both CUDA and HIP with no guard.cudaDevAttrComputeCapabilityMinor→hipDeviceAttributeComputeCapabilityMinor#define(the Major one was already present).get_cc_minor()mirroring the existingget_cc_major(), and expressget_sm_version(id) = get_cc_major(id) * 10 + get_cc_minor(id)to deduplicate the compute-capability queries.getSMVersionfromutils.cuh. It has no caller in the JIT tree (its only reference was its own definition; SM120 gating is done in Python viais_sm120_supported()), so there is no use-site change. No CUDA-path behavior change.Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #29352408580
Latest PR Test (Extra): ✅ Run #29384613963