build: make DirectML/MIGraphX optional for local hipep testing [do not merge] - #2
Open
zz002 wants to merge 5 commits into
Open
build: make DirectML/MIGraphX optional for local hipep testing [do not merge]#2zz002 wants to merge 5 commits into
zz002 wants to merge 5 commits into
Conversation
zz002
force-pushed
the
feat/rocm-llm-backend
branch
2 times, most recently
from
June 17, 2026 01:39
ff40ecc to
01e7cb3
Compare
zz002
force-pushed
the
build/decouple-dml-migraphx
branch
from
June 17, 2026 01:44
1bd9c00 to
961411a
Compare
zz002
force-pushed
the
feat/rocm-llm-backend
branch
3 times, most recently
from
June 17, 2026 02:25
2f32dad to
e78f4b1
Compare
zz002
force-pushed
the
build/decouple-dml-migraphx
branch
from
June 17, 2026 02:32
961411a to
25d588d
Compare
zz002
force-pushed
the
build/decouple-dml-migraphx
branch
2 times, most recently
from
June 17, 2026 10:21
55d9c6d to
19dc45a
Compare
zz002
force-pushed
the
build/decouple-dml-migraphx
branch
from
June 24, 2026 10:55
19dc45a to
91c4fad
Compare
zz002
force-pushed
the
feat/rocm-llm-backend
branch
from
June 24, 2026 10:55
4e9aa28 to
71c00fb
Compare
zz002
force-pushed
the
build/decouple-dml-migraphx
branch
from
June 24, 2026 10:59
91c4fad to
daa120c
Compare
zz002
force-pushed
the
build/decouple-dml-migraphx
branch
2 times, most recently
from
July 15, 2026 06:37
af39f35 to
b9460ee
Compare
…ntime#44) * amdgpu EP: load hip backend only when present; rename profile llm->hipep Two related fixes in the amdgpu (umbrella) EP hip-backend handling: 1. The hip (morphizen) backend is optional (built only with USE_HIP; a standard USE_AMDGPU build does not produce hip-backend.dll), but ProviderFactory loaded it unconditionally, so CreateEpFactories threw and the whole umbrella EP failed to register (EP_FAIL) even for directml/migraphx. Load it only when hip-backend.dll is present next to the module; a present-but-broken library still errors. Null-guard CreateHipBackend so selecting the hip profile without the backend fails cleanly. 2. Select the hip backend via profile=hipep (Profile::HipEp) instead of profile=llm, for consistency with the other backends selected by backend name (migraphx, directml). The numeric alias 5 is retained. * amdgpu EP: rename profile hipep -> hip Address review: drop "Ep" from the profile name so the backend is not exposed as an execution provider. Profile::HipEp -> Profile::Hip, string "hipep" -> "hip" (numeric alias 5 retained). --------- Co-authored-by: tperry-amd <thomas.perry@amd.com>
…ime#45) ComputeOutputIndex parsed the integer after the #output_ prefix assuming a plain digit, but MIGraphX names outputs #output_0 for index<10 and #output_:00056 (a colon then a zero-padded number) for index>=10 (see AMDMIGraphX param_utils.cpp param_name()). For the padded form the parse failed, the output parameter was never bound, and MIGraphX threw Parameter not found during hipGraph capture -- which happens on any model with >=10 outputs (all real LLM decode graphs: 1 logits + N KV cache). Skip a leading colon so both forms parse. Co-authored-by: tperry-amd <thomas.perry@amd.com>
Co-authored-by: tperry-amd <thomas.perry@amd.com>
…ree (onnxruntime#46) ProviderFactory::CreateAllocator cached a single Allocator and returned it for both the default and host-accessible memory infos, so its Info() reported only the default device. ORT registers one shared allocator per memory info and unregisters them by that device, so the host-accessible one was never matched; it lingered until ~Environment, after the factory had been freed, and its deleter then called ReleaseAllocator on the freed factory (use-after-free at teardown). Return one Allocator per device memory type, each constructed with its own memory_info so Info() reports the correct device and both can be unregistered before the factory is destroyed. Both wrappers still delegate to the currently-selected backend, so backend virtualization / dynamic switching is unchanged. Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Aditya Lohia <adityaslohia29@gmail.com>
zz002
force-pushed
the
build/decouple-dml-migraphx
branch
from
July 16, 2026 03:42
b9460ee to
a1318ed
Compare
…aphX SDK [do not merge] NOT FOR MERGE - local build/test scaffolding, stacked on the hipep backend PR. USE_AMDGPU normally force-enables USE_DML and USE_MIGRAPHX, migraphx-ep runs find_package(migraphx REQUIRED), and ProviderFactory unconditionally loads the DirectML and MIGraphX backend DLLs - so the umbrella can't build/run on a machine without a MIGraphX SDK. Make DML/MIGraphX opt-in so the hipep (profile=llm) path can be reproduced and tested locally: - USE_AMDGPU forces USE_DML / USE_MIGRAPHX OFF. - amdgpu-ep guards the migraphx-ep / directml-ep include directories behind USE_MIGRAPHX / USE_DML and passes USE_DML / USE_MIGRAPHX compile defs. - gpu_factory.cc / gpu_ep.cc guard the DirectML and MIGraphX backend loads and profile branches behind #ifdef USE_DML / USE_MIGRAPHX (the hipep backend stays unconditional). Local repro: build with --use_amdgpu, place hipep-backend.dll next to amdgpu-ep, then run a model with provider option profile=llm. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Stacked on #1. Makes DirectML/MIGraphX optional so the hipep backend can be built and run on a machine without a MIGraphX SDK. Kept as a separate, non-merging PR purely for local reproduction/testing of the
profile=llmpath. (Review the actual feature in #1.)Why
amdgpu-ephard-requires both DirectML and MIGraphX:USE_AMDGPUforce-enablesUSE_DML/USE_MIGRAPHX,migraphx-eprunsfind_package(migraphx REQUIRED), andProviderFactoryunconditionallyLoadDynamicLibrarys both backend DLLs. So on a box without a MIGraphX SDK the umbrella neither configures, builds, nor loads.What
USE_AMDGPUforcesUSE_DML/USE_MIGRAPHXOFF.amdgpu-epguards themigraphx-ep/directml-epinclude directories behindUSE_MIGRAPHX/USE_DMLand passesUSE_DML/USE_MIGRAPHXcompile definitions.gpu_factory.cc/gpu_ep.ccguard the DirectML and MIGraphX backend loads and profile branches behind#ifdef USE_DML/USE_MIGRAPHX. The hipep backend stays unconditional.Local repro
DirectML and MIGraphX are off; hipep is built in. Place
hipep-backend.dll(the hipdnn-ep / MorphiZen plugin EP DLL) next toamdgpu-ep, then run a model with provider optionprofile=llm. Used together with the hipdnn-ep factory fix ROCm/MorphiZen#234 this executes on gfx1151 via hipBLASLt.