Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
antoninononooono opened this issue Jul 21, 2024 · 0 comments

Comments

@antoninononooono
Copy link

antoninononooono commented Jul 21, 2024

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);

};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant