Comments (2)
@Crazybean-lwb 你是用nvidia-smi看的显存占用吗?
nvidia-smi的Memory-Usage里面还包含了pytorch缓存区的内存。只要一个Tensor对象在后续不会再被使用,那么PyTorch就会自动回收该Tensor所占用的显存,但即便这个Tensor被释放了,进程也不会把空闲出来的显存还给GPU,并以缓冲区的形式继续占用显存,等待下一个Tensor来填入这缓冲区,所以一段时间内看到显存是只增不减的。torch.cuda.empty_cache()把缓冲区内存归零,但是并不推荐,因为下次计算还得重新申请,运行会变慢。
一个方案是加上torch.no_grad(),因为只是推断,不需要反向传播,所以不用保存中间结果,能够节省显存(已经在所有推断的api和demo中加入)。
from visualglm-6b.
赞,已经观察到这个现象了。
from visualglm-6b.
Related Issues (20)
- finetune.sh running error HOT 2
- SAT模型下载 HOT 2
- 加载微调模型报错 HOT 2
- 没有model_config.json
- 加载微调后模型再次微调 HOT 3
- 跳过deepspeed库,但是推理失败 HOT 4
- 为什么这个模型采用p-tuning微调的结果比chatGLM大那么多 HOT 1
- sat库微调不支持设置epoch吗,只支持train_iters的配置?
- 请问train-iters一般设置为多少合适
- 批量处理图片的时候,很容易吃内存在是怎么回事? HOT 2
- 微调时,微调数据一大就卡住,10000样本就跑不通 HOT 1
- huggingface权重模型无法进行finetune HOT 2
- 推理用Huggingface可以得到正常结果,用sat结果不对 HOT 4
- 您好,麻烦问下,模型推理结果有误 HOT 1
- 请问visualglm最近有更新checkpoint吗? HOT 10
- 通过SAT方式启动cli_demo.py或web_demo.py时报Segmentation fault HOT 2
- 有没有微调脚本的参数说明文档呢
- Contrastive Loss
- 报错 DeepSpeed/CUDA is not installed, fallback to Pytorch checkpointing和No module named 'torch._six'
- 请问现在支持多图输入吗?
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 visualglm-6b.