enable gfx1250 generic target in CLR/ROCr - #9741
Conversation
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
0e477a5 to
a54e4b4
Compare
There was a problem hiding this comment.
Pull request overview
This PR enables end-to-end support for the gfx12-5-generic code object target on gfx1250 across ROCr (loader/ISA registry), CLR (ISA recognition and fatbin bundle selection), and hip-tests (generic-target detection and compiler test coverage).
Changes:
- ROCr: add ELF mach/ISA decoding and register
gfx12-5-genericas a supported generic ISA; mapgfx1250→gfx12-5-generic. - CLR: recognize
gfx12-5-genericin the supported ISA list and mapgfx1250→gfx12-5-genericduring fatbin target selection. - hip-tests: build compiler tests for
gfx12-5-generic, mapgfx1250→gfx12-5-generic, and re-enable generic-target-only tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| projects/rocr-runtime/runtime/hsa-runtime/libamdhsacode/amd_hsa_code.cpp | Adds mach-to-ISA-name resolution for gfx12-5-generic code objects. |
| projects/rocr-runtime/runtime/hsa-runtime/inc/amd_hsa_elf.h | Introduces an ELF e_flags mach constant for gfx12-5-generic. |
| projects/rocr-runtime/runtime/hsa-runtime/core/runtime/isa.cpp | Registers gfx12-5-generic and maps gfx1250 generic compatibility accordingly. |
| projects/clr/rocclr/device/device.cpp | Adds gfx12-5-generic to CLR’s supported ISA table so ISA lookup can succeed. |
| projects/clr/hipamd/src/hip_fatbin.cpp | Maps gfx1250 targets to the gfx12-5-generic bundle during fatbin selection. |
| projects/hip-tests/catch/unit/compiler/CMakeLists.txt | Builds compiler unit tests with --offload-arch=gfx12-5-generic. |
| projects/hip-tests/catch/hipTestMain/hip_test_features.cc | Enables generic-target support checks on gfx1250 by mapping to gfx12-5-generic. |
| projects/hip-tests/catch/config/configs/unit/compiler.yaml | Re-enables previously-disabled generic-target-only compiler tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
655d034 to
325059e
Compare
Rename RESERVED_0X49 to GFX1250 at 0x049 (its correct sorted position) and remove the out-of-order duplicate GFX1250 = 0x049 that sat after GFX950. No functional change (gfx1250 stays 0x049); removes the reserved alias / duplicate flagged in review. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
325059e to
294c960
Compare
Motivation
The compiler side already supports it — LLVM has had the target since llvm/llvm-project#183381, and device-libs/comgr carry it on amd-staging — but the ROCm runtime and hip-tests in rocm-systems do not. As a result, a
gfx12-5-genericcode object cannot load on gfx1250: ROCr's loader can't determine its ISA, and CLR/hip-tests don't recognize the target.This PR adds the missing runtime support (CLR + ROCr) and wires up the generic-target compiler tests for gfx1250.
Technical Details
ROCr (hsa-runtime)
EF_AMDGPU_MACH_AMDGCN_GFX12_5_GENERIC(0x5b) toinc/amd_hsa_elf.h.GetMachInfocase inlibamdhsacode/amd_hsa_code.cppsoAmdHsaCode::GetIsa()can resolve the code object's ISA name (this was the first hard failure:HSA_STATUS_ERROR_INVALID_CODE_OBJECT).gfx12-5-genericinIsaRegistry::GetSupportedGenericVersions()and set gfx1250's generic togfx12-5-genericin the ISA registry (core/runtime/isa.cpp), so the loader's generic-vs-agent compatibility check accepts it.CLR (rocclr / hipamd)
gfx12-5-generictoIsa::supportedIsas()(rocclr/device/device.cpp) sofindIsa()recognizes the ISA.gfx1250 -> gfx12-5-genericin the fatbinTargetGenericMap(hipamd/src/hip_fatbin.cpp) so bundle selection picks the generic code object.hip-tests
gfx1250 -> gfx12-5-genericingetGenericTarget()(hipTestMain/hip_test_features.cc) soisGenericTargetSupported()returns true on gfx1250.--offload-arch=gfx12-5-generic(unit/compiler/CMakeLists.txt).Unit_test_generic_target_only_in_{compressed,regular}_fatbin(drop the staleRock_Linux_Failures_on_gfx94Xdisable inconfig/configs/unit/compiler.yaml).Out of scope (upstream / llvm-project): comgr (
comgr-isa-metadata.def) and device-libs (oclc/CMakeLists.txt) also needgfx12-5-generic; those already carry it on amd-staging (device-libs via #3070). For this PR to work end-to-end, the build's toolchain must include those.Issue Tracking
JIRA ID : AIRUNTIME-2596
Test Plan
gfx12-5-genericload path end-to-end (ISA-name resolution → fatbin bundle selection → ROCr code-object load → kernel execution) with a--offload-arch=gfx12-5-genericcompressed and regular fatbin.Unit_test_generic_target_{in,only_in}_{compressed,regular}_fatbin._only_tests, verified the generic-only child executables load theirgfx*-genericcode objects and produce correct results on real gfx942 (MI300X) hardware, confirming the priorRock_Linux_Failures_on_gfx94Xdisable no longer reproduces.Test Result
gfx12-5-genericcompressed/regular fatbins load and execute correctly with the runtime changes._only_tests pass on gfx942.Submission Checklist