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

如何采用模型压缩 #43

Open
Gitreceiver opened this issue Oct 8, 2023 · 2 comments
Open

如何采用模型压缩 #43

Gitreceiver opened this issue Oct 8, 2023 · 2 comments

Comments

@Gitreceiver
Copy link

希望对梯度进行量化、稀疏应该对哪部分进行处理呢?

@WwZzz
Copy link
Owner

WwZzz commented Oct 8, 2023

在Client.unpack()里记录一份全局模型的副本self.received_global_model = copy.deepcopy(pakcage['model']),在Client.pack中计算delta_model = model-self.received_global_model,然后对delta_model的参数进行额外的稀疏和量化,这种方式需要改动的地方较少

@Gitreceiver
Copy link
Author

Gitreceiver commented Oct 20, 2023

那么如果我使用量化方法,直接的做法是客户端将model转换为tensor,再将tensor量化,传输给服务端,服务端反量化,将tensor转换为model,进行模型聚合。
我考虑的问题是,tensor和model的转化函数中的计算开销是多大,还有,有没有更好的量化方案。

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