feat: AMD GPU umbrella execution provider integration - #2376
Draft
Wang, Zhenze (zz002) wants to merge 2 commits into
Draft
feat: AMD GPU umbrella execution provider integration#2376Wang, Zhenze (zz002) wants to merge 2 commits into
Wang, Zhenze (zz002) wants to merge 2 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Adds an AMDGPU device interface that registers the AMD GPU umbrella execution provider library (amdgpu-ep) on the OrtEnv and selects it through the plugin EP (V2) API. The interface resolves the EP library from AMDGPU_EP_PATH, then next to onnxruntime-genai.dll, onnxruntime.dll and the executable, before falling back to the working directory. Provider options are passed both as plugin EP options and mirrored to "ep.amdgpu.*" session config entries, which is how the umbrella EP selects its backend; ShapeInitSessionProviderOptions forwards them to the device-init session as well so the allocator can be created. The allocator memory info is built with CreateMemoryInfo_V2 using the AMD vendor id and GPU device type the EP factory registers with. Co-authored-by: Cursor <cursoragent@cursor.com>
The umbrella EP allocator is host- and device-accessible on the AMD APU iGPU, so model inputs can stay in device memory and the KV cache stays valid across AppendTokens calls. Co-authored-by: Cursor <cursoragent@cursor.com>
8 tasks
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.
Summary
Integrates the AMD GPU umbrella execution provider (
amdgpu-ep, a plugin EP shipped by the ROCm hip-ep project) into GenAI on top ofrel-0.15.1, addingDeviceType::AMDGPUand a device interface that registers and selects the EP through the plugin EP (V2) API.What
src/amdgpu/holds the new device interface. It resolves the EP library fromAMDGPU_EP_PATH, then next toonnxruntime-genai.dll,onnxruntime.dlland the executable, before falling back to the working directory, and registers it on the interface'sOrtEnv(tolerating an already-registered library from an earlier init cycle).SetupProviderpicks the EP devices reported as GPUs and appends the EP with the model's provider options; the same options are mirrored toep.amdgpu.*session config entries, which is how the umbrella EP selects its backend.ShapeInitSessionProviderOptionsforwards those options to the device-init session so the allocator can be created there, andGetMemoryInfo()builds the memory info withCreateMemoryInfo_V2using the AMD vendor id and GPU device type the EP factory registers with.The umbrella EP's allocator is host- and device-accessible on the AMD APU iGPU, so model inputs stay in device memory and the device is on the continuous-decoding list.
Status
This is a draft opened as a patch source for AMD's downstream CI, which currently builds GenAI from
rel-0.15.1plus this branch. It overlaps in intent with #2165 (AMD GPU EP support); once that lands and covers the umbrella EP's provider-option plumbing, this PR will be closed and the downstream CI switched over. It supersedes #2194, which targeted v0.14.0.Test plan
--no_telemetry, Ninja, Release)model_benchmarkon Llama-3.1-8B (AWQ int4) with"AMDGPU": {"profile": "hip"}andsession.disable_cpu_ep_fallback=1: matches the v0.14.0 + Add AMDGPU execution provider support #2194 baseline on time-to-first-token and token generation throughput