microsoft / microsoft/onnxruntime

[Feature Request] Float64 in onnx-runtime?

Open
#16,494 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

### Describe the feature request

I am trying to use ONNX Runtime in inferencing where preision is very important.
We are training the model in pytorch and saving the weights in double. And exporting this model to onnx.
However looks like onnx runtime does not support double weights since it throws : [Unexpected input data type. Actual: (tensor(double)) , expected: (tensor(float))](https://stackoverflow.com/questions/68152634/unexpected-input-data-type-actual-tensordouble-expected-tensorfloat)
Note that: Our pytorch model is sequential, 6 layers deep, with SiLu activation.

### Describe scenario use case

We are using ONNX Runtime to run inferencing in financial data where extreme precision is needed to get the derivatives of smooth function by numerical methods.
Float64 will be ideal, not float32.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file, test, or entry point is named. Start by locating the inference path that rejects tensor(double) and compare the requested PyTorch-exported weights with the supported ONNX Runtime types; done means a float64 model can run without that type error, with coverage for the reported case.

Written by the indexing model from the issue text.

Assessment

Tech stack
pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.