Fix Intel ONNX runtime

This commit is contained in:
2026-04-10 17:13:47 +10:00
parent eb863bf510
commit 257145c429
5 changed files with 104 additions and 2 deletions

View File

@@ -233,7 +233,20 @@ namespace ANSCENTER {
if (engine == EngineType::AMD_GPU) {
session_options.DisableMemPattern();
session_options.SetExecutionMode(ExecutionMode::ORT_SEQUENTIAL);
ANS_DBG("OrtHandler", "DirectML: DisableMemPattern + ORT_SEQUENTIAL set");
// DirectML 1.15.4 (the latest; Microsoft has moved DirectML into
// sustained engineering only) has a deterministic crash path in
// amdkmdag.sys +0xf03d on RDNA2 iGPUs (Radeon 680M on Ryzen 6000)
// when ORT_ENABLE_ALL applies layout-reorder transforms to
// YOLO-style conv graphs. Downgrade to EXTENDED on DML: still
// keeps constant folding and Conv+BN+ReLU fusion (the big wins),
// drops the risky layout transforms. Perf impact on YOLO is
// typically under 5%.
session_options.SetGraphOptimizationLevel(
GraphOptimizationLevel::ORT_ENABLE_EXTENDED);
ANS_DBG("OrtHandler",
"DirectML: DisableMemPattern + ORT_SEQUENTIAL + EXTENDED opt");
}
std::vector<std::string> available = Ort::GetAvailableProviders();

View File

@@ -294,6 +294,10 @@ namespace ANSCENTER {
BasicOrtHandler(const BasicOrtHandler&) = delete;
BasicOrtHandler& operator=(const BasicOrtHandler&) = delete;
public:
// Resolved EP type (after EPLoader fallback). Subclasses use this
// to branch on actual EP at inference time.
EngineType getEngineType() const { return m_engineType; }
private:
void initialize_handler();
protected: