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)
- Token merging for LLM Inference HOT 1
- llava-next demo / tutorial code does not work HOT 3
- Constrained beam search in chat
- GPT2 model getting NaN logits with MPS device HOT 3
- Attention implementation cannot work together with config in AutoModel HOT 2
- Idefics2 raises shape error in the backward pass with gradient_checkpointing HOT 3
- AttributeError: 'torch.dtype' object has no attribute 'element_size' HOT 6
- load and train with bf16,saved torch_dtype is float32 HOT 2
- Support multiple `timm` as backbones with `forward_intermediates` method HOT 4
- Badam support HOT 1
- Can't load tokenizer HOT 1
- assisted_decoding does not correctly update static KV cache HOT 3
- Mamba + LoRA: after merge_and_unload() does not work well HOT 2
- [Bug] Error when trying to run two models in a machine with created ZeRO config variables. HOT 1
- Cannot load codeqwen Tokenizer HOT 4
- Unable to use set_weights() and reload model later
- Error on TPU: Invalid --2a886c8_slice_builder_worker_addresses specified. Expected 4 worker addresses, got 1. HOT 1
- idefics2-8b-AWQ failed when doing multiple calls HOT 2
- Cannot load AWQ model on GPU with deepspeed zero3 HOT 2
- If a training job job failed MLFlow will not be reported and MLFlow shows job still running 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 transformers.