Comments (3)
Thanks! I pushed a fix for that, you can try it again. You should be able to increase a bit the batch size.
By the way, the real batch size that is used on the gpu is train_batch_size / gradient_accumulation_steps
so 2
in your case. I think you should be able to go to 3
with --optimize_on_cpu
The recommended batch_size to get good results (EM, F1) with BERT large on SQuaD is 24
. You can try the following possibilities to get to this batch_size:
- keeping the same 'real batch size' that you currently have but just a bigger batch_size
--train_batch_size 24 --gradient_accumulation_steps 12
- trying a 'real batch size' of 3 with optimization on cpu
--train_batch_size 24 --gradient_accumulation_steps 8 --optimize_on_cpu
- switching to fp16 (implies optimization on cpu):
--train_batch_size 24 --gradient_accumulation_steps 6 or 4 --fp16
If your GPU supports fp16, the last solution should be the fastest, otherwise the second should be the fastest. The first solution should work out-of-the box and give better results (EM, F1) but you won't have any speed-up.
from transformers.
Should be fixed now. Don't hesitate to re-open an issue if needed. Thanks for the feedback!
from transformers.
Yes it works now!
With
--train_batch_size 24 --gradient_accumulation_steps 8 --optimize_on_cpu
I get {"exact_match": 83.78429517502366, "f1": 90.75733469379139} which is pretty close.
Thanks for this amazing work!
from transformers.
Related Issues (20)
- Llama3 with LlamaForSequenceClassification - Shape mismatch error HOT 2
- Cannot replicate results from object detection task guide HOT 9
- Idefics2 fine-tuning: Error when unscale_gradients called on FP16 gradients during training with transformers and accelerate HOT 1
- Wav2Vec2CTCTokenizer adds random unknown tokens to encoded input HOT 1
- MLFlowCallback MLFLOW_RUN_ID not used HOT 1
- Correct check for SDPA in Vision Language Models HOT 1
- KeyError Issue Reason HOT 1
- ValueError Reason HOT 7
- Issue with `output_router_logits` Parameter Not Being Passed Correctly in `SwitchTransformersForConditionalGeneration`
- Make fx traced model with the use of `past_key_values` pickable again?
- Community contribution: enable dynamic resolution input for more vision models. HOT 5
- mistralai/Mixtral-8x7B-v0.1 bfloat16 much slower than FP32 on Intel EMR CPU HOT 3
- ReadTimeOutError with from_pretrained for some model checkpoints only HOT 1
- The Phi-3 tokenizer is not inverting the chat template correctly. HOT 3
- i cannot find the code that transformers trainer model_wrapped by deepspeed , i can find the theory about model_wrapped was wraped by DDP(Deepspeed(transformer model )) ,but i only find the code transformers model wrapped by ddp, where is the deepspeed wrapped ? thanks ^-^ HOT 4
- Whisper Translation on low resource languages
- Cache in different devices when use split model with dispatch_model() function and model.generate()
- ChatGLM3-6b测试模型时报错AttributeError: can't set attribute HOT 1
- i cannot find the code that transformers trainer model_wrapped by deepspeed , i can find the theory about model_wrapped was wraped by DDP(Deepspeed(transformer model )) ,but i only find the code transformers model wrapped by ddp, where is the deepspeed wrapped ? thanks ^-^ HOT 1
- AutoModal how to enable TP for extremly large models? HOT 2
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 transformers.