feat(megatron): Add support for Gated Delta Net (GDN) & Kimi Delta Attention (KDA)#676
Draft
clairesonglee wants to merge 20 commits intomainfrom
Draft
feat(megatron): Add support for Gated Delta Net (GDN) & Kimi Delta Attention (KDA)#676clairesonglee wants to merge 20 commits intomainfrom
clairesonglee wants to merge 20 commits intomainfrom
Conversation
Comment on lines
+121
to
+122
| # try: | ||
| # user = input("User> ").strip() |
Comment on lines
+127
to
+134
| # if not user: | ||
| # continue | ||
| # if user == "/exit": | ||
| # return | ||
| # if user == "/reset": | ||
| # history.clear() | ||
| # print("[Info] History cleared.\n") | ||
| # continue |
Comment on lines
+120
to
+123
| # if 'layer_norm_weight' in new_key: | ||
| # new_key = new_key.replace('layer_norm_weight', 'weight') | ||
| # if 'layer_norm_bias' in new_key: | ||
| # new_key = new_key.replace('layer_norm_bias', 'bias') |
|
|
||
| # Ensure that the tensor passed between pipeline parallel stages is | ||
| # viewless. See related notes in TransformerBlock and TransformerLayer | ||
| output = make_viewless_tensor( |
| ): | ||
| # no cache support | ||
| _ = past_key_value | ||
| use_cache = False |
| ): | ||
| # No KV cache support for now. | ||
| _ = past_key_value | ||
| use_cache = False |
| ): | ||
| # No cache support | ||
| _ = past_key_values | ||
| use_cache = False |
|
|
||
| import argparse | ||
| import json | ||
| import os |
| from megatron.core.inference.contexts import BaseInferenceContext | ||
| from megatron.core.process_groups_config import ProcessGroupCollection | ||
| from megatron.core.ssm.mamba_hybrid_layer_allocation import Symbols as LayerSymbols | ||
| from megatron.core.ssm.mamba_hybrid_layer_allocation import allocate_layers |
| from megatron.core.transformer.identity_op import IdentityOp | ||
| from megatron.core.fusions.fused_bias_dropout import get_bias_dropout_add | ||
| from megatron.core.models.gpt.moe_module_specs import get_moe_module_spec | ||
| from megatron.core.ssm.mamba_block import MambaStack, MambaStackSubmodules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.