diff --git a/onnxruntime/core/platform/posix/env.cc b/onnxruntime/core/platform/posix/env.cc index a5aa5773a3..14217a126d 100644 --- a/onnxruntime/core/platform/posix/env.cc +++ b/onnxruntime/core/platform/posix/env.cc @@ -248,11 +248,13 @@ class PosixThread : public EnvThread { << ", mask: " << *p->affinity; } else { auto [err_no, err_msg] = GetSystemError(ret); +#if !defined(USE_MIGRAPHX) LOGS_DEFAULT(ERROR) << "pthread_setaffinity_np failed for thread: " << syscall(SYS_gettid) << ", index: " << p->index << ", mask: " << *p->affinity << ", error code: " << err_no << " error msg: " << err_msg << ". Specify the number of threads explicitly so the affinity is not set."; +#endif } } #endif diff --git a/onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc b/onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc index ba98a79a72..7cf8e4759f 100644 --- a/onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc +++ b/onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc @@ -451,15 +451,6 @@ static bool IsUnsupportedOpMode(const onnxruntime::GraphViewer& graph_viewer, co } } - const auto& args = node->InputDefs(); - if (args.size() > 1) { - std::vector indices(args.size() - 1); - std::iota(indices.begin(), indices.end(), 1); - if (canEvalNodeArgument(graph_viewer, node, indices, input_nodes)) { - return false; - } - return true; - } } else if (optype == "ReduceSum") { const auto& args = node->InputDefs(); if (args.size() == 2) { @@ -952,8 +943,15 @@ bool get_input_output_names(const GraphViewer& graph, if (sptr == nullptr) return true; - auto dim_size = sptr->dim_size(); - return (dim_size == 0); + if (sptr->dim_size() == 0) + return true; + + for (int i = 0; i < sptr->dim_size(); i++) { + if (sptr->dim(i).has_dim_param()) + return true; + } + + return false; }); const auto& out_args = graph.GetOutputs(); @@ -1002,7 +1000,7 @@ Status MIGraphXExecutionProvider::Compile(const std::vector& } std::vector input_names, output_names; - no_input_shape = no_input_shape or get_input_output_names(graph_body_viewer, input_names, output_names); + no_input_shape = get_input_output_names(graph_body_viewer, input_names, output_names); // by parsing the model_proto, create a program corresponding to // the input fused_node diff --git a/onnxruntime/python/tools/transformers/models/stable_diffusion/benchmark.py b/onnxruntime/python/tools/transformers/models/stable_diffusion/benchmark.py index e6178f3c5d..1226c3bfab 100755 --- a/onnxruntime/python/tools/transformers/models/stable_diffusion/benchmark.py +++ b/onnxruntime/python/tools/transformers/models/stable_diffusion/benchmark.py @@ -19,6 +19,7 @@ SD_MODELS = { PROVIDERS = { "cuda": "CUDAExecutionProvider", "rocm": "ROCMExecutionProvider", + "migraphx": "MIGraphXExecutionProvider", } @@ -570,7 +571,7 @@ def parse_arguments(): "--batch_size", type=int, default=1, - choices=[1, 2, 4, 8, 10, 16, 32], + choices=[1, 2, 3, 4, 8, 10, 16, 32], help="Number of images per batch. Default is 1.", )