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

[Optimum export ONNX] Bug when export model TrOCR with dtype BF16 #1845

Open
2 of 4 tasks
vu0607 opened this issue May 6, 2024 · 0 comments
Open
2 of 4 tasks

[Optimum export ONNX] Bug when export model TrOCR with dtype BF16 #1845

vu0607 opened this issue May 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@vu0607
Copy link

vu0607 commented May 6, 2024

System Info

optimum: `1.17.1`
onnx: `1.15.0`
onnxruntime-gpu: `1.17.1` 
torch: `1.12.0+cu113`
CUDA: `11.4`

Who can help?

I meet bug when export model TrOCR to ONNX dtype bf16 (support with optimum 1.17.0): INVALID_GRAPH : Load model from output/encoder_model.onnx failed:This is an invalid model. Type Error: Type 'tensor(bfloat16)' of input parameter (pixel_values) of operator (Conv) in node (/embeddings/patch_embeddings/projection/Conv) is invalid.
Mr @michaelbenayoun Hope you can consider and support me.
Beside I want ask about plan support export ONNX dtype float8 in the future. I see quanto support quantize model to float8

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction (minimal, reproducible, runnable)

optimum-cli export onnx \
      --task image-to-text-with-past \
      --model "microsoft/trocr-small-handwritten" "output" \
      --device cuda \
      --dtype bf16 \
      --batch_size 8 \
      --width 384 \
      --height 384 \
      --num_channels 3

Expected behavior

successfully export BF16 and plan about dtype FP8

@vu0607 vu0607 added the bug Something isn't working label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant