build: bypass Torch CUDA discovery without nvcc#5558
Conversation
Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.5)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughA new CMake boolean option ChangesPyTorch CUDA bypass option
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5558 +/- ##
==========================================
- Coverage 82.16% 82.14% -0.03%
==========================================
Files 896 900 +4
Lines 102643 104140 +1497
Branches 4340 4474 +134
==========================================
+ Hits 84341 85550 +1209
- Misses 16965 17180 +215
- Partials 1337 1410 +73 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.5)
Summary
DEEPMD_BYPASS_TORCH_CUDA_CHECKCMake option, enabled by default.nvccis unavailable, predefine an importedtorch::cudarttarget beforefind_package(Torch).Motivation
CUDA-enabled PyTorch wheels can force CMake CUDA toolkit discovery from
TorchConfig.cmake, even for CPU-only DeePMD-kit PyTorch builds. This mirrors the workaround used in deepmd-gnn so CPU-only builds do not require a local CUDA compiler.Tests
uvx pre-commit run --files source/CMakeLists.txt doc/install/install-from-source.mdcmake -S source -B /tmp/deepmd-kit-cmake-bypass-test -DENABLE_PYTORCH=ON -DBUILD_CPP_IF=OFF -DBUILD_PY_IF=ON -DCMAKE_PREFIX_PATH=/tmp/deepmd-kit-fake-torch -DUSE_CUDA_TOOLKIT=OFF -DCMAKE_BUILD_TYPE=Release-DDEEPMD_BYPASS_TORCH_CUDA_CHECK=OFF, confirming the shim is what unblocksfind_package(Torch).Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.5)
Summary by CodeRabbit
Documentation
New Features