| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 |
MindSpeed-LLM 测试用例贡献说明
门禁看护列表
| Tests | Module | Structure | Features | Scripts | Acc. | Throu. | Mem. |
|---|---|---|---|---|---|---|---|
| ST | Pretrain | Mcore | TP,PP,VPP,distributed_optimizer,o2_gradient,o2_optimizer,重计算,enable_recompute_layers_per_pp_rank,FA_TND,use_fused_rotary_pos_emb | llama2_tp2_pp4_vpp2_ptd.sh | Y | Y | Y |
| Mcore | TP2D, TP, PP, VPP, distributed_optimizer, fused_swiglu | llama2_tp4pp2vpp2_tp2d_tpx2tpy2.sh | Y | Y | Y | ||
| Mcore | cp_ring,分布式优化器,reuse_fp32_param,recompute_activation_function,fused_rmsnorm,fused_swiglu,fused_rope,overlap_grad_reduce, overlap_param_gather | llama2_tp2_cp4_mem_recompute.sh | Y | Y | Y | ||
| Mcore | moe_alltoall_overlap_comm,moe-zero-memory,swap-attention,reuse_fp32_param,fused_rmsnorm,fused_swiglu | deepseek_500b_tp1_pp2_ep2_cp2_overlap.sh | Y | Y | Y | ||
| Mcore | cp_ring,general_cp,double_ring, 分布式优化器,reuse_fp32_param,recompute_activation_function,fused_rmsnorm,fused_swiglu,fused_rope,overlap_grad_reduce, overlap_param_gather | llama2_tp2_cp4_general_double_ring.sh | Y | Y | Y | ||
| Mcore | n_group,seq_aux, gradient_accumulation_fusion, recompute_mtp_layer, recompute_mtp_norm | deepseek_v3_mcore_tp1_pp2_ep4.sh | Y | Y | Y | ||
| Mcore | pp2vpp,recompute_in_advance,matmul_add | llama3_tp2_pp2_vpp1.sh | Y | Y | Y | ||
| Mcore | cp_hybrid,gqa | chatglm3_gqa_cp8.sh | Y | Y | Y | ||
| Mcore | swap_attention,recompute_activation_function,enable_recompute_layers_per_pp_rank,reuse_fp32_param | llama2_tp2_pp4_vpp2_swap.sh | Y | Y | Y | ||
| Mcore | EP,CP,num_experts,moe_router_topk,aux_loss,moe_allgather,group_query_attention,rotary_base | mixtral_mcore_tp4_cp2_ep2_ptd.sh | Y | Y | Y | ||
| Mcore | mla_attention,moe_grouped_gemm,EP,allgather_dispatcher,moe_allgather_overlap_comm,use_fused_rotary_pos_emb,recompute_norm | deepseek_v2_mcore_tp1_pp1_ep8.sh | Y | Y | Y | ||
| Mcore | MOE,PP,EP,Drop,DPP | mixtral_tp1_pp4_ep2_drop_dpp.sh | Y | Y | Y | ||
| Mcore | shared_experts shared_expert_gate | qwen2_moe_tp1_pp2_ep2_cp2_32k_ptd.sh | Y | Y | Y | ||
| Mcore | noop_layers, recompute_norm | llama3_mcore_tp2_pp2_vpp2_noop_layer.sh | Y | Y | Y | ||
| Legacy | TP,PP,VPP,SP,全重计算,fused_rmsnorm,fused_swiglu,fused_rope,overlap_grad_reduce | llama2_tp2_pp4_vpp2_legacy.sh | Y | Y | Y | ||
| FullSFT | Legacy | prompt_type, variable_seq_lengths, matmul_add | tune_qwen7b_tp8_pp1_full_ptd.sh | Y | Y | Y | |
| Mcore | 自适应cp,general_cp,SFT_pack_cp | tune_llama2_tp2_cp4_adaptive_cp.sh | Y | Y | Y | ||
| LoRA | Legacy | CCLoRA, TP, PP, 全重计算 | tune_llama2_tp2_pp4_lora_ptd.sh | Y | Y | Y | |
| Mcore | CCLoRA, QLoRA | tune_llama2_tp1_pp1_qlora_ptd.sh | Y | Y | Y | ||
| UT | Inference | Legacy | greedy_search, lora_inference, deterministic_computation | test_inference.py | Y | ||
| Evaluation | Legacy | mmlu, prompt_mmlu, qwen2_mmlu, agieval, bbh | test_evaluate.py | Y | |||
| Checkpoint | Mcore | hf2mcore, mcore2hf, TP, PP, EP, DPP, VPP, moe, noop_layers, lora, ORM | test_checkpoint.py | Y | |||
| deepseek2, deepseek2_lite, llama2, llama3, qwen2 | Y | ||||||
| Legacy | hf2legacy, legacy2mcore, TP, PP, DPP | Y | |||||
| llama2 | Y | ||||||
| ProcessData | Mcore | pretrain_data_alpaca, pretrain_merge_datasets, instruction_data_alpaca, instruction_merge_datasets | test_preprocess_data.py | Y |
Pipeline 二级流水看护列表
| Model | Structure | Module | Test Case | Accuracy | Throughput | Memory |
|---|---|---|---|---|---|---|
| CP | Mcore | hybrid | test_hybrid_context_parallel.py | Y | ||
| ring_attn | test_ringattn_context_parallel.py | Y | ||||
| ulysses | test_ulysses_context_parallel.py | Y | ||||
| adaptive | test_adaptive_context_parallel.py | Y | ||||
| ModelModule | Mcore | rope | test_rotary_pos_embedding.py | Y | ||
| moe | test_topk_router.py | Y | ||||
| transformer_attention, alibi | test_attention.py | Y | ||||
| Checkpoint | Mcore | hf2mcore, mcore2hf, TP, PP, EP, DPP, VPP, moe, noop_layers, lora | test_checkpoint.py | Y | ||
| mixtral, deepseek2, deepseek2_lite, gemma2, llama3, qwen2, llama2 | Y | |||||
| Legacy | hf2legacy, legacy2hf, legacy2mcore, TP, PP, DPP | Y | ||||
| llama2 | Y | |||||
| Inference | Legacy | greedy_search, deterministic_computation, chatglm3_inference, baichuan2_inference | test_inference.py | Y | ||
| Evaluation | Legacy | prompt_boolq, prompt_ceval, lora_mmlu, humaneval | test_evaluate.py | Y | ||
| ProcessData | Mcore | instruction_data_alpaca, instruction_data_alpaca_history, instruction_data_sharegpt, instruction_data_openai, | test_process_instruction_data_lf.py | Y | ||
| instruction_data_handler | test_process_instruction_pack_data.py | Y | ||||
| pairwise_data_alpaca, pairwise_data_sharegpt | test_process_pairwise_data_lf.py | Y | ||||
| Baichuan2-13B | Legacy | pretrain | baichuan2_13B_legacy_tp8_pp1_ptd.sh | Y | Y | Y |
| data_process | test_process_pretrain_data.py | Y | ||||
| ckpt_hf2mg | test_ckpt_hf2mg.py | Y | ||||
| inference | test_generation.py | Y | ||||
| evaluation | test_evaluation.py | Y | ||||
| Mcore | pretrain | baichuan2_13b_tp8_pp1_mcore.sh | Y | Y | Y | |
| Chatglm3-6B | Legacy | pretrain | chatglm3_6B_legacy_tp1_pp2_ptd.sh | Y | Y | Y |
| convert_ckpt | test_checkpoint.py | Y | ||||
| data_process | test_process_pretrain_data.py | Y | ||||
| inference | test_generation.py | Y | ||||
| evaluation | test_evaluation.py | Y | ||||
| Mcore | pretrain | chatglm3_tp1_pp2_rope.sh | Y | Y | Y | |
| Bloom-7B | Legacy | pretrain | bloom_7B_legacy_tp8_pp1_ptd.sh | Y | Y | Y |
| data_process | test_process_pretrain_data.py | Y | ||||
| inference | test_generation.py | Y | ||||
| evaluation | test_evaluation.py | Y | ||||
| Gemma-7B | Legacy | pretrain | gemma_7B_legacy_tp8_pp1_ptd.sh | Y | Y | Y |
| data_process | test_process_pretrain_data.py | Y | ||||
| inference | test_generation.py | Y | ||||
| evaluation | test_evaluation.py | Y | ||||
| Mcore | pretrain | gemma2_tp8_pp1_ptd.sh | Y | Y | Y | |
| Qwen15-7B | Legacy | pretrain | qwen15_7B_legacy_tp8_pp1_ptd.sh | Y | Y | Y |
| data_process | test_process_pretrain_data.py | Y | ||||
| inference | test_generation.py | Y | ||||
| evaluation | test_evaluation.py | Y | ||||
| GPT4 | Mcore | pretrain | gpt4_mcore_tp4_cp2_32k_moe_drop.sh | Y | Y | Y |
| Deepseek | Mcore | pretrain | deepseek2_tp1_pp1_mcore_moe.sh | Y | Y | Y |
| Deepseek_lite | Mcore | convert_ckpt | test_deepseek_lite_ckpt_optim.py | Y | ||
| Mixtral | Mcore | pretrain | mixtral_tp1_pp4_ep2_drop_mcore.sh | Y | Y | Y |
| LoRA | tune_mixtral_tp2_pp2_lora_ptd.sh | Y | Y | Y | ||
| Llama2 | Legacy | LoRA | tune_llama2_tp1_pp1_lora_ptd.sh | Y | Y | Y |
| Mcore | FullSFT | tune_llama2_tp2_pp4_vpp2_mcore_full.sh | Y | Y | Y | |
| pretrain | llama2_tp8_pp1_coc_ptd.sh | Y | Y | Y | ||
| convert_ckpt | test_llama2_7b_ckpt_optim.py | Y | ||||
| pretrain | llama2_tp1_pp8_patch_gloo_ptd.sh | Y | Y | Y | ||
| Phi-3.5-MoE-instruct | Mcore | pretrain | phi35_moe_tp1_pp8_mcore.sh | Y | Y | Y |
| data_process | test_process_pretrain_data.py | Y | ||||
| ckpt_hf2mg | test_ckpt_hf2mg.py | Y | ||||
| inference | test_generation.py | Y | ||||
| evaluation | test_evaluation.py | Y | ||||
| DPO | Mcore | DPO, CCLoRA, TP, PP, CP, MOE, use_fused_moe_token_permute_and_unpermute | dpo_lora_mixtral_8x7b_ptd_tp2pp1ep2cp2.sh | Y | Y | Y |
| DPO, TP, PP, CP, VPP, fused_rmsnorm, fused_swiglu, fused_rope | dpo_full_llama3_8b_ptd_tp2pp2vpp2cp2.sh | Y | Y | Y | ||
| DPO, PP, EP, CP, VPP, distributed_optimizer, used_rmsnorm,fused_swiglu, fused_rope,overlap_grad_reduce, overlap_param_gather | dpo_full_mixtral_8x7b_ptd_tp1pp2vpp2ep2cp2.sh | Y | Y | Y | ||
| Grpo | Mcore | GRPO, tp, pp | ray_grpo_full_llama32_1b_tp1pp1.sh | Y | ||
| Online_DPO | Mcore | Online_DPO, tp, pp | ray_online_dpo_full_llama32_1b_tp1pp1.sh | Y | ||
| Ray_PPO | Mcore | PPO, tp, pp | ray_ppo_full_llama32_1b_tp1pp1.sh | Y | ||
| Trl_PPO | Mcore | PPO, CCLoRA, TP, PP | trl_ppo_llama32_1b_ptd_tp2pp2.sh | Y | Y | |
| OutcomeRewardModel | Mcore | prompt_type, variable_seq_lengths | train_orm_chatglm3_tp2_pp4_full.sh | Y | Y | Y |
| Mcore | TP, PP, CP, EP, distributed_optimizer, 全重计算 | train_orm_mixtral_tp2_pp2_cp2_ep2.sh | Y | Y | Y | |
| Mcore | PP, VPP, DP, recompute-activation-function | train_orm_llama2_7b_pp2_vpp2_dp2.sh | Y | Y | Y | |
| ProcessRewardModel | Mcore | TP, PP, variable_seq_lengths | train_prm_llama2_tp1_pp8_full_ptd.sh | Y | Y | Y |
DT覆盖率看护
在NPU机器运行 run_coverage.sh 脚本,运行目录将生成 htmlcov 文件夹,将该文件夹复制到本地电脑,在浏览器中打开 htmlcov/index.html 文件,可以看到覆盖率信息。
脚本中 branch 的值改为 True ,可以测试分支覆盖率。
开发规则
ST
① 贡献脚本用例请放置于 st/shell_scripts 文件夹下,命名规则为 {模型名}_{切分策略} 或者 {模型名}_{特性名称}, 如 llama2_tp2_pp4_vpp2_ptd.sh,请贡献者严格对齐;
② 注意脚本用例中不需要单独重定向log,日志收集工作已在 st_run.sh 中统一管理;
③ 标杆数据请放置于 st/baseline_results 文件夹下,命名保证完全与 shell 脚本对齐,否则自动化脚本执行将扫描不到;
④ 获取标杆数据:通过门禁任务执行获得首次数据,并将结果保存至本地 log 或者 txt 文件中,后通过本地执行 st/st_utils/common.py 中的 transfer_logs_as_json 函数进行提取,最后再连同用例脚本上仓即可;
⑤ 在贡献时候需要考虑最终校验的具体指标,精度(Acc.)、性能(Throu.)、显存(Mem.),在对应指标空白处填上 Y,如无校验的保留空白即可。
UT
① 建议所有 UT 用例通过分布式 pytest 来拉起,即继承 tests/common.py 文件下的 DistributedTest,指定 world_size,具体参照已有用例即可;
② 建议按照功能特性进行文件夹命名区分,至多不超过两层目录,所有用例以 test 作为命名前缀;
③ 新增用例可以在原有用例基础上做 test_xxx 的补充,尽量保证测试功能的集成性;对于存在 .json 文件的用例,贡献时在 .json 中加入 test_xxx 配置,然后在 .py 中通过 @pytest.mark.parameterize 传入参数、构造用例,请注意 .json 中的 key 值命名需与 .py 中的 test_xxx 保持统一;
④ 在贡献时候需要考虑最终校验的具体指标,精度(Acc.)、性能(Throu.)、显存(Mem.),在对应指标空白处填上 Y,如无校验的保留空白即可。
Pipeline
①贡献脚本用例放置于pipeline/的对应模型文件夹下,如baichuan2-13B,文件命名规则为 {模型名}{切分策略} 或者 {模型名}{特性名称}, 如 baichuan2_13B_tp8_pp1_ptd.sh,请贡献者严格对齐;
② 注意脚本用例中不需要单独重定向log,日志收集工作已在 pipe_run.sh 中进行统一管理;
③ 标杆数据请放置于 pipeline/baseline 文件夹下,命名保证完全与 shell 脚本对齐,否则自动化脚本执行将扫描不到;
④ 获取标杆数据:通过门禁任务执行获得首次数据,并将结果保存至本地 log 或者 txt 文件中,后通过本地执行 tests/st/st_utils/common.py 中的 transfer_logs_as_json 函数进行提取,最后再连同用例脚本上仓即可;
⑤ 在贡献时候需要考虑最终校验的具体指标,精度(Acc.)、性能(Throu.)、显存(Mem.),在对应指标空白处填上 Y,如无校验的保留空白即可。