[cccl.c] Fix scan policy mismatch between host and NVRTC#9770
[cccl.c] Fix scan policy mismatch between host and NVRTC#9770NaderAlAwar wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
important: verify the CUDA version threshold (13.4) used in the static_assert actually matches the fixed NVBug version; a wrong boundary silently re-enables the mismatch on affected toolkits. WalkthroughIn c/parallel/src/scan.cu, cccl_device_scan_compile now adds a static_assert gated on CUDA version to enforce one-way forcing behavior, and conditionally appends -DCCCL_DISABLE_WARPSPEED_SCAN to NVRTC compile arguments when the host-selected policy uses the lookback scan algorithm, aligning host and JIT algorithm selection. ChangesScan JIT Compile Fix
Comment |
🥳 CI Workflow Results🟩 Finished in 1h 36m: Pass: 100%/20 | Total: 5h 44m | Max: 1h 06m | Hits: 98%/1515See results here. |
The scan tuning policy is computed twice: once in the prebuilt cccl.c library and once by NVRTC while JIT-compiling the kernel, with a
static_assertchecking they agree. The decision depends on the CUDA compiler version (_CCCL_CUDACC_BELOW(13, 4)sm_120 guard,MSVC && nvcc < 13.1), so when the library's build CTK and the runtime NVRTC differ — e.g. a 13.1-built wheel meeting NVRTC 13.4, which enables warpspeed on sm_120 — the two sides pick different algorithms and every scan build fails with Error 999.Fix: when the host picks lookback, pass
-DCCCL_DISABLE_WARPSPEED_SCANto NVRTC so the JIT makes the same choice. The other direction can't diverge as long as the library is built with CUDA < 13.4; astatic_assertenforces that. This means cccl.c stays on lookback for sm_120 even with NVRTC 13.4 — acceptable since c.parallel v2 evaluates the policy only once and doesn't have this problem.Verified on an sm_120 GPU with a 13.1-built library: baseline fails with the reported assert against NVRTC-as-13.4, fixed build compiles and produces correct scan results against both 13.3 and 13.4; sm_100 still selects warpspeed.