feat(hiptensor): Build lib with a stub implementation when GPU_TARGETS is empty#8874
feat(hiptensor): Build lib with a stub implementation when GPU_TARGETS is empty#8874evedovelli wants to merge 6 commits into
Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
7176411 to
5a139ea
Compare
TorreZuk
left a comment
There was a problem hiding this comment.
The stub pattern seems fine but does add maintenance for for matching up change in API.
Not clear if some macro stubs could also be used in the original API to comment out the code blocks and just return not_supported but that one might think is quirky as well.
Thank you for the review @TorreZuk. I'll dig and see if I could put something like this in place. For now there is an extra maintenance in the cpp stubs, but I did put in place a compile time verification that will trigger a failure if the stub implementation isn't aligned with the API. |
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (76.92%) 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 #8874 +/- ##
===========================================
+ Coverage 65.13% 65.17% +0.05%
===========================================
Files 2628 2628
Lines 413118 413284 +166
Branches 61884 61891 +7
===========================================
+ Hits 269044 269348 +304
+ Misses 123563 123391 -172
- Partials 20511 20545 +34
*This pull request uses carry forward flags. Click here to find out more. 🚀 New features to boost your workflow:
|
Motivation
hipTensor depends on Composable Kernel, which only supports a subset of gfx targets. On architectures where the effective GPU_TARGETS resolves to empty (e.g. a single-arch build for an unsupported gfx), the device library and its CK
dependency cannot be built, which previously broke configuration and left downstream consumers with no hiptensor package at all.
This PR makes hipTensor degrade gracefully in that case by building a host-only stub library
Technical Details
downstream find_package(hiptensor) and linking keep working, and callers get a well-defined runtime error instead of an unresolved symbol.
unresolved symbol. This runs for any GPU_TARGETS (device or stub), so the stub can never drift out of sync with the public API.
Test Plan and Results
Submission Checklist
ISSUE ID : ROCm/TheRock#6268