InternLM / InternLM/xtuner

有效节省显存的原因

Open
#875 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5.2k
Forks
448
Avg merge
3d 15h
Merged PRs (30d)
26

Description

哈喽
感谢开发xtuner这么强的工具!
有个显存消耗的问题想咨询一下。

问题:lora微调qwen2-7b时,测试显存占用;主要看model(**input)这一步,即前向的显存占用,发现比理论分析的少了一半;具体来说,理论上一次前向fp16精度下 所有激活应该占用接近30个G左右显存,但是xtuner只占用了一半;看参数并没有开启gradient checkpointing(activation checkpointing),那是怎么做到显存节省的呢?

期待回答,非常感谢!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.