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

你好,怎么让保存的模型能够分片,而不是保存一个几十G的大模型 #143

Open
459737087 opened this issue Dec 14, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@459737087
Copy link

你好,怎么让保存的模型能够分片,而不是保存一个几十G的大模型。
我看了一遍这里面的参数,但是发现是完整保存的,而不是分片的,这个有办法吗

@KaiLv69
Copy link
Collaborator

KaiLv69 commented Dec 14, 2023

你好,现在在使用流水线并行时候会按照rank来保存模型到不同文件,其他情况都会保存到同一个文件里

@KaiLv69 KaiLv69 added the enhancement New feature or request label Dec 14, 2023
@459737087
Copy link
Author

我看到transformer有一个函数是save_pretrained,里面的参数带分片的,但是不知道怎么继承过来比较好
https://github.com/huggingface/transformers/blob/131a528be02e1fa2d27f215920d2fd69e1d246cd/docs/source/en/big_models.md?plain=1#L64
如果直接拿来用肯定有冲突,有什么好的办法吗 @KaiLv69

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

No branches or pull requests

2 participants