Update conv get-plan sample heuristic config count#278
Conversation
📝 WalkthroughWalkthroughThis PR refactors the cuDNN heuristics engine configuration generator in ChangesHeuristics engine config selection refactoring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Infer (1.2.0)samples/legacy_samples/conv_sample.cppIn file included from samples/legacy_samples/conv_sample.cpp:23: ... [truncated 2200 characters] ... ntend__CFrontend_decl.CFrontend_decl_funct.add_method in file "src/clang/cFrontend_decl.ml" (inlined), line 54, characters 4-52 Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
samples/legacy_samples/conv_sample.cpp (1)
983-983: ⚡ Quick winDocument the rationale for requesting only the first config.
Changing from
heurgen_method(all configs) toheurgen_method_first_config(1 config) significantly alters behavior:
- Only one plan will be available for execution
- Workspace size calculation (lines 989-995) will only consider the first plan
- No fallback plans if the first config fails to build or execute
While this aligns with using
cudnnGetPlanfor heuristics-only workflows (per comment lines 1011-1013), adding a comment here would clarify that a single top-heuristic config is sufficient for this use case.📝 Suggested comment
+ // Use first config only since cudnnGetPlan is for heuristics-based plan selection without benchmarking std::array<cudnn_frontend::GeneratorSource const, 1> sources = {heurgen_method_first_config};🤖 Prompt for 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. In `@samples/legacy_samples/conv_sample.cpp` at line 983, Assigning only the top heuristic config via heurgen_method_first_config (instead of heurgen_method) intentionally restricts execution to a single plan: add a comment at the sources assignment explaining this choice, referencing heurgen_method_first_config and cudnnGetPlan so readers know we only need the top heuristic for a heuristics-only workflow; note the implications that workspace size computation and plan-building will consider only that first config and there will be no fallback plans if it fails, and justify that this is acceptable because the code is using cudnnGetPlan-style heuristics rather than enumerating all configs.
🤖 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.
Nitpick comments:
In `@samples/legacy_samples/conv_sample.cpp`:
- Line 983: Assigning only the top heuristic config via
heurgen_method_first_config (instead of heurgen_method) intentionally restricts
execution to a single plan: add a comment at the sources assignment explaining
this choice, referencing heurgen_method_first_config and cudnnGetPlan so readers
know we only need the top heuristic for a heuristics-only workflow; note the
implications that workspace size computation and plan-building will consider
only that first config and there will be no fallback plans if it fails, and
justify that this is acceptable because the code is using cudnnGetPlan-style
heuristics rather than enumerating all configs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 54429858-8320-48c5-b8c4-06f48e98e891
📒 Files selected for processing (1)
samples/legacy_samples/conv_sample.cpp
Summary by CodeRabbit