Skip to content

[hipDNN] Add per-operation tensor dimension ordering documentation - #4991

Merged
BrianHarrisonAMD merged 2 commits into
developfrom
users/bharriso/hipdnn-per-op-dim-docs
Mar 3, 2026
Merged

BrianHarrisonAMD merged 2 commits into
developfrom
users/bharriso/hipdnn-per-op-dim-docs

Conversation

@BrianHarrisonAMD

Copy link
Copy Markdown
Contributor

Motivation

Document the expected tensor dimension ordering for each operation type rather than a blanket "always NCHW" convention. Each operation family has its own dimension semantics:

  • Convolution: (N, C, H, W) / (K, C/groups, R, S)
  • BatchNorm: (N, C, H, W) with per-channel params (1, C, 1, 1)
  • LayerNorm: (N, ...) with feature-matching scale/bias
  • Matmul: (...batch, M, K) @ (...batch, K, N)
  • Pointwise: dimension-agnostic with NumPy broadcasting

Adds Tensor Shapes sections to operation attribute Doxygen docs and a comprehensive per-operation reference in the Porting Guide.

Technical Details

Docs only

@BrianHarrisonAMD BrianHarrisonAMD self-assigned this Feb 28, 2026
@BrianHarrisonAMD
BrianHarrisonAMD requested a review from a team as a code owner February 28, 2026 00:36
@BrianHarrisonAMD BrianHarrisonAMD added the skip-therockci If added, it will skip all builds and tests for TheRock CI label Feb 28, 2026
@BrianHarrisonAMD BrianHarrisonAMD changed the title [HIPDNN] Add per-operation tensor dimension ordering documentation [hipDNN] Add per-operation tensor dimension ordering documentation Feb 28, 2026
Document the expected tensor dimension ordering for each operation type
rather than a blanket "always NCHW" convention. Each operation family has
its own dimension semantics:

- Convolution: (N, C, H, W) / (K, C/groups, R, S)
- BatchNorm: (N, C, H, W) with per-channel params (1, C, 1, 1)
- LayerNorm: (N, ...) with feature-matching scale/bias
- Matmul: (...batch, M, K) @ (...batch, K, N)
- Pointwise: dimension-agnostic with NumPy broadcasting

Adds Tensor Shapes sections to operation attribute Doxygen docs and
a comprehensive per-operation reference in the Porting Guide.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@BrianHarrisonAMD
BrianHarrisonAMD force-pushed the users/bharriso/hipdnn-per-op-dim-docs branch from 73648fe to 880c2d6 Compare February 28, 2026 00:41
Comment thread projects/hipdnn/docs/PortingGuide.md Resolved
Comment thread projects/hipdnn/docs/PortingGuide.md Resolved

@SamuelReeder SamuelReeder 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.

Much needed!

@CMiservaAMD CMiservaAMD 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.

A handful of suggestions. No issues with the content itself though, LGTM.

Comment thread projects/hipdnn/docs/PortingGuide.md Resolved
@codecov-commenter

codecov-commenter commented Feb 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

❌ Your project status has failed because the head coverage (76.83%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4991      +/-   ##
===========================================
+ Coverage    66.12%   66.26%   +0.14%     
===========================================
  Files         1734     1741       +7     
  Lines       269102   270730    +1628     
  Branches     37402    37606     +204     
===========================================
+ Hits        177934   179383    +1449     
- Misses       75535    75645     +110     
- Partials     15633    15702      +69     
Flag Coverage Δ *Carryforward flag
hipBLAS 90.67% <ø> (ø) Carriedforward from 880c2d6
hipBLASLt 43.55% <ø> (ø) Carriedforward from 880c2d6
hipCUB 82.38% <ø> (ø) Carriedforward from 880c2d6
hipDNN 82.28% <ø> (+0.53%) ⬆️
hipFFT 55.93% <ø> (ø) Carriedforward from 880c2d6
hipRAND 76.12% <ø> (ø) Carriedforward from 880c2d6
hipSOLVER 68.81% <ø> (ø) Carriedforward from 880c2d6
hipSPARSE 84.70% <ø> (ø) Carriedforward from 880c2d6
rocBLAS 47.97% <ø> (ø) Carriedforward from 880c2d6
rocFFT 52.93% <ø> (ø) Carriedforward from 880c2d6
rocRAND 57.06% <ø> (ø) Carriedforward from 880c2d6
rocSOLVER 76.83% <ø> (ø) Carriedforward from 880c2d6
rocSPARSE 71.53% <ø> (ø) Carriedforward from 880c2d6

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...clude/hipdnn_data_sdk/utilities/ShapeUtilities.hpp 85.60% <ø> (ø)
...a_sdk/include/hipdnn_data_sdk/utilities/Tensor.hpp 91.46% <ø> (ø)
...hipdnn_frontend/attributes/BatchnormAttributes.hpp 85.92% <ø> (ø)
...frontend/attributes/ConvolutionFpropAttributes.hpp 96.77% <ø> (ø)
...hipdnn_frontend/attributes/LayernormAttributes.hpp 94.23% <ø> (ø)
...de/hipdnn_frontend/attributes/MatmulAttributes.hpp 100.00% <ø> (ø)
...hipdnn_frontend/attributes/PointwiseAttributes.hpp 84.52% <ø> (ø)
...de/hipdnn_frontend/attributes/TensorAttributes.hpp 89.04% <ø> (ø)
.../include/hipdnn_frontend/node/detail/Utilities.hpp 98.17% <ø> (ø)

... and 21 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Apply doc/comment wording improvements from CMiservaAMD and SamuelReeder:
- Add stride order values and per-dim stride labels to TensorLayout examples
- Expand PortingGuide stride order explanation with NCHW/NDHWC examples
- Replace graph.tensor() with direct TensorAttributes construction in examples
- Generalize LayerNorm scale/bias shape description for n-dimensional inputs
- Clarify "dimension order in the tensor shape vector" wording in TensorAttributes
- Add NHWC example alongside existing NCHW example in TensorAttributes
- Minor "4D tensors / 5D tensors" wording fix in ShapeUtilities

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@BrianHarrisonAMD
BrianHarrisonAMD enabled auto-merge (squash) March 3, 2026 02:43
@BrianHarrisonAMD
BrianHarrisonAMD merged commit 53546f2 into develop Mar 3, 2026
9 checks passed
@BrianHarrisonAMD
BrianHarrisonAMD deleted the users/bharriso/hipdnn-per-op-dim-docs branch March 3, 2026 15:07
jovanau pushed a commit to jovanau/rocm-libraries that referenced this pull request Mar 19, 2026
…OCm#4991)

## Motivation

Document the expected tensor dimension ordering for each operation type
rather than a blanket "always NCHW" convention. Each operation family
has its own dimension semantics:

- Convolution: (N, C, H, W) / (K, C/groups, R, S)
- BatchNorm: (N, C, H, W) with per-channel params (1, C, 1, 1)
- LayerNorm: (N, ...) with feature-matching scale/bias
- Matmul: (...batch, M, K) @ (...batch, K, N)
- Pointwise: dimension-agnostic with NumPy broadcasting

Adds Tensor Shapes sections to operation attribute Doxygen docs and a
comprehensive per-operation reference in the Porting Guide.

## Technical Details

Docs only

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
archana-ramalingam added a commit that referenced this pull request May 14, 2026
Temporary: update TheRock ref to refs/pull/4991/head to test
tensilelite artifact install end-to-end. Revert to pinned hash
before merging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation organization: ROCm project: hipdnn skip-therockci If added, it will skip all builds and tests for TheRock CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants