Comments (1)
@anilmartha thank you for the report, this is unexpected. I did not add a full CI with bf16 but should probably add one with the most used models.
It appears that PyTorch 2.2.1 does not support scaled_dot_product_attention export in BF16, see https://github.com/pytorch/pytorch/blob/v2.2.1/torch/onnx/symbolic_opset14.py#L191-L199
This is fixed on main: https://github.com/pytorch/pytorch/blob/f4cf25bb24be735b2502ae13f290017992c2fac8/torch/onnx/symbolic_opset14.py#L194 & pytorch/pytorch#117878
So in PyTorch 2.3, this will be possible.
We could add an optional option in Optimum to choose that the export is done with the manual attention implementation, not torch.nn.functional.scaled_dot_product_attention
. Would that help you?
As an alternative, you could downgrade to torch==2.1.0
(for which SDPA is not picked in Transformers).
from optimum.
Related Issues (20)
- Native Support for Gemma HOT 5
- Flash Attention v2 for Roberta-large HOT 5
- Issue converting owlv2 model to ONNX format HOT 4
- Optimum for Jetson Orin Nano HOT 1
- 似乎不支持cpu HOT 2
- Implement ORTModelForZeroShotObjectDetection HOT 3
- changes to _maybe_log_save_evaluate() not reflected in optimum repo HOT 1
- 'gemma is not supported yet with the onnx backend' - Exporting on-the-fly to onnx HOT 8
- Gemma Onnx suuport HOT 5
- tflite support for gemma HOT 1
- [BUG] Mistral feature extraction export to ONNX is broken HOT 5
- [BUG] Mistral feature extraction export to ONNX is broken
- [BUG] Cannot export Gemma/Mistral to ONNX/TensorRT using INT8 HOT 9
- Cannot download ONNX external data file from Hugging Face Hub HOT 4
- Cannot download from private repository on Hugging Face using optimum 1.17 HOT 3
- onnx model issue for zeroshot facebook/bart-large-mnli HOT 1
- Mixtral-8x7B-Instruct-v0.1-GPTQ AssertionError HOT 6
- OnnxSlim support
- NoSuchFile: [ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from data/data_onnx/model.onnx failed:Load model data/data_onnx/model.onnx failed. File doesn't exist HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from optimum.