[BugFix] Skip source-compilation options when exporting LLVM module#2467
[BugFix] Skip source-compilation options when exporting LLVM module#2467penguin-wwy wants to merge 1 commit into
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 Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR updates executable export handling to skip compile arguments for LLVM targets and passes the kernel target through the adapter when saving the executable. ChangesTarget-aware kernel export
🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 `@tilelang/cache/kernel_cache.py`:
- Around line 462-469: The LLVM export gate in kernel_cache.py is too broad: it
skips all compile args for LLVM targets and accidentally drops the Windows
fcompile path from _get_compile_args(). Update the export logic around
cls._get_compile_args() and executable.export_library so only the Darwin
source-language options are suppressed for LLVM, while preserving the Windows
msvc_create_shared/fcompile hook and any other non-Darwin compile settings.
🪄 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
Run ID: 8aa43433-21e4-4334-b350-10483c601444
📒 Files selected for processing (2)
tilelang/cache/kernel_cache.pytilelang/jit/adapter/kernel_cache.py
Running the LLVM backend tests on macOS produces a cache-save compilation error, even though the kernel itself compiles and runs correctly:
The failing command (from the log):
The binary .o object files are being parsed as source text.
The error is triggered by the interaction between tilelang's cache-save path and TVM's export_library:
Summary
-x objective-c++) when exporting to a shared library.KernelCache._safe_write_executableto accept an optionaltargetand to strip the"options"compile-arg entry fordarwin+target.kind.name == "llvm"before calling TVMexport_library.targetthrough the JIT adapter (_save_so_cubin_to_disk→_safe_write_executable) so the LLVM-specific export adjustment can be applied during cache save.