Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,30 @@ void UnaryOpQDQRules(SelectorActionRegistry& qdq_selector_action_registry) {
std::unique_ptr<Action> action = std::make_unique<QDQ::UnaryReplaceWithQLinear>(kMSDomain);

#if !defined(ORT_MINIMAL_BUILD)
// Operators without DML QLinear kernel support (CPU only).
// DML EP does not have QLinearLeakyRelu or QLinearSoftmax kernels.
// See https://github.com/microsoft/onnxruntime/issues/26531
std::vector<const char*> cpu_only_providers = {kCpuExecutionProvider};
std::unique_ptr<NodeSelector> cpu_selector = std::make_unique<QDQ::UnarySelector>(cpu_only_providers);
qdq_selector_action_registry.RegisterSelectorAndAction("1DQ_CPU",
Comment thread
adrastogi marked this conversation as resolved.
Outdated
Comment thread
adrastogi marked this conversation as resolved.
Outdated
{{"LeakyRelu", {}},
{"Softmax", {}}},
std::move(cpu_selector),
std::make_unique<QDQ::UnaryReplaceWithQLinear>(kMSDomain));

// Operators with DML QLinear kernel support (QLinearAveragePool, QLinearGlobalAveragePool, QLinearSigmoid)
std::vector<const char*> providers = {kCpuExecutionProvider, kDmlExecutionProvider};
std::unique_ptr<NodeSelector> selector = std::make_unique<QDQ::UnarySelector>(providers);
qdq_selector_action_registry.RegisterSelectorAndAction(action_name,
{{"AveragePool", {}},
{"LeakyRelu", {}},
{"GlobalAveragePool", {}},
{"Sigmoid", {}},
{"Softmax", {}}},
{"Sigmoid", {}}},
std::move(selector),
std::move(action));
#else
qdq_selector_action_registry.RegisterAction(action_name, std::move(action));
qdq_selector_action_registry.RegisterAction("1DQ_CPU",
Comment thread
adrastogi marked this conversation as resolved.
Outdated
std::make_unique<QDQ::UnaryReplaceWithQLinear>(kMSDomain));
#endif
}

Expand Down
Loading