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

Missing dtype support for OnnxToTorch #3255

Open
Tracked by #563
jinchen62 opened this issue Apr 29, 2024 · 3 comments
Open
Tracked by #563

Missing dtype support for OnnxToTorch #3255

jinchen62 opened this issue Apr 29, 2024 · 3 comments

Comments

@jinchen62
Copy link
Collaborator

Current support: https://github.com/llvm/torch-mlir/blob/main/lib/Conversion/TorchOnnxToTorch/Utils.cpp#L64

According to onnx dtype and torch dtype, missing support:

  • 4: onnx.TensorProto.UINT16
  • 8: onnx.TensorProto.STRING
  • 12: onnx.TensorProto.UINT32
  • 13: onnx.TensorProto.UINT64
  • 17: onnx.TensorProto.FLOAT8E4M3FN
  • 18: onnx.TensorProto.FLOAT8E4M3FNUZ
  • 19: onnx.TensorProto.FLOAT8E5M2
  • 20: onnx.TensorProto.FLOAT8E5M2FNUZ
  • 21: onnx.TensorProto.UINT4
  • 22: onnx.TensorProto.INT4
@jinchen62
Copy link
Collaborator Author

@jinchen62
Copy link
Collaborator Author

@jinchen62
Copy link
Collaborator Author

checkpoint
https://github.com/jinchen62/torch-mlir/tree/dtype_support
https://github.com/jinchen62/llvm-project/tree/dtype_support

added float8 types to the op def, it could generates %78 = "llvm.fptrunc"(%76) : (vector<4xf32>) -> vector<4xf8E5M2>, but it fails on https://github.com/llvm/llvm-project/blob/main/mlir/lib/Target/LLVMIR/TypeToLLVM.cpp#L79, and seems there is no support for float8 here https://github.com/llvm/llvm-project/blob/main/llvm/lib/IR/Type.cpp#L234

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