Comments (5)
通常来说,使用lora训练chatglm2,确实只需要14g左右(在batchsize=1,文本长度也不太长的情况下(比如长度为512))。
但是也有例外,会导致你的显存不够,建议你检查一下下面内容:
- 你的数据batchsize多大,设置为1,如果可以跑通,然后不断的向上加。
- 文本长度多长?可以设置为512,1024,等,不断往上加。
- 检查代码,是不是因为代码的运行方式不对?是完全和我的代码保持一致么?(因为我的这个是模型并行,非常节约显存了)。
- 检查transformers和peft包的版本,更新到最新的版本试一试?
- gradient_checkpoint 打开试一试,也可以节约不少显存。
- 🚨 还有一种可能:因为我的代码是模型并行,在计算loss的时候,比较占用最后一张显卡的显存。不过这个你可能就比较难解决了,只能通过换用更大显存的显卡来解决。
- 还有很多低级错误,如:是不是别的人也在占用了一个显卡,确保每张卡的显存都是为10MB以下哦,这个情况通常发生在实验室里面。
- 一般int8之后,结合lora,单张3080ti都可以跑起来,但是有坑,不建议你使用chatglm自己的量化代码,而是使用transformers的量化方式。
基本上就这些,希望可以帮到你
from zero_nlp.
好的,我试试。谢谢
from zero_nlp.
已解决,transformers更新到最新版
from zero_nlp.
请问chatglm2-6b-lora训练可以设置多轮的epoch吗?我没找到在哪设置的
from zero_nlp.
Related Issues (20)
- 博主您好
- chatGLMv2-6b p-tuning 和 LoRA数据预处理的方法是一样的吗 ?
- ChatGLM2 lora finetuning 加载 lora 参数:RuntimeError: Expected 4-dimensional input for 4-dimensional weight [3072, 32, 1, 1], but got 3-dimensional input of size [1, 64, 4096] instead HOT 4
- 求助:chatglm2 lora训练error:RuntimeError: Expected is_sm80 to be true, but got false. HOT 2
- 训练的时候报错ValueError: The current `device_map` had weights offloaded to the disk. HOT 11
- 训练出错
- 两张4090单机多卡跑,咋感觉越跑越慢了,比单卡慢 HOT 2
- 请问有部署或者运行的文档吗?在哪里可以看?
- 实时微调可以通过加入传统RL实现吗
- 请问如果单纯使用zeroth-order向前优化少量batch(只要体现出一定的优化效果)的话要怎么实现 HOT 2
- lora推理中只能指定一个输入吗?有办法实现batch_size的推理吗
- 救命!!ChatGlm-v2-6b_Lora该怎么设置epoch?? HOT 1
- 大佬,可以多个多个lora叠加使用吗?
- chatglm_v2_6b_lora多卡如何设置,没有找到 HOT 2
- 能出一个ChatGLM
- 能出一个ChatGLM的教程吗
- Segment Fault 是哪的问题?
- 大佬 chinese_llama 还可以用吗 HOT 1
- 出个chatglm3的吧 微调后 推理老是出问题 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 zero_nlp.