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

broadcast_tensor in core_vq.py for multi_gpu training #24

Open
mindmapper15 opened this issue Nov 12, 2024 · 0 comments
Open

broadcast_tensor in core_vq.py for multi_gpu training #24

mindmapper15 opened this issue Nov 12, 2024 · 0 comments

Comments

@mindmapper15
Copy link

def init_embed_(self, data):
if self.inited:
return
embed, cluster_size = kmeans(data, self.codebook_size, self.kmeans_iters)
self.embed.data.copy_(embed)
self.embed_avg.data.copy_(embed.clone())
self.cluster_size.data.copy_(cluster_size)
self.inited.data.copy_(torch.Tensor([True]))
# Make sure all buffers across workers are in sync after initialization
#broadcast_tensors(self.buffers())

In core_vq.py, broadcasting tensor function is commented, which is different from the original code facebookresearch/encodec

According to the original author of encodec, this broadcasting seems to required for multi-gpu training.
Have you been tested and compared the encodec model trained w/ or w/o broadcasting function?

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

1 participant