Comments (10)
Thank you for reaching out with your question. Can you please specify an urgency and the scenario where you are using ORT for training. It will also be helpful if you can provide the list of ops that your scenario needs. Missing gradient support for certain ops is a known gap and the gradient builder will be implemented on a per-demand basis. If we understand your urgency, it will help us prioritize this work for implementation.
from onnxruntime.
Thank you for your response. Can you try exporting your model through torch.onnx.export and use that model as your starting point for training artifact generation? This exported model should have all ONNX ops and should temporarily unblock you as we work on gradient builder for the missing ops.
from onnxruntime.
Hi @kshama-msft,
Scenario : I want to finetune a quantized ONNX-genai model using ORTTraining so I'll need the gradient implementation of some specific nodes.
Urgency : as soon as possible
Here are the list of nodes that need a gradient implementation :
op_type : GroupQueryAttention, module : com.microsoft v1
op_type : SkipSimplifiedLayerNormalization, module : com.microsoft v1
op_type : SkipLayerNormalization, module : com.microsoft v1
op_type : MatMulNBits, module : com.microsoft v1 (I assume only 4 bit quantization is supported as of today)
op_type : MultiHeadAttention, module : com.microsoft v1 (If it isn't deprecated and replaced by GroupQueryAttention)
from onnxruntime.
IIUC, typically a model would be trained at full precision (32-bit float values) and quantized after for more efficient inferencing. Why do you want/need to train the quantized model, and is there some evidence that doing so would be effective.
from onnxruntime.
Hi @skottmckay,
That's true for small models, but it's practically impossible to train large models on a single GPU using half presion (16-bit float values), let alone full precision since there isn't enough RAM to load all the model weights.
Edit : I don't recall that ONNXRuntime implemented a hybrid execution (CPU+GPU), because this will make it possible to train larger models.
from onnxruntime.
AFAICS none of the training ops support quantized data types, so adding gradient implementations for the contrib ops would not be enough.
e.g.
We're currently looking at making phi-3 work with the on-device training infrastructure so that just the last layer/s of the model could be trained with a much smaller memory requirement. But that would be with fp32 data using CPU.
from onnxruntime.
@Positronx can you try instructions here to use ORTModule. https://github.com/microsoft/onnxruntime/blob/main/docs/ORTModule_Training_Guidelines.md
You just need to wrap the model with ORTModule.
I think at least GroupQueryAttention is not implemented in training. Make sure you use one of the supported types: float32/float16/bf16.
from onnxruntime.
@skottmckay, I see. Why wouldn't it possible to train phi-3 with fp16 using GPU?
from onnxruntime.
fp16 is fine if you have GPU.
if you're shipping a product to general users you can't assume there's a GPU though (and even if there is there are different libraries required for CUDA vs AMD vs integrated) - which is why we're looking at CPU based usage.
from onnxruntime.
This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.
from onnxruntime.
Related Issues (20)
- Cannot create arena allocator with Environment::CreateAndRegisterAllocator on MAC M2 with clang HOT 1
- [Build] How to build for Android armeabi platform? HOT 1
- Issue with performing shape inference using symbolic_shape_infer.py with Phi-3 ONNX Models HOT 4
- [Performance] Mapfile support for certain external data files is not working HOT 2
- [Documentation] Setup the CUDA Environment is not detailed enough HOT 1
- [Documentation] phi-3 vision tutorial lacks samples for languages that are actually used for desktop development. HOT 1
- [Build] Build python interface for Onnxruntime-qnn on aarch64 Linux HOT 11
- [Build] ‘struct onnxruntime::ProviderHostCPU’ has no member named ‘UpsampleBase__AdjustOutputSizeAsPolicy’ when CONTRIB ops are disabled. HOT 15
- Initialization crash using OnnxRuntime 17.0 (previously working on 16.3)
- [Web] `Error: using ceil() in shape computation is not yet supported for AveragePool` HOT 2
- ORT 1.18 crashes on exit after using Cuda EP to run inference on a specific model HOT 2
- [Transformers Optimizer] CLIP-ViT encoder attention not getting fused HOT 4
- [Documentation] How Configure CUDA 12.* and cuDNN for GPU with ONNX Runtime and C# on Windows 11 HOT 6
- Onnx Model run failed in a loop HOT 2
- [Mobile] QNN HTP Backend Setup on Android Device
- onnxruntime-gpu not working with my gpu / setup HOT 9
- onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. HOT 2
- [TensorRT EP] OOM (RAM) when loading ONNX model HOT 7
- Inference result different between cuda and cpu HOT 1
- [Mobile] QNN failed to finalize QNN graph for attention layer
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 onnxruntime.