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

[Bug] state_dict returns wrong path when DMP is as a submodule #2584

Open
JacoCheung opened this issue Nov 22, 2024 · 0 comments
Open

[Bug] state_dict returns wrong path when DMP is as a submodule #2584

JacoCheung opened this issue Nov 22, 2024 · 0 comments

Comments

@JacoCheung
Copy link

JacoCheung commented Nov 22, 2024

Since torchrec register a state_hook. The path of is always prepended a long prefix:

for example, if I have a module structure like

A.B.C.ec = EmbeddingCollection() # A is not DMP wrapped, instead, ec is DMP wrapped.

# then I'll get a state dict key
A.B.C.ec.A.B.C.ec.embeddings.weight

I would like to keep A.B.C.ec.embeddings.weight only. I found the related source code.

For some reason, I have to use DMP as a submodule of the model. Is there any thing I can do?

@JacoCheung JacoCheung changed the title [Bug] state_dict returns wrong path when EC is internally DMP wrapped [Bug] state_dict returns wrong path when DMP is as a submodule Nov 23, 2024
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