Skip to content

python: fix -Werror unused-parameter build break in init_gnn_submodule (pre-9.26 headers) - #728

Merged
Anerudhan merged 1 commit into
NVIDIA:developfrom
brandonfzhang:fix-gnn-unused-param
Aug 25, 2026
Merged

python: fix -Werror unused-parameter build break in init_gnn_submodule (pre-9.26 headers)#728
Anerudhan merged 1 commit into
NVIDIA:developfrom
brandonfzhang:fix-gnn-unused-param

Conversation

@brandonfzhang

@brandonfzhang brandonfzhang commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

init_gnn_submodule(py::module_ &m) guards its whole body with #if CUDNN_VERSION >= 92600 && !defined(_WIN32) — against pre-9.26 cuDNN headers (or on Windows) the body compiles away, m is unused, and the build's -Werror=unused-parameter makes every pip install . of current develop fail:

python/gnn.cpp:71:33: error: unused parameter 'm' [-Werror=unused-parameter]
ERROR: Failed building wheel for nvidia-cudnn-frontend

Seen wherever the source build runs inside a container shipping older cuDNN headers (e.g. recent NGC PyTorch images), while environments with 9.26+ headers build fine. Fix: [[maybe_unused]] on the parameter.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved build compatibility for Windows and environments using older cuDNN headers.
    • Prevented unused-parameter warnings from being treated as build errors.
    • Preserved existing runtime behavior when GNN bindings are enabled.

With pre-9.26 cuDNN headers (or _WIN32) the whole #if body compiles away
and 'm' is unused; -Werror=unused-parameter then fails the pip source
build (seen in containers shipping older cuDNN headers, where every
'pip install .' of current develop breaks). Mark it [[maybe_unused]].

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@brandonfzhang brandonfzhang added cat-bugfix mod-frontend cuDNN frontend APIs, operation graph construction, plans, and user-facing wrappers. orig-nv-eng Reported or requested by NVIDIA engineering. labels Aug 25, 2026
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 92aa8dbd-8459-4594-8386-5bad5b9d235b

📥 Commits

Reviewing files that changed from the base of the PR and between 139b154 and 333adcd.

📒 Files selected for processing (1)
  • python/gnn.cpp

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The GNN submodule initializer marks its module parameter as [[maybe_unused]]. This prevents unused-parameter warnings when guarded GNN registration is excluded. Runtime behavior remains unchanged when GNN bindings are compiled.

Changes

GNN warning handling

Layer / File(s) Summary
Initializer warning guard
python/gnn.cpp
init_gnn_submodule marks its module parameter as [[maybe_unused]] and documents why the parameter can be unused on some builds.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 333ad

This narrowly scoped build fix prevents an unused-parameter warning from failing builds with older cuDNN headers or on Windows; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: tingyu66

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description clearly explains the build failure, affected configurations, error, and fix. However, it omits the required template sections for affected area, API and compatibility impact, testing, … Rewrite the description using the repository template. Add the affected area, API and compatibility impact, exact testing commands and results, related issue information or an explicit statement that none applies, and complete the license, …
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Python binding, the unused-parameter build failure, and the affected pre-9.26 header configuration.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description clearly explains the build failure, affected configurations, error, and fix. However, it omits the required template sections for affected area, API and compatibility impact, testing, related issues, and submission checklist items.

Resolution

Rewrite the description using the repository template. Add the affected area, API and compatibility impact, exact testing commands and results, related issue information or an explicit statement that none applies, and complete the license, pre-commit, and label checklist items.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@Anerudhan Anerudhan added this to the Frontend 1.28.0 milestone Aug 25, 2026
@Anerudhan
Anerudhan merged commit 36a06c4 into NVIDIA:develop Aug 25, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat-bugfix mod-frontend cuDNN frontend APIs, operation graph construction, plans, and user-facing wrappers. orig-nv-eng Reported or requested by NVIDIA engineering.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants