Skip to content

Commit 14ca6df

Browse files
[MIGraphX EP] Fix CreateExecutionProviderFactory with correct struct and change vendor_id (microsoft#25625)
This fixes the CreateIExecutionProvider for MIGraphX EP when calling CreateExecutionProviderFactory, using OrtMIGraphXProviderOptions instead of ProviderOptions. Also changes the vendor_id so that OrderDevices in provider_policy_context.cc will default dml ep when ep_policy is set to GPU. Will update pending more changes to MIGraphX EP. Co-authored-by: ozhang <ozhang@amd.com>
1 parent 9ecd9f3 commit 14ca6df

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

onnxruntime/core/providers/migraphx/migraphx_provider_factory.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ struct MIGraphX_Provider : Provider {
155155
const ConfigOptions* config_options = &session_options.GetConfigOptions();
156156

157157
std::array<const void*, 2> configs_array = {&provider_options, config_options};
158-
auto ep_factory = CreateExecutionProviderFactory(&provider_options);
158+
OrtMIGraphXProviderOptions migraphx_options;
159+
UpdateProviderOptions(&migraphx_options, provider_options);
160+
161+
auto ep_factory = CreateExecutionProviderFactory(&migraphx_options);
159162
ep = ep_factory->CreateProvider(session_options, logger);
160163

161164
return Status::OK();
@@ -309,7 +312,8 @@ struct MigraphXEpFactory : OrtEpFactory {
309312
const std::string vendor{"AMD"};
310313
const std::string version{"1.0.0"}; // MigraphX EP version
311314

312-
const uint32_t vendor_id{0x1002};
315+
// Not using AMD vendor id 0x1002 so that OrderDevices in provider_policy_context.cc will default dml ep
316+
const uint32_t vendor_id{0x9999};
313317
const OrtHardwareDeviceType ort_hw_device_type; // Supported OrtHardwareDevice
314318
};
315319

0 commit comments

Comments
 (0)