Usage of nn.Identity #2918
Andrei-Aksionov
started this conversation in
General
Replies: 1 comment 1 reply
-
|
I think the reason is because distributed checkpointing and Pipeline Parallel composability. In current way, there's no ambiguity in state dict of model across multiple PP ranks. If using |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A quick question (and here I rely on your expertise, since I don't have one regarding to using many-many GPUs).
Here:
torchtitan/torchtitan/models/common/decoder.py
Lines 124 to 138 in 3c81104
Why not assign
nn.Identityin the init method instead?so the forward function will look like:
Yes, it looks cleaner. But this is not the main point.
With it we can drop if statements and thus reduce code branching.
In theory, without code branching:
torch.compileshould have an easier lifeBut I have a very strong feeling that there is a clear reason why
nn.Identityis not used.I just don't see it.
Beta Was this translation helpful? Give feedback.
All reactions