Comments (11)
之前说的有些问题,我用的是32 张 32G V100,而不是40G A100,batch size 能开到 34。用的是deepspeed的ZERO2/3优化,以及 mix precision 16。那么看上去如果是80G A100的话,似乎是能开到batch size 80的,以下是我的deepspeed config,给你做参考:
deepspeed ZERO2
{ "zero_optimization": { "stage": 2, "allgather_partitions": true, "allgather_bucket_size": 2e8, "overlap_comm": true, "reduce_scatter": true, "reduce_bucket_size": 2e8, "contiguous_gradients": true }, "train_micro_batch_size_per_gpu": "auto" }
deepspeed ZERO3
{ "zero_optimization": { "stage": 3, "offload_optimizer": { "device": "cpu", "pin_memory": true }, "offload_param": { "device": "cpu", "pin_memory": true }, "overlap_comm": true, "contiguous_gradients": true, "reduce_bucket_size": "auto", "stage3_prefetch_bucket_size": "auto", "stage3_param_persistence_threshold": "auto", "sub_group_size": 1e9, "stage3_max_live_parameters": 1e9, "stage3_max_reuse_distance": 1e9, "stage3_gather_16bit_weights_on_model_save": "auto" }, "train_micro_batch_size_per_gpu": "auto" }
from uniem.
可能得开 ZERO2/3 优化 + mix precision + gradient checkpointing才能扩到那么大。我这里40G A100,fp16 + ZERO2 能开到34,不过似乎也差一点。
from uniem.
如果开gradient accumulation 就丧失了增大batch_size增加nagetivate sample num的目的了。
from uniem.
有开混合精度吗?在 BatchSize 比较大的时候,开混合精度是会减少显存的使用的。
m3e 的数据格式是 PairRecord ,所以没有 add_swap_loss。在复现 instructor 的时候使用的是 Medi 数据集,Medi 数据集是 TripletRecord ,添加了 swap loss。
from uniem.
如果开gradient accumulation 就丧失了增大batch_size增加nagetivate sample num的目的了。
嗯,他指的是 gradient checkpointing
from uniem.
可能得开 ZERO2/3 优化 + mix precision + gradient checkpointing才能扩到那么大。我这里40G A100,fp16 + ZERO2 能开到34,不过似乎也差一点。
几张卡开的 ZERO2 ?
from uniem.
如果开gradient accumulation 就丧失了增大batch_size增加nagetivate sample num的目的了。
嗯,他指的是 gradient checkpointing
好的,我试试gradient checkpointing 和开混合精度
from uniem.
有开混合精度吗?在 BatchSize 比较大的时候,开混合精度是会减少显存的使用的。
m3e 的数据格式是 PairRecord ,所以没有 add_swap_loss。在复现 instructor 的时候使用的是 Medi 数据集,Medi 数据集是 TripletRecord ,添加了 swap loss。
请教你,batch size 80是怎么达到的?
from uniem.
有开混合精度吗?在 BatchSize 比较大的时候,开混合精度是会减少显存的使用的。
m3e 的数据格式是 PairRecord ,所以没有 add_swap_loss。在复现 instructor 的时候使用的是 Medi 数据集,Medi 数据集是 TripletRecord ,添加了 swap loss。请教你,batch size 80是怎么达到的?
没有其他的优化了,不过可能 instructor 这个 max-length 我可能记混了... max-length 应该是 400。m3e 的是 512 ,复现 instructor 的是 400。你先试试 512 的,如果还是不行的话,再换成 400。实在抱歉,没有好好记录实验的细节。
from uniem.
有开混合精度吗?在 BatchSize 比较大的时候,开混合精度是会减少显存的使用的。
m3e 的数据格式是 PairRecord ,所以没有 add_swap_loss。在复现 instructor 的时候使用的是 Medi 数据集,Medi 数据集是 TripletRecord ,添加了 swap loss。请教你,batch size 80是怎么达到的?
没有其他的优化了,不过可能 instructor 这个 max-length 我可能记混了... max-length 应该是 400。m3e 的是 512 ,复现 instructor 的是 400。你先试试 512 的,如果还是不行的话,再换成 400。实在抱歉,没有好好记录实验的细节。
好的 谢谢!
from uniem.
之前说的有些问题,我用的是32 张 32G V100,而不是40G A100,batch size 能开到 34。用的是deepspeed的ZERO2/3优化,以及 mix precision 16。那么看上去如果是80G A100的话,似乎是能开到batch size 80的,以下是我的deepspeed config,给你做参考: deepspeed ZERO2
{ "zero_optimization": { "stage": 2, "allgather_partitions": true, "allgather_bucket_size": 2e8, "overlap_comm": true, "reduce_scatter": true, "reduce_bucket_size": 2e8, "contiguous_gradients": true }, "train_micro_batch_size_per_gpu": "auto" }
deepspeed ZERO3
{ "zero_optimization": { "stage": 3, "offload_optimizer": { "device": "cpu", "pin_memory": true }, "offload_param": { "device": "cpu", "pin_memory": true }, "overlap_comm": true, "contiguous_gradients": true, "reduce_bucket_size": "auto", "stage3_prefetch_bucket_size": "auto", "stage3_param_persistence_threshold": "auto", "sub_group_size": 1e9, "stage3_max_live_parameters": 1e9, "stage3_max_reuse_distance": 1e9, "stage3_gather_16bit_weights_on_model_save": "auto" }, "train_micro_batch_size_per_gpu": "auto" }
能否参考一下代码。我用accelerate开deepspeed报错。[email protected] 谢谢
from uniem.
Related Issues (20)
- 关于模型效果 HOT 1
- m3e模型支持openai的接口调用方式吗 HOT 1
- 无法使用图嵌入 HOT 1
- 关于huggingface方法调用 HOT 1
- sentence-transformer调用huggingface模型 HOT 1
- 负采样 HOT 3
- 请教贴:文本最大长度 HOT 5
- 进行评测时会报错,分叉可能会导致死锁. HOT 1
- 求一份评测数据集 HOT 1
- 微调后模型保存和load的问题 HOT 3
- m3e-large数据集的相关问题 HOT 1
- m3e训练的时候使用的数据集是hugg上面列出的数据集,训练和测试集和验证集一起用来训练了吗? HOT 1
- 请问微调之后的模型如何支持C_MTEB数据集上的评测呢 HOT 2
- 实际测试 PairInBatchNegSoftmaxContrastLoss和PairInBatchNegCoSentLoss的值是一样的 HOT 1
- 转onnx问题 HOT 1
- 能不能说明一下显卡要求啊? HOT 3
- fintuner如何使用gpu? HOT 1
- 问题 HOT 3
- 代码跑着跑着就挂了,CUDA out of memory HOT 1
- Loss固定不变或者上升 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 uniem.