[hipDNN] Add CustomOp descriptor lowering#5575
Open
IanWood1 wants to merge 1 commit intoROCm:developfrom
Open
Conversation
4724788 to
806344d
Compare
Adds descriptor-based lowering support for the CustomOp operation in hipDNN. This enables custom ops to be lowered through the descriptor API path (`HIPDNN_USE_DESCRIPTOR_API=1`), creating backend operation descriptors that serialize to FlatBuffer graphs. This is required ahead of ROCm#4782 (Remove FlatBuffers from frontend public API), which will make descriptor-based lowering the only path. Without this, CustomOp (added in ROCm#5341) would break once the direct FlatBuffer serialization path is removed. Added descriptor-based lowering for the CustomOp operation: - Backend descriptor (`CustomOpOperationDescriptor`) with setAttribute/getAttribute/finalize/buildNode supporting variable-length input/output tensor arrays, a plugin identifier string (custom_op_id), an opaque byte payload, and compute data type - Frontend packer (`CustomOpPacker.hpp`) bridging frontend `CustomOpAttributes` to backend descriptors - `create_operation()` override in `CustomOpNode.hpp` - 5 new backend attribute enums (3000-3004) with `_EXT` suffix - New backend descriptor type `HIPDNN_BACKEND_OPERATION_CUSTOM_OP_DESCRIPTOR_EXT = 28` - New shared helpers `setByteArray`/`getByteArray` in DescriptorAttributeUtils for opaque byte payloads - Shared test constants in `CustomOpConstants.hpp` - Comprehensive tests: backend unit tests, graph round-trip tests, frontend integration tests - `CustomOpOperationDescriptor.hpp/.cpp` — Backend descriptor with setAttribute/getAttribute/finalize/buildNode - `CustomOpPacker.hpp` — Frontend packer bridging frontend attributes to backend descriptors - `CustomOpConstants.hpp` — Shared test constants in test_sdk - Unit tests, graph tests, integration tests for full round-trip verification - Backend enums (descriptor type, attribute names — all with `_EXT` suffix) - Descriptor factory, string utils - DescriptorAttributeUtils (new setByteArray/getByteArray helpers) - Frontend CustomOpNode (create_operation override) - CMakeLists.txt (backend src, backend tests, frontend tests) - [x] Backend unit tests (descriptor lifecycle, finalize validation, attribute set/get error paths, buildNode with multiple compute types) - [x] Backend graph tests (serialization round-trip) - [x] Frontend integration tests (full pipeline: frontend graph → descriptor lowering → serialize → deserialize → verify, including auto-assigned UID preservation)
Codecov Report❌ Patch coverage is ❌ Your project status has failed because the head coverage (77.21%) 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 #5575 +/- ##
===========================================
+ Coverage 67.29% 67.32% +0.03%
===========================================
Files 1847 1850 +3
Lines 284305 284563 +258
Branches 39882 39924 +42
===========================================
+ Hits 191308 191577 +269
+ Misses 76523 76496 -27
- Partials 16474 16490 +16
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Adds descriptor-based lowering support for the CustomOp operation in hipDNN. This enables custom ops to be lowered through the descriptor API path (
HIPDNN_USE_DESCRIPTOR_API=1), creating backend operation descriptors that serialize to FlatBuffer graphs.Technical Details
Added descriptor-based lowering for the CustomOp operation:
CustomOpOperationDescriptor) with setAttribute/getAttribute/finalize/buildNode supporting variable-length input/output tensor arrays, a plugin identifier string (custom_op_id), an opaque byte payload, and compute data typeCustomOpPacker.hpp) bridging frontendCustomOpAttributesto backend descriptorscreate_operation()override inCustomOpNode.hpp_EXTsuffixHIPDNN_BACKEND_OPERATION_CUSTOM_OP_DESCRIPTOR_EXTsetByteArray/getByteArrayin DescriptorAttributeUtils for opaque byte payloadsCustomOpConstants.hppFiles Added
CustomOpOperationDescriptor.hpp/.cpp— Backend descriptor with setAttribute/getAttribute/finalize/buildNodeCustomOpPacker.hpp— Frontend packer bridging frontend attributes to backend descriptorsCustomOpConstants.hpp— Shared test constants in test_sdkFiles Modified
_EXTsuffix)Test Plan