Skip to content

feat(hipdnn): Implement a container like ProblemDescription to pack problem parameters - #11922

Merged
BalintCsala merged 2 commits into
ROCm:developfrom
StreamHPC:users/BalintCsala/problem-description-hipdnn
Sep 24, 2026
Merged

BalintCsala merged 2 commits into
ROCm:developfrom
StreamHPC:users/BalintCsala/problem-description-hipdnn

Conversation

@BalintCsala

Copy link
Copy Markdown
Member

Motivation

During the implementation of the batchnorm fwd training functionality in the HIP kernel plugin in this PR, we had to bring in a few helper functions such as DefaultConfigSpatialMultiple and DefaultConfigSpatialMultiple , which helps us in finding the right kernel config based on the problem heuristics. They were implemented such that the input arguments are the raw problem parameters. In MIOpen, the same functions use the ProblemDescription struct to pass around this information in a more compact form, which is a cleaner approach.

Closes #11921

Technical Details

This PR implements a similar struct (also named ProblemDescription) in the hip kernel provider and replaces all the parameters that are being passed to the helper functions with this object.

Test Plan

Tested through existing and modified tests.

Test Result

Passed tests on an MI200.

Submission Checklist

@therock-pr-bot

therock-pr-bot Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

Pre-commit check failed

⛔ pre-commit failed

Please run locally:

  • python -m pip install pre-commit
  • pre-commit install
  • pre-commit run --all-files --show-diff-on-failure

This repo uses .pre-commit-config.yaml.

@BalintCsala
BalintCsala force-pushed the users/BalintCsala/problem-description-hipdnn branch 2 times, most recently from 3e8d44f to 27668d1 Compare September 10, 2026 12:13
@therock-pr-bot

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@EwanC EwanC added the organization: streamhpc contributors from streamhpc label Sep 10, 2026
@brentmaas
brentmaas requested review from EwanC and a balanced review from Copilot September 10, 2026 12:34
@BalintCsala BalintCsala changed the title Implement a container like ProblemDescription to pack problem parameters feat(hipdnn): Implement a container like ProblemDescription to pack problem parameters Sep 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The refactoring preserves existing calculations and provides focused coverage for the new descriptors.

Pull request overview

Introduces ProblemDescription containers to centralize normalization geometry and batch-normalization heuristic inputs.

Changes:

  • Adds problem descriptors for Batchnorm, Layernorm, and RMSnorm.
  • Refactors plan compilation and configuration helpers to consume descriptors.
  • Updates and extends unit tests for derived geometry and heuristics.
File summaries
File Description
tests/.../RMSnorm/TestRMSnormFwdPlan.cpp Tests RMSnorm problem geometry.
tests/.../Layernorm/TestLayernormFwdPlan.cpp Tests Layernorm problem geometry.
tests/.../Batchnorm/TestBatchnormCommon.cpp Updates helper tests for the descriptor API.
plans/RMSnorm/RMSnormFwdPlan.cpp Uses the descriptor for forward geometry.
plans/RMSnorm/RMSnormCommon.hpp Defines the RMSnorm descriptor.
plans/RMSnorm/RMSnormBwdPlan.cpp Uses the descriptor for backward geometry.
plans/layernorm/LayernormUtilities.hpp Declares the Layernorm descriptor.
plans/layernorm/LayernormUtilities.cpp Computes Layernorm geometry centrally.
plans/layernorm/LayernormPlanBuilder.cpp Uses centralized workspace geometry.
plans/layernorm/LayernormFwdPlan.cpp Replaces inline forward geometry logic.
plans/layernorm/LayernormBwdPlan.cpp Replaces inline backward geometry logic.
plans/batchnorm/BatchnormFwdTrainingPlan.cpp Packages forward heuristic inputs.
plans/batchnorm/BatchnormCommon.hpp Defines the descriptor and refactors helpers.
plans/batchnorm/BatchnormBwdPlan.cpp Replaces the previous dimension container.
Review details
  • Files reviewed: 14/14 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@BalintCsala
BalintCsala force-pushed the users/BalintCsala/problem-description-hipdnn branch 2 times, most recently from a24c96e to a866dfb Compare September 14, 2026 12:14

@EwanC EwanC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far, couple of minor comments and highlighting places CI is unhappy

@BalintCsala
BalintCsala force-pushed the users/BalintCsala/problem-description-hipdnn branch 2 times, most recently from 0bc2368 to 7d8adc3 Compare September 16, 2026 09:54
@BalintCsala
BalintCsala requested a review from EwanC September 16, 2026 09:54
@BalintCsala
BalintCsala force-pushed the users/BalintCsala/problem-description-hipdnn branch from 7d8adc3 to 85bfeec Compare September 16, 2026 10:28
@BalintCsala
BalintCsala force-pushed the users/BalintCsala/problem-description-hipdnn branch from 85bfeec to 45bbb61 Compare September 17, 2026 11:58
@BalintCsala
BalintCsala force-pushed the users/BalintCsala/problem-description-hipdnn branch from 45bbb61 to 49011c7 Compare September 22, 2026 09:36
@BalintCsala
BalintCsala merged commit 7bd2b27 into ROCm:develop Sep 24, 2026
92 checks passed
@assistant-librarian

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a container like ProblemDescription to pack problem parameters

4 participants