InternEvo icon indicating copy to clipboard operation
InternEvo copied to clipboard

fix(mlp): enhance mlp_layer_fusion

Open yingtongxiong opened this issue 11 months ago • 0 comments

Motivation

  1. The mlp_layer_fusion config is useful in MoE; therefore, a warning is added to recommend that users set this config to True in the MoE model.
  2. When testing MoE model, the call of delattr in launch.py will raise the AttributeError even though the attribute exists. Therefore, add the delattr method in Config Class.
  3. Refactor the mlp's forward.

Modification

  1. internlm/core/context/parallel_context.py
  2. internlm/initialize/launch.py
  3. internlm/model/modules/mlp.py

Checklist

Before PR:

  • [x] Pre-commit or other linting tools are used to fix the potential lint issues.

yingtongxiong avatar Dec 03 '24 08:12 yingtongxiong