Comments (6)
推理这部分我还没有做过性能相关的测试,但我理解这里的4bit方法应该和自带的quantize方法是一致的。
所以如果真的只有压缩显存的效果,那么确实应该还要寻求更优的推理方案,比如类似tensorRT这样的推理专用引擎之类的。
from chatglm-6b-qlora.
推理这部分我还没有做过性能相关的测试,但我理解这里的4bit方法应该和自带的quantize方法是一致的。 所以如果真的只有压缩显存的效果,那么确实应该还要寻求更优的推理方案,比如类似tensorRT这样的推理专用引擎之类的。
你可以帮测试一下训练过之后的性能吗,就用单条prompt循环10次,耗时平均, 我用没训练的测试了一下,似乎是比自带的快一点点,但是还是比不量化慢。确实提速只有靠cuda算子优化,用fasttransformers转了之后,速度提升比较明显
from chatglm-6b-qlora.
https://huggingface.co/blog/zh/hf-bitsandbytes-integration
找了下官方博客里的一篇文章,8bit的原理,看上去确实只是为了节省显存。我有空了也测试下。
from chatglm-6b-qlora.
@Nipi64310 不好意思,我昨天在写合并lora和用自带的quantize量化的脚本,对你的原始问题回答可能跑偏了。
这里qlora训练后,得到的是一个lora的adapter文件,只有几兆的大小,需要把这个adapter文件和原始fp32的模型合并后,才能得到完整模型,所以是可以得到完整的fp32模型,再拿去别的框架里加速的。
昨天更新的merge_lora_and_quantize.py文件,就是在做模型的合并和使用自带的quantize进行量化。
from chatglm-6b-qlora.
推理这部分我还没有做过性能相关的测试,但我理解这里的4bit方法应该和自带的quantize方法是一致的。 所以如果真的只有压缩显存的效果,那么确实应该还要寻求更优的推理方案,比如类似tensorRT这样的推理专用引擎之类的。
你可以帮测试一下训练过之后的性能吗,就用单条prompt循环10次,耗时平均, 我用没训练的测试了一下,似乎是比自带的快一点点,但是还是比不量化慢。确实提速只有靠cuda算子优化,用fasttransformers转了之后,速度提升比较明显
做了个测试,可以看一下:https://github.com/shuxueslpi/chatGLM-6B-QLoRA#%E6%8E%A8%E7%90%86%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95
from chatglm-6b-qlora.
感谢,很棒的工作
from chatglm-6b-qlora.
Related Issues (20)
- 数据集格式instruction,input,output时tokenized出错 HOT 2
- 训练结束后,数据展示出现问题
- merge后模型Loading checkpoint shards Killed HOT 6
- 调优后的模型是否可以在CPU服务上部署? HOT 1
- protobuf 和 icetk 版本不兼容 HOT 1
- ImportError: libcudnn.so.8: cannot open shared object file: No such file or directory HOT 12
- RuntimeError: mat1 and mat2 shapes cannot be multiplied (588x4096 and 1x9437184) ,ChatGLM2-6B做微调,请问如何设置参数?? HOT 1
- RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:1 and cuda:0! (when checking argument for argument target in method wrapper_CUDA_nll_loss_forward),请问如何调整训练代码,适配多卡训练?? HOT 1
- transformers>4.30.2时,模型不会进行量化,是因为什么?
- BrokenPipeError: [Errno 32] Broken pipe HOT 7
- 训练结束后没有保存完整的adapter文件 HOT 2
- 用V100显卡微调chatglm2-6b,但是loss一直为0,eval_loss=nan
- 训练显存有些问题
- 微调后推理性能问题 HOT 1
- ChatGLM3-6B 微调报错 RuntimeError: CUDA error: invalid argument HOT 1
- ChatGLM2-6B微调后合并报错We need an `offload_dir` to dispatch this model according to this `device_map`, the following submodules need to be offloaded: HOT 2
- 合并模型的时候显存不够,用的4090,24G
- qlora微调训练随机性
- ValueError:
- ChatGLM2-6b模型合并时报错ValueError: We need an `offload_dir` to dispatch this model according to this `device_map`, the following submodules need to be offloaded
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 chatglm-6b-qlora.