[Fix] Discover flat CUDA includes for NVRTC - #2829
Conversation
|
👋 Hi! Thank you for contributing to the TileLang project. Please remember to run We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe NVRTC backend now discovers CUDA include directories across flat, target-specific, mixed, missing-layout, and Windows installations. NVRTC generation uses the discovered directories and conditionally adds legacy ChangesNVRTC include-path discovery
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@testing/python/jit/test_tilelang_jit_nvrtc_include_paths.py`:
- Around line 15-49: Update every discover_cuda_include_paths call in the four
tests to pass system="linux" explicitly, while preserving the existing machine
arguments, paths, and expected results.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b34d6935-88e5-43b5-8dd1-811e5dc6d83e
📒 Files selected for processing (3)
testing/python/jit/test_tilelang_jit_nvrtc_include_paths.pytilelang/jit/adapter/nvrtc/include_paths.pytilelang/jit/adapter/nvrtc/libgen.py
Fixes #2828.
Problem
On Linux, the NVRTC backend always derived CCCL headers from
$CUDA_HOME/targets/<arch>-linux/include/cccl. Flat pip CUDA installations instead provide$CUDA_HOME/includeand$CUDA_HOME/include/cccl, so the generated NVRTC options omitted the existing CCCL tree and pointed at a non-existent target-specific path.A synthetic flat tree reproduced the mismatch on the base revision:
Change
Discover existing flat and host-target include roots and their CCCL subdirectories, preserving their deterministic order. Installations that overlay both layouts include both. Windows retains its flat include behavior, and a missing Linux layout retains the previous fallback candidate list so NVRTC still owns the final missing-header diagnostic.
CUDA versions before 13 continue to receive the corresponding legacy
cuda/stdinclude for each discovered base include root.Regression coverage
The new synthetic-layout tests construct temporary directory trees for:
The tests never inspect the host CUDA installation and would fail on the base implementation because it has no flat CCCL discovery path.
Validation
_FinderandScikitBuildRedirectingFinderentries fromsys.meta_path, then printedtilelang.__file__before callingpytest.main(["testing/python/jit/test_tilelang_jit_nvrtc_include_paths.py", "-q"]). It resolved/home/morluto/dev/tilelang-agent-nvrtc/tilelang/__init__.pyand reported 5 passed.python -m pre_commit run --files tilelang/jit/adapter/nvrtc/include_paths.py tilelang/jit/adapter/nvrtc/libgen.py testing/python/jit/test_tilelang_jit_nvrtc_include_paths.py— all hooks passed.Summary
ccclsubdirectories for each discovered include root.cuda/stdincludes for CUDA versions before 13.