Skip to content

Commit

Permalink
Add support for softmaxcrossentropy loss to MIGraphX EP
Browse files Browse the repository at this point in the history
  • Loading branch information
TedThemistokleous committed Sep 7, 2024
1 parent 4bd6dfc commit 36cd087
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ GetUnsupportedNodeIndices(const GraphViewer& graph_viewer,
"Sinh",
"Slice",
"Softmax",
"SoftmaxCrossEntropyLoss",
"Softplus",
"Softsign",
"SpaceToDepth",
Expand Down Expand Up @@ -1018,15 +1019,6 @@ MIGraphXExecutionProvider::GetCapability(const onnxruntime::GraphViewer& graph_v
return result;
}

// migraphx cannot handle Loop, If, and SoftmaxCrossEntropyLoss for now,
// so if a model contain any of these operators, fall back to CPU
std::unordered_set<std::string> vec_ops = {"SoftmaxCrossEntropyLoss"};
if (std::any_of(unsupported_nodes.begin(), unsupported_nodes.end(), [&](auto i) {
return (vec_ops.count(graph_viewer.GetNode(i)->OpType()) > 0);
})) {
return result;
}

auto mgx_clusters = GetPartitionedSubgraphs(graph_viewer.GetNodesInTopologicalOrder(), unsupported_nodes);

// check whether a subgrap should fallback to CPU
Expand Down

0 comments on commit 36cd087

Please sign in to comment.