Repository navigation
Introduce GDN to Mamba #3535
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
Introduce GDN to Mamba #3535
Changes from 18 commits
acc49e7
2fb3d8d
a2cfc0e
4057f9c
6b9a8f7
699d6ca
9676905
2735952
7487e4f
28fb4e9
bb3d3ca
ba1f00d
44f34b0
3912e10
e037c2e
0fba364
7909fb1
0f6cddd
3486735
848bcd2
a48b54f
133ce82
bd9317e
5a5e206
cb665a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,7 @@ class MambaStackSubmodules: | |
| """ | ||
|
|
||
| mamba_layer: Union[ModuleSpec, type] = IdentityOp | ||
| gdn_layer: Union[ModuleSpec, type] = IdentityOp | ||
| attention_layer: Union[ModuleSpec, type] = IdentityOp | ||
| mlp_layer: Union[ModuleSpec, type] = IdentityOp | ||
| moe_layer: Union[ModuleSpec, type] = IdentityOp | ||
|
|
@@ -150,6 +151,15 @@ def __init__( | |
| pg_collection=pg_collection, | ||
| add_layer_offset=False, | ||
| ) | ||
| elif layer_type == LayerSymbols.GDN: | ||
| layer = build_module( | ||
| submodules.gdn_layer, | ||
| config=self.config, | ||
| layer_number=layer_number, | ||
| pg_collection=pg_collection, | ||
| # Set to False as we do not want to change offset. | ||
| add_layer_offset=False, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at the current GDN implementation in main, it doesn't seem to add its own pp_layer_offset like the attention layers do. I wonder if this is because it doesn't currently support pipeline parallel via the GPTModel. If it's not adding its own pp_layer_offset, then it doesn't need to be told not to when the HLModel passes a layer_number containing the pp_layer_offset it already calculated.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pp_layer_offset is not needed for GDN (for now).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code should be moved up under mamba. Sounds like add_layer_offset is not needed, because the GDN layer does not currently add its own pp_layer_offset. So perhaps add_layer_offset should not be included here.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe we should be setting |
||
| ) | ||
|
Phlip79 marked this conversation as resolved.
Resolved
|
||
| else: | ||
| assert False, "unexpected layer_type" | ||
| self.layers.append(layer) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.