build: make DirectML/MIGraphX optional for local hipep testing [do not merge]#2
Open
zz002 wants to merge 2 commits into
Open
build: make DirectML/MIGraphX optional for local hipep testing [do not merge]#2zz002 wants to merge 2 commits into
zz002 wants to merge 2 commits into
Conversation
ff40ecc to
01e7cb3
Compare
1bd9c00 to
961411a
Compare
2f32dad to
e78f4b1
Compare
961411a to
25d588d
Compare
25d588d to
55d9c6d
Compare
CreateEpFactories can be invoked more than once (e.g. a real session plus the device-init session in OGA). The previous single-handle logic reloaded the DLL on each call (leaking the earlier handle) and unloaded it on the first ReleaseEpFactory while later factories were still live. Load on the first factory and unload only after the last is released; roll back the refcount if the load fails so a retry re-attempts it. Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
55d9c6d to
19dc45a
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.