fix: Improve CUDA compute capability warning messages#7658
fix: Improve CUDA compute capability warning messages#7658AsadShahid04 wants to merge 2 commits intoai-dynamo:mainfrom
Conversation
|
👋 Hi AsadShahid04! Thank you for contributing to ai-dynamo/dynamo. Just a reminder: The 🚀 |
WalkthroughModified the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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
🧹 Nitpick comments (2)
lib/kvbm-kernels/build.rs (2)
318-319:skipped_archsis populated but never used.The vector collects skipped architectures on line 336, but is never read afterwards. Either remove this dead code or add a summary warning (similar to the
compiled_archsmessage) that lists all skipped architectures in aggregate—this would be valuable for the diagnostic goal of this PR.♻️ Option: Add an aggregated skipped-architectures warning
if !compiled_archs.is_empty() { println!( "cargo:warning=Building kernels for GPU architectures: sm_{}", compiled_archs .iter() .map(|a| a.to_string()) .collect::<Vec<_>>() .join(", sm_") ); } + + if !skipped_archs.is_empty() { + println!( + "cargo:warning=Skipped architectures (unsupported by CUDA toolkit): sm_{}", + skipped_archs + .iter() + .map(|(arch, _)| arch.to_string()) + .collect::<Vec<_>>() + .join(", sm_") + ); + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/kvbm-kernels/build.rs` around lines 318 - 319, The variable skipped_archs is populated but never used; either remove it or emit an aggregated warning like the compiled_archs summary. Update the build logic around compiled_archs and skipped_archs to (a) if you keep skipped_archs, produce a single processLogger.warn or eprintln summarizing skipped_archs (e.g., "Skipped architectures: ...") after the loop similar to the compiled_archs message, or (b) if you remove it, delete the skipped_archs declaration and all push/usage sites; locate symbols compiled_archs and skipped_archs in build.rs to apply the change.
336-336: Consider storing justarch_numif you don't needmax.Currently storing
(arch_num, max)butmaxis the same for all skipped entries within a single build. If you add the aggregated warning (as suggested above), onlyarch_numis needed.✨ Simplified storage
- let mut skipped_archs = Vec::new(); + let mut skipped_archs: Vec<u32> = Vec::new(); ... - skipped_archs.push((arch_num, max)); + skipped_archs.push(arch_num);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/kvbm-kernels/build.rs` at line 336, The code currently pushes tuples with (arch_num, max) into skipped_archs but max is identical for all entries; change skipped_archs to store only arch_num (e.g., Vec<ArchNum>), update the push site where skipped_archs.push((arch_num, max)) to push only arch_num, and update any downstream uses that read skipped_archs to expect a single-value list (adjusting any pattern matches, formatting in the aggregated warning, and where max is read to use the common max value instead). Ensure the variable declaration/type for skipped_archs and all references (including the push and the warning/aggregation logic) are updated consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/kvbm-kernels/build.rs`:
- Around line 347-356: Add an explicit warning when compiled_archs is empty:
after the existing if !compiled_archs.is_empty() block, add an else branch that
emits a cargo:warning stating that no GPU architectures were compiled because
all requested architectures exceed max_compute (reference the compiled_archs
variable and max_compute threshold) and suggest that this will produce "no
kernel image available" runtime errors; include the requested architectures or
indication of the threshold in the message for diagnostics.
---
Nitpick comments:
In `@lib/kvbm-kernels/build.rs`:
- Around line 318-319: The variable skipped_archs is populated but never used;
either remove it or emit an aggregated warning like the compiled_archs summary.
Update the build logic around compiled_archs and skipped_archs to (a) if you
keep skipped_archs, produce a single processLogger.warn or eprintln summarizing
skipped_archs (e.g., "Skipped architectures: ...") after the loop similar to the
compiled_archs message, or (b) if you remove it, delete the skipped_archs
declaration and all push/usage sites; locate symbols compiled_archs and
skipped_archs in build.rs to apply the change.
- Line 336: The code currently pushes tuples with (arch_num, max) into
skipped_archs but max is identical for all entries; change skipped_archs to
store only arch_num (e.g., Vec<ArchNum>), update the push site where
skipped_archs.push((arch_num, max)) to push only arch_num, and update any
downstream uses that read skipped_archs to expect a single-value list (adjusting
any pattern matches, formatting in the aggregated warning, and where max is read
to use the common max value instead). Ensure the variable declaration/type for
skipped_archs and all references (including the push and the warning/aggregation
logic) are updated consistently.
🪄 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: a1c167a6-938a-4f32-b1f1-24c7031d8e17
📒 Files selected for processing (1)
lib/kvbm-kernels/build.rs
e08ec14 to
793dbe6
Compare
- Add detailed logging of which GPU architectures are being compiled - Clearly show compiled architectures (sm_XX) in build output - Helps users diagnose 'no kernel image available' errors Fixes ai-dynamo#7569 Signed-off-by: Asad Shahid <[email protected]>
793dbe6 to
4930108
Compare
Signed-off-by: Asad Shahid <[email protected]>
Fixes #7569
Summary by CodeRabbit