Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

内存要求 #68

Open
CHY-coder opened this issue Jan 3, 2024 · 1 comment
Open

内存要求 #68

CHY-coder opened this issue Jan 3, 2024 · 1 comment

Comments

@CHY-coder
Copy link

我在运行 Native PyTorch Version的Emu2 & Emu2-Chat时,进程被kill了,是内存爆了,内存大概需要多大,我的服务器目前只有125的内存。

@ryanzhangfan
Copy link
Collaborator

直接参照README.md的方式init并且load模型的话,需要140G内存,因为要先初始化一个fp32的模型,然后再转成bf16精度。

可以尝试结合accelerate的init_empty_weights和load_checkpoint_and_dispatch来初始化并加载模型,这样能够减少内存使用,这种方式大约需要75GB内存。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants