Skip to content

[hipDNN] [ALMIOPEN-2037] [ALMIOPEN-2038] cuDNN shim: enum/error and Tensor_attributes aliasing#8744

Open
mousdahl-amd wants to merge 2 commits into
developfrom
users/mousdahl-amd/cudnn-aliasing
Open

[hipDNN] [ALMIOPEN-2037] [ALMIOPEN-2038] cuDNN shim: enum/error and Tensor_attributes aliasing#8744
mousdahl-amd wants to merge 2 commits into
developfrom
users/mousdahl-amd/cudnn-aliasing

Conversation

@mousdahl-amd

@mousdahl-amd mousdahl-amd commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the next layer of the cuDNN-compatibility shim for hipDNN (per the cuDNN-shim RFC, RFC 0012): the FE-namespace enum/error aliasing surface and the graph::Tensor_attributes type. Hipified cuDNN-frontend v9 graph code can declare enums, return error/error_t values, use the error/log macros, and construct/configure tensors against the shim with no numeric casts between the cuDNN and hipDNN enum families — the shim using-aliases the hipDNN types 1:1 rather than wrapping them.

Risk Assessment

Low risk. Header-only using-aliasing plus host-only unit tests, all behind the opt-in HIPDNN_ENABLE_CUDNN_COMPATIBILITY flag. No kernel, dispatch, default-behavior, or public-shipping-API change; the aliased types are the same hipDNN types, so there is no ABI or compatibility surface beyond the new shim headers. Covered by passing unit tests.

ASIC Coverage

ASIC-independent. The change is compile-time type aliasing and host-only tests with no kernel selection, support surface, or dispatch behavior impact, so standard PR CI is sufficient; no specific-ASIC run or multi-arch sweep is required.

Testing Summary

  • cuDNN-shim frontend unit tests (gated by HIPDNN_ENABLE_CUDNN_COMPATIBILITY): enum/error aliasing, error macros, status round-trip, handle entry points, the v9-only translation-unit compile gate, and Tensor_attributes construction/setters/UID/copy-identity.
  • static_asserts in the tests pin that each shim alias is the exact same type as its hipDNN counterpart (alias, not parallel re-declaration).

Testing Checklist

  • cuDNN shim frontend unit tests - built hipdnn_frontend_tests with -DHIPDNN_ENABLE_CUDNN_COMPATIBILITY=ON, ran --gtest_filter=TestCudnnShim* (23/23) - Status: Passed
  • PR CI - GitHub PR checks - Status: Pending

Technical Changes

  • Adds cudnn_frontend/graph_properties.h, aliasing hipdnn_frontend::graph::TensorAttributes (and its Tensor_attributes typedef) into the shim graph namespace; no shim-side UID allocator or identity map — UID handling stays native to hipDNN.
  • Adds cudnn_frontend_utils.h (FE-namespace enum aliases: DataType_t, PointwiseMode_t, ConvolutionMode_t, etc.) and cudnn_frontend/graph_helpers.h (aliased error_t/error_object/error_code_t and re-exported CHECK_CUDNN_FRONTEND_ERROR / RETURN_CUDNN_FRONTEND_ERROR_IF / CUDNN_FE_LOG* macros).
  • Wires both new headers into the umbrella cudnn_frontend.h and extends the stub cudnn.h C-API types as needed.
  • Adds gated tests TestCudnnShimError.cpp, TestCudnnShimTensor.cpp, and the TestCudnnShimV9Tu.cpp v9-only compile gate; registers them in the frontend tests CMakeLists.
  • Tensor_attributes aliases the setters hipDNN publishes 1:1 (set_dim/set_stride/set_data_type/set_uid/set_is_virtual/set_output/set_name); set_is_pass_by_value (modeled by hipDNN's typed set_value) and set_ragged_offset (no ragged-tensor support yet) are intentionally deferred until their consuming nodes land.
  • Adjusted a number of comments to be less verbose.

@mousdahl-amd mousdahl-amd changed the title [hipDNN] ALMIOPEN-2037 ALMIOPEN-2038 cuDNN shim: enum/error and Tensor_attributes aliasing [hipDNN] [ALMIOPEN-2037] [ALMIOPEN-2038] cuDNN shim: enum/error and Tensor_attributes aliasing Jun 23, 2026
@codecov-commenter

codecov-commenter commented Jun 23, 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 (77.89%) 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    #8744   +/-   ##
========================================
  Coverage    71.43%   71.44%           
========================================
  Files         2612     2612           
  Lines       407002   407033   +31     
  Branches     60775    60775           
========================================
+ Hits        290732   290774   +42     
+ Misses       94964    94959    -5     
+ Partials     21306    21300    -6     
Flag Coverage Δ *Carryforward flag
TensileLite 76.81% <ø> (ø) Carriedforward from e0b0a89
hipBLAS 90.81% <ø> (ø) Carriedforward from e0b0a89
hipBLASLt 41.36% <ø> (ø) Carriedforward from e0b0a89
hipCUB 82.68% <ø> (ø) Carriedforward from e0b0a89
hipDNN 86.75% <ø> (+0.03%) ⬆️
hipFFT 50.79% <ø> (ø) Carriedforward from e0b0a89
hipRAND 76.12% <ø> (ø) Carriedforward from e0b0a89
hipSOLVER 69.18% <ø> (ø) Carriedforward from e0b0a89
hipSPARSE 86.55% <ø> (ø) Carriedforward from e0b0a89
rocBLAS 48.08% <ø> (ø) Carriedforward from e0b0a89
rocFFT 47.22% <ø> (ø) Carriedforward from e0b0a89
rocRAND 57.07% <ø> (ø) Carriedforward from e0b0a89
rocSOLVER 77.89% <ø> (ø) Carriedforward from e0b0a89
rocSPARSE 72.37% <ø> (ø) Carriedforward from e0b0a89
rocThrust 91.34% <ø> (ø) Carriedforward from e0b0a89

*This pull request uses carry forward flags. Click here to find out more.
see 9 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.

@mousdahl-amd mousdahl-amd marked this pull request as ready for review June 24, 2026 18:51
@mousdahl-amd mousdahl-amd requested a review from a team as a code owner June 24, 2026 18:51
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.

2 participants