Test-only (do not merge): build the umbrella EP with hip as its only backend - #77
Draft
zz002 wants to merge 2 commits into
Draft
Test-only (do not merge): build the umbrella EP with hip as its only backend#77zz002 wants to merge 2 commits into
zz002 wants to merge 2 commits into
Conversation
zz002
force-pushed
the
build/amdgpu-backend-subset
branch
2 times, most recently
from
August 7, 2026 07:47
e5d7474 to
d55945c
Compare
This branch validates the hip backend on machines that have no MIGraphX SDK, so force USE_MIGRAPHX off under USE_AMDGPU and compile out everything that needs the MIGraphX backend: its DLL load and unload, CreateMIGraphXBackend, mgx_options.h and the body of create_migraphx_backend. Profiles that used to fall back to MIGraphX run hip instead, which is what the device-init session OGA creates with empty provider options needs, since that one arrives as Profile::Auto. amdgpu-ep links hip-shared unconditionally for the ASIC query behind its Auto routing, so hip-shared now also builds for USE_HIP and not only for the other HIP-based backends. Co-authored-by: Cursor <cursoragent@cursor.com>
ORT creates one DataTransfer when the EP library is registered, before any session has selected a backend, and that instance is what backs OrtApi::CopyTensors outside a session. Snapshotting the backend in the constructor left it permanently inert, so those copies had no data transfer at all: OGA zeroes its KV cache that way and failed with "Could not allocate the key-value cache buffer" on every model. Resolve that one instance lazily against the currently selected backend, the way the Allocator wrapper already does, and keep the per-session snapshot for the transfers ORT creates from CreateEp. Following the selection also keeps it correct when the device-init session and the main session pick different backends. Co-authored-by: Cursor <cursoragent@cursor.com>
zz002
added a commit
to ROCm/hip-ep
that referenced
this pull request
Aug 7, 2026
…ntime-ep-amdgpu#77 The AMD GPU umbrella EP was built from a personal fork pinned at a bare commit, with the fork carrying local changes that upstream never saw. Build it from upstream onnxruntime/onnxruntime-ep-amdgpu at AMDGPU_EP_COMMIT plus the PRs in AMDGPU_EP_PR_PATCHES instead -- the same pin-plus-patches shape the ORT and OGA steps already use, so the local delta is a reviewable upstream PR and dropping it later means deleting a PR number. DirectML defaults on for Windows builds of the umbrella, so it is turned off explicitly. MIGraphX comes off through the patch, which forces it off under USE_AMDGPU: the runner has no MIGraphX SDK, and the HIP shim (hipgpu.dll, the morphizen EP renamed via cmake/deps.cmake) is the only backend this package ships. That is why the pin cannot be upstream alone yet. Upstream also links hip-shared unconditionally for the ASIC query behind Auto routing, so amdgpu-ep now needs find_package(hip) to resolve -- and it configures before the project build that used to auto-download TheRock into its own build tree. Download the SDK once in a dedicated step and hand it to both consumers (CMAKE_PREFIX_PATH for amdgpu-ep, --therock_dist for the project build) so the job does not pull two 2.2 GB copies. The URL and ROCm version are read from cmake/deps.txt, so the step cannot pin an SDK a local build would not resolve. The SDK is deliberately not cached: the extracted tree would crowd the far more expensive llvm-install/ort-install out of the repo's 10 GB cache budget. Verified locally on gfx1151: pull/77.patch applies on the pinned commit with git am and reproduces the PR head tree exactly, and the resulting tree configures and builds amdgpu-ep.dll + hip-backend.dll with the flag set this workflow now passes (USE_AMDGPU=ON, USE_DML=OFF, TheRock on CMAKE_PREFIX_PATH).
zz002
added a commit
to ROCm/hip-ep
that referenced
this pull request
Aug 11, 2026
…ntime-ep-amdgpu#77 The AMD GPU umbrella EP was built from a personal fork pinned at a bare commit, with the fork carrying local changes that upstream never saw. Build it from upstream onnxruntime/onnxruntime-ep-amdgpu at AMDGPU_EP_COMMIT plus the PRs in AMDGPU_EP_PR_PATCHES instead -- the same pin-plus-patches shape the ORT and OGA steps already use, so the local delta is a reviewable upstream PR and dropping it later means deleting a PR number. DirectML defaults on for Windows builds of the umbrella, so it is turned off explicitly. MIGraphX comes off through the patch, which forces it off under USE_AMDGPU: the runner has no MIGraphX SDK, and the HIP shim (hipgpu.dll, the morphizen EP renamed via cmake/deps.cmake) is the only backend this package ships. That is why the pin cannot be upstream alone yet. Upstream also links hip-shared unconditionally for the ASIC query behind Auto routing, so amdgpu-ep now needs find_package(hip) to resolve -- and it configures before the project build that used to auto-download TheRock into its own build tree. Download the SDK once in a dedicated step and hand it to both consumers (CMAKE_PREFIX_PATH for amdgpu-ep, --therock_dist for the project build) so the job does not pull two 2.2 GB copies. The URL and ROCm version are read from cmake/deps.txt, so the step cannot pin an SDK a local build would not resolve. The SDK is deliberately not cached: the extracted tree would crowd the far more expensive llvm-install/ort-install out of the repo's 10 GB cache budget. Verified locally on gfx1151: pull/77.patch applies on the pinned commit with git am and reproduces the PR head tree exactly, and the resulting tree configures and builds amdgpu-ep.dll + hip-backend.dll with the flag set this workflow now passes (USE_AMDGPU=ON, USE_DML=OFF, TheRock on CMAKE_PREFIX_PATH).
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.
Test-only draft, not intended to be merged: it exists so that ROCm/hip-ep CI can validate the hip flow end to end.
It builds the umbrella EP with hip as its only backend (no DirectML, no MIGraphX SDK on the runners), and keeps the registration-time data transfer usable, which OGA needs when it zeroes its KV cache outside a session.