Skip to content

Conversation

@jeejeelee
Copy link
Collaborator

@jeejeelee jeejeelee commented Feb 27, 2025

The effect is shown as follows:

DeepseekV2ForCausalLM(
  (model): DeepseekV2Model(
    (embed_tokens): VocabParallelEmbedding(num_embeddings=102400, embedding_dim=2048, org_vocab_size=102400, num_embeddings_padded=102400, tp_size=1)
    (layers): ModuleList(
      (0): DeepseekV2DecoderLayer(
        (self_attn): DeepseekV2MLAAttention(
          (q_proj): ColumnParallelLinear(in_features=2048, output_features=3072, bias=False, tp_size=1, gather_output=False)
          (kv_a_proj_with_mqa): ReplicatedLinear(in_features=2048, output_features=576, bias=False)
          (kv_a_layernorm): RMSNorm(hidden_size=512, eps=1e-06)
          (kv_b_proj): ColumnParallelLinear(in_features=512, output_features=4096, bias=False, tp_size=1, gather_output=False)
          (o_proj): RowParallelLinear(input_features=2048, output_features=2048, bias=False, tp_size=1, reduce_results=True)
          (rotary_emb): DeepseekScalingRotaryEmbedding(head_size=64, rotary_dim=64, max_position_embeddings=4096, base=10000, is_neox_style=False)
          (mla_attn): Attention(head_size=512, num_heads=16, num_kv_heads=1, scale=0.1147213867929261, backend=TritonMLAImpl)
        )
        (mlp): DeepseekV2MLP(
          (gate_up_proj): MergedColumnParallelLinear(in_features=2048, output_features=21888, bias=False, tp_size=1, gather_output=False)
          (down_proj): RowParallelLinear(input_features=10944, output_features=2048, bias=False, tp_size=1, reduce_results=True)
          (act_fn): SiluAndMul()
        )
        (input_layernorm): RMSNorm(hidden_size=2048, eps=1e-06)
        (post_attention_layernorm): RMSNorm(hidden_size=2048, eps=1e-06)
      )
      (1-26): 26 x DeepseekV2DecoderLayer(
        (self_attn): DeepseekV2MLAAttention(
          (q_proj): ColumnParallelLinear(in_features=2048, output_features=3072, bias=False, tp_size=1, gather_output=False)
          (kv_a_proj_with_mqa): ReplicatedLinear(in_features=2048, output_features=576, bias=False)
          (kv_a_layernorm): RMSNorm(hidden_size=512, eps=1e-06)
          (kv_b_proj): ColumnParallelLinear(in_features=512, output_features=4096, bias=False, tp_size=1, gather_output=False)
          (o_proj): RowParallelLinear(input_features=2048, output_features=2048, bias=False, tp_size=1, reduce_results=True)
          (rotary_emb): DeepseekScalingRotaryEmbedding(head_size=64, rotary_dim=64, max_position_embeddings=4096, base=10000, is_neox_style=False)
          (mla_attn): Attention(head_size=512, num_heads=16, num_kv_heads=1, scale=0.1147213867929261, backend=TritonMLAImpl)
        )
        (mlp): DeepseekV2MoE(
          (gate): ReplicatedLinear(in_features=2048, output_features=64, bias=False)
          (experts): FusedMoE(
            global_num_experts=64, local_num_experts=64, top_k=6, intermediate_size_per_partition=1408, tp_size=1,
            ep_size=1, reduce_results=False, renormalize=False, use_grouped_topk=True, num_expert_group=1, topk_group=1, scoring_func='softmax', activation='silu'
            (quant_method): UnquantizedFusedMoEMethod()
          )
          (shared_experts): DeepseekV2MLP(
            (gate_up_proj): MergedColumnParallelLinear(in_features=2048, output_features=5632, bias=False, tp_size=1, gather_output=False)
            (down_proj): RowParallelLinear(input_features=2816, output_features=2048, bias=False, tp_size=1, reduce_results=False)
            (act_fn): SiluAndMul()
          )
        )
        (input_layernorm): RMSNorm(hidden_size=2048, eps=1e-06)
        (post_attention_layernorm): RMSNorm(hidden_size=2048, eps=1e-06)
      )
    )
    (norm): RMSNorm(hidden_size=2048, eps=1e-06)
  )
  (lm_head): ParallelLMHead(num_embeddings=102400, embedding_dim=2048, org_vocab_size=102400, num_embeddings_padded=102400, tp_size=1)
  (logits_processor): LogitsProcessor(vocab_size=102400, forg_vocab_size=102400, scale=1.0, logits_as_input=False)
  (sampler): Sampler()
)

Signed-off-by: Jee Jee Li <[email protected]>
@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@jeejeelee jeejeelee requested a review from mgoin February 27, 2025 16:05
@mgoin mgoin added the ready ONLY add when PR is ready to merge/full CI is needed label Feb 27, 2025
@jeejeelee
Copy link
Collaborator Author

@mgoin All tests have passed

Copy link
Member

@mgoin mgoin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jeejeelee!!

@mgoin mgoin merged commit 67fc426 into vllm-project:main Feb 27, 2025
49 checks passed
@jeejeelee jeejeelee deleted the moe-extra-repr branch February 27, 2025 23:57
Akshat-Tripathi pushed a commit to krai/vllm that referenced this pull request Mar 3, 2025
lulmer pushed a commit to lulmer/vllm that referenced this pull request Apr 7, 2025
shreyankg pushed a commit to shreyankg/vllm that referenced this pull request May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants