piper-phonemize icon indicating copy to clipboard operation
piper-phonemize copied to clipboard

Possible incompatibility with DirectML/ WebGL? "ORT NOT IMPLEMENTED" thrown

Open antoninononooono opened this issue 7 months ago • 0 comments

I am successfully using Piper TTS with Onnx Runtime. However using Onnx Runtime + DirectML caused the error "ORT NOT IMPLEMENTED" in such example code as below. Are you aware of any functions that are being used in Pytorch that are not compatible / available in DirectML or WebGL yet? I am asking about WebGL because I tried using WebGL, and it failed as well.

OnnxModelHandler::OnnxModelHandler(const std::wstring& uModelPath, const std::string& uSessionName) { OrtApi const& nOrtApi = Ort::GetApi(); const OrtDmlApi* nOrtDmlApi; auto status = nOrtApi.GetExecutionProviderApi("DML", ORT_API_VERSION, reinterpret_cast<const void**>(&nOrtDmlApi));

Ort::SessionOptions nSessionOptions = Ort::SessionOptions();
nSessionOptions.SetExecutionMode(ExecutionMode::ORT_SEQUENTIAL);
nSessionOptions.DisableMemPattern();
nSessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED);

if (status != nullptr)
{
    nOrtDmlApi->SessionOptionsAppendExecutionProvider_DML(nSessionOptions, 0); // Using device index 0
}

string sSessionName = uSessionName + "DirectML_Direct3D_TensorAllocation_Test";

Ort::Env _env(ORT_LOGGING_LEVEL_VERBOSE,sSessionName.c_str());

_session = new Ort::Session(_env, uModelPath.c_str(), nSessionOptions); //throws ORT NOT IMPLEMENTED

_singleInputName = GetTensorName(0, _session, true);
_singleOutputName = GetTensorName(0, _session, false);

};

antoninononooono avatar Jul 21 '24 01:07 antoninononooono