Skip to content

Commit

Permalink
Remove hardcoded list of supported Onnx operators from MIGraphX
Browse files Browse the repository at this point in the history
  • Loading branch information
TedThemistokleous committed Sep 7, 2024
1 parent 36cd087 commit 4048831
Showing 1 changed file with 5 additions and 142 deletions.
147 changes: 5 additions & 142 deletions onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -785,148 +785,11 @@ static std::vector<NodeIndex>
GetUnsupportedNodeIndices(const GraphViewer& graph_viewer,
/*out*/ std::unordered_set<std::string>& mgx_required_initializers,
const logging::Logger& logger) {
static std::set<std::string> mgx_supported_ops = {"Abs",
"Acos",
"Acosh",
"Add",
"And",
"ArgMax",
"ArgMin",
"Asin",
"Asinh",
"Atan",
"Atanh",
"ATen",
"AveragePool",
"BatchNormalization",
"Cast",
"Ceil",
"Celu",
"Clip",
"Concat",
"Constant",
"ConstantFill",
"ConstantOfShape",
"Conv",
"ConvInteger",
"ConvTranspose",
"Cos",
"Cosh",
"CumSum",
"DepthToSpace",
"DequantizeLinear",
"Div",
"Dropout",
"Elu",
"Equal",
"Erf",
"Exp",
"Expand",
"EyeLike",
"Flatten",
"Floor",
"GRU",
"Gather",
"GatherElements",
"GatherND",
"Gemm",
"GlobalAveragePool",
"GlobalMaxPool",
"Greater",
"GreaterOrEqual",
"HardSigmoid",
"HardSwish",
"Identity",
"If",
"ImageScaler",
"InstanceNormalization",
"IsNan",
"LeakyRelu",
"Less",
"LessOrEqual",
"Log",
"LogSoftmax",
"Loop",
"LpNormalization",
"LRN",
"LSTM",
"MatMul",
"MatMulInteger",
"Max",
"MaxPool",
"Mean",
"Min",
"Mod",
"Mul",
"Multinomial",
"Neg",
"NonMaxSuppression",
"NonZero",
"Not",
"OneHot",
"Or",
"Pad",
"Pow",
"PRelu",
"QLinearAdd",
"QLinearConv",
"QLinearMatMul",
"QuantizeLinear",
"DynamicQuantizeLinear",
"RandomNormal",
"RandomNormalLike",
"RandomUniform",
"RandomUniformLike",
"Range",
"Reciprocal",
"ReduceL1",
"ReduceL2",
"ReduceLogSum",
"ReduceLogSumExp",
"ReduceMax",
"ReduceMean",
"ReduceMin",
"ReduceProd",
"ReduceSum",
"ReduceSumSquare",
"Relu",
"Reshape",
"Resize",
"ReverseSequence",
"RNN",
"Roialign",
"Round",
"Scatter",
"ScatterElements",
"ScatterND",
"Selu",
"Shape",
"Sigmoid",
"Sign",
"Sin",
"Sinh",
"Slice",
"Softmax",
"SoftmaxCrossEntropyLoss",
"Softplus",
"Softsign",
"SpaceToDepth",
"Split",
"Sqrt",
"Squeeze",
"Sub",
"Sum",
"Tan",
"Tanh",
"ThresholdedRelu",
"Tile",
"TopK",
"Transpose",
"Trilu",
"Unsqueeze",
"Upsample",
"Where",
"Xor"};

Check warning on line 788 in onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc#L788

Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2]
Raw output
onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc:788:  Redundant blank line at the start of a code block should be deleted.  [whitespace/blank_line] [2]
// Leverage MIGraphX API to tell is which operators we support.
auto migx_ops{migraphx::get_onnx_operators()};
static std::set<std::string> mgx_supported_ops(std::make_move_iterator(migx_ops.begin()), std::make_move_iterator(migx_ops.end()));

Check warning on line 791 in onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc#L791

Lines should be <= 120 characters long [whitespace/line_length] [2]
Raw output
onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc:791:  Lines should be <= 120 characters long  [whitespace/line_length] [2]

std::vector<NodeIndex> unsupported_nodes_idx;
for (const auto& node_idx : graph_viewer.GetNodesInTopologicalOrder()) {
if (IsNodeSupported(mgx_supported_ops, graph_viewer, node_idx, logger)) {
Expand Down

0 comments on commit 4048831

Please sign in to comment.