Add support for softmaxcrossentropy loss to MIGraphX EP (#64) (#22603)

Add support for softmaxcrossentropy loss. This is already enabled on our
ROCm Fork of the MIGraphX EP


### Motivation and Context
Adds support for the SoftmaxCrossEntropyLoss operator and removes the
filtering of inputs here.
This commit is contained in:
Ted Themistokleous 2024-10-27 16:59:35 -04:00 коммит произвёл GitHub
Родитель 05fbb43b34
Коммит 7ad78733e6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 1 добавлений и 9 удалений

Просмотреть файл

@ -915,6 +915,7 @@ GetUnsupportedNodeIndices(const GraphViewer& graph_viewer,
"SkipSimplifiedLayerNormalization",
"Slice",
"Softmax",
"SoftmaxCrossEntropyLoss",
"Softplus",
"Softsign",
"SpaceToDepth",
@ -1026,15 +1027,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