登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
轻量养虾,开箱即用!低 Token + 稳定算力,Gitee & 模力方舟联合出品的 PocketClaw 正式开售!点击了解详情~
代码拉取完成,页面将自动刷新
仓库状态说明
开源项目
>
人工智能
>
大模型
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
42
Star
397
Fork
241
Ascend
/
MindSpeed-MM
暂停
代码
Issues
2
Pull Requests
24
Wiki
统计
流水线
服务
JavaDoc
PHPDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
开发画像分析
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
Qwen2.5vl 3b 推理报错
DONE
#IC9RUK
缺陷
彭帆
创建于
2025-05-22 16:50
一、问题现象(附报错日志上下文): 按照 inference_qwen2_5_vl_7b.json和inference_qwen2_5_vl_7b.sh对脚本进行了修改,用于3b模型的推理 inference_qwen2_5_vl_3b.json ``` { "pipeline_class": "Qwen2VlPipeline", "img_context_token_id": 151655, "image_encoder": { "vision_encoder": { "model_id": "qwen2vit", "num_layers": 32, "hidden_size": 1280, "ffn_hidden_size": 3420, "gated_linear_unit": true, "llm_hidden_size": 1280, "num_attention_heads": 16, "hidden_dropout": 0.0, "attention_dropout": 0.0, "in_channels": 3, "patch_size": 14, "spatial_merge_size": 2, "temporal_patch_size": 2, "layernorm_epsilon": 1e-06, "normalization": "RMSNorm", "fp16": false, "bf16": true, "params_dtype": "bf16", "activation_func": "silu", "freeze": true, "use_fused_rotary_pos_emb": true, "post_layer_norm": false, "pipeline_num_layers": [32], "intermediate_size": 3420, "tokens_per_second": 2, "window_attn_size": 112, "fullatt_block_indexes": [ 7, 15, 23, 31 ] }, "vision_projector": { "model_id": "lnmlp", "num_layers": 1, "num_attention_heads": 1, "gated_linear_unit": false, "bias_activation_fusion": false, "add_bias_linear": true, "input_size": 1280, "hidden_size": 2048, "ffn_hidden_size": 5120, "activation_func": "gelu", "bf16": true, "params_dtype": "bf16", "freeze": true, "layernorm_epsilon": 1e-06, "normalization": "RMSNorm" } }, "text_decoder": { "model_id": "qwen2_5_lm", "num_layers": 36, "pipeline_num_layers": [36], "hidden_size": 2048, "ffn_hidden_size": 11008, "num_attention_heads": 16, "max_position_embeddings": 128000, "vocab_size": 151936, "rope_theta": 1000000.0, "untie_embeddings_and_output_weights": true, "disable_bias_linear": true, "attention_dropout": 0.0, "init_method_std": 0.01, "hidden_dropout": 0.0, "position_embedding_type": "mrope", "normalization": "RMSNorm", "activation_func": "silu", "use_fused_rotary_pos_emb": true, "attention_softmax_in_fp32": true, "params_dtype": "bf16", "bf16": true, "parallel_output": false, "group_query_attention": true, "num_query_groups": 2, "mrope_section": [16, 24, 24], "rope_scaling": null, "gated_linear_unit": true, "layernorm_epsilon": 1e-06, "add_bias_linear":false, "add_qkv_bias": true, "sequence_parallel": false, "tokenizer_type": "PretrainedFromHF", "is_encoder_decoder": false }, "text_encoder": null, "video_encoder": null, "dtype": "bf16", "device": "npu", "tokenizer": { "hub_backend": "hf", "autotokenizer_name": "AutoTokenizer", "from_pretrained": "/root/autodl-tmp/ckpt/hf_path/Qwen2.5-VL-3B-Instruct" }, "generation_config": { "bos_token_id": 151643, "do_sample": true, "kv_cache":true, "output_attentions": false, "output_hidden_states": false, "max_length": 20, "min_length": 0, "min_new_tokens": null, "constraints": null, "prompt_lookup_num_tokens": null, "guidance_scale": null, "bad_words_ids": null, "begin_suppress_tokens": null, "diversity_penalty": 0.0, "early_stopping": false, "encoder_no_repeat_ngram_size": 0, "encoder_repetition_penalty": 1.0, "epsilon_cutoff": 0.0, "eta_cutoff": 0.0, "exponential_decay_length_penalty": null, "forced_bos_token_id": null, "forced_decoder_ids": null, "forced_eos_token_id": null, "length_penalty": 1.0, "low_memory": null, "max_time": null, "no_repeat_ngram_size": 0, "num_assistant_tokens": 5, "num_assistant_tokens_schedule": "heuristic", "num_beam_groups": 1, "num_return_groups": 1, "num_return_sequences": 1, "output_scores": false, "output_logits": null, "penalty_alpha": null, "remove_invalid_values": false, "repetition_penalty": 1.05, "return_dict_in_generate": false, "sequence_bias": null, "suppress_tokens": null, "typical_p": 1.0, "force_words_ids": null, "num_beams": 1, "renormalize_logits": false, "use_cache": true, "eos_token_id": [ 151645, 151643 ], "max_new_tokens": 256, "pad_token_id": 151643, "vision_start_token_id": 151652, "image_token_id": 151655, "video_token_id": 151656, "temperature": 0.1, "top_k": 1, "top_p": 0.001, "dola_layers": null, "cache_implementation": null, "cache_config": null, "return_legacy_cache": null, "min_p": null, "token_healing": false, "watermarking_config": null, "decoder_start_token_id": null, "max_matching_ngram_size": null, "stop_strings": null }, "min_pixels": 1003520, "max_pixels": 12845056, "image_path": "examples/qwen2vl/demo.jpeg", "prompts": "Describe this image and keep it within 100 words." } ``` inference_qwen2_5_vl_3b.sh ``` #!/bin/bash source /usr/local/Ascend/ascend-toolkit/set_env.sh # 该变量只用于规避megatron对其校验,对npu无效 export CUDA_DEVICE_MAX_CONNECTIONS=1 export ASCEND_SLOG_PRINT_TO_STDOUT=0 export ASCEND_GLOBAL_LOG_LEVEL=3 export TASK_QUEUE_ENABLE=2 export COMBINED_ENABLE=1 export CPU_AFFINITY_CONF=1 export HCCL_CONNECT_TIMEOUT=1200 export NPU_ASD_ENABLE=0 export ACLNN_CACHE_LIMIT=100000 export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True NPUS_PER_NODE=1 MASTER_ADDR=localhost MASTER_PORT=6000 NNODES=1 NODE_RANK=0 WORLD_SIZE=$(($NPUS_PER_NODE*$NNODES)) MM_MODEL="./examples/qwen2.5vl/inference_qwen2_5_vl_3b.json" LOAD_PATH="ckpt/mm_path/Qwen2.5-VL-3B-Instruct" TP=1 PP=1 CP=1 MBS=1 GRAD_ACC_STEP=1 DP=$(($WORLD_SIZE/$TP/$PP/$CP)) GBS=$(($MBS*$GRAD_ACC_STEP*$DP)) DISTRIBUTED_ARGS=" --nproc_per_node $NPUS_PER_NODE \ --nnodes $NNODES \ --node_rank $NODE_RANK \ --master_addr $MASTER_ADDR \ --master_port $MASTER_PORT " GPT_ARGS=" --use-mcore-models \ --tensor-model-parallel-size ${TP} \ --pipeline-model-parallel-size ${PP} \ --micro-batch-size ${MBS} \ --global-batch-size ${GBS} \ --tokenizer-type NullTokenizer \ --vocab-size 152064 \ --seq-length 1024 \ --make-vocab-size-divisible-by 1 \ --normalization RMSNorm \ --use-fused-rmsnorm \ --swiglu \ --use-fused-swiglu \ --seed 42 \ --bf16 \ --load $LOAD_PATH \ --variable-seq-lengths \ --use-flash-attn \ --no-load-optim \ --no-load-rng " MM_ARGS=" --mm-model $MM_MODEL " OUTPUT_ARGS=" --log-interval 1 \ --save-interval 10000 \ --eval-interval 10000 \ --eval-iters 5000 \ " torchrun $DISTRIBUTED_ARGS inference_vlm.py \ $GPT_ARGS \ $MM_ARGS \ $OUTPUT_ARGS \ --distributed-backend nccl ``` bash examples/qwen2.5vl/inference_qwen2_5_vl_3b.sh 报错信息: ``` building VLMModel ... > number of parameters on (tensor, pipeline) model parallel rank (0, 0): 4065787904 loading release checkpoint from ckpt/mm_path/Qwen2.5-VL-3B-Instruct could not find arguments in the checkpoint ... Traceback (most recent call last): File "/root/MindSpeed-MM/inference_vlm.py", line 29, in <module> main() File "/root/MindSpeed-MM/inference_vlm.py", line 25, in main vlm_pipeline_dict[inference_config.pipeline_class](inference_config)() File "/root/MindSpeed-MM/mindspeed_mm/tasks/inference/pipeline/qwen2vl_pipeline.py", line 23, in __init__ self.model = ParallelWrapper(model_provider) File "/root/MindSpeed-MM/mindspeed_mm/tasks/inference/pipeline/parallel_wrapper.py", line 38, in __init__ load_checkpoint(model, None, None, 'load') File "/root/MindSpeed-MM/megatron/training/checkpointing.py", line 839, in load_checkpoint model[0].load_state_dict(state_dict['model'], strict=strict) File "/root/miniconda3/envs/myenv1/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2152, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for VLMModel: Missing key(s) in state_dict: "text_decoder.output_layer.weight". [ERROR] 2025-05-22-14:55:10 (PID:8278, Device:0, RankID:-1) ERR99999 UNKNOWN application exception [2025-05-22 14:55:17,038] torch.distributed.elastic.multiprocessing.api: [ERROR] failed (exitcode: 1) local_rank: 0 (pid: 8278) of binary: /root/miniconda3/envs/myenv1/bin/python3.10 Traceback (most recent call last): File "/root/miniconda3/envs/myenv1/bin/torchrun", line 8, in <module> sys.exit(main()) File "/root/miniconda3/envs/myenv1/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper return f(*args, **kwargs) File "/root/miniconda3/envs/myenv1/lib/python3.10/site-packages/torch/distributed/run.py", line 806, in main run(args) File "/root/miniconda3/envs/myenv1/lib/python3.10/site-packages/torch/distributed/run.py", line 797, in run elastic_launch( File "/root/miniconda3/envs/myenv1/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 134, in __call__ return launch_agent(self._config, self._entrypoint, list(args)) File "/root/miniconda3/envs/myenv1/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 264, in launch_agent raise ChildFailedError( torch.distributed.elastic.multiprocessing.errors.ChildFailedError: ============================================================ inference_vlm.py FAILED ------------------------------------------------------------ Failures: <NO_OTHER_FAILURES> ------------------------------------------------------------ Root Cause (first observed failure): [0]: time : 2025-05-22_14:55:17 host : autodl-container-c86d4c9b52-22e5566c rank : 0 (local_rank: 0) exitcode : 1 (pid: 8278) error_file: <N/A> traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html ============================================================ ```
一、问题现象(附报错日志上下文): 按照 inference_qwen2_5_vl_7b.json和inference_qwen2_5_vl_7b.sh对脚本进行了修改,用于3b模型的推理 inference_qwen2_5_vl_3b.json ``` { "pipeline_class": "Qwen2VlPipeline", "img_context_token_id": 151655, "image_encoder": { "vision_encoder": { "model_id": "qwen2vit", "num_layers": 32, "hidden_size": 1280, "ffn_hidden_size": 3420, "gated_linear_unit": true, "llm_hidden_size": 1280, "num_attention_heads": 16, "hidden_dropout": 0.0, "attention_dropout": 0.0, "in_channels": 3, "patch_size": 14, "spatial_merge_size": 2, "temporal_patch_size": 2, "layernorm_epsilon": 1e-06, "normalization": "RMSNorm", "fp16": false, "bf16": true, "params_dtype": "bf16", "activation_func": "silu", "freeze": true, "use_fused_rotary_pos_emb": true, "post_layer_norm": false, "pipeline_num_layers": [32], "intermediate_size": 3420, "tokens_per_second": 2, "window_attn_size": 112, "fullatt_block_indexes": [ 7, 15, 23, 31 ] }, "vision_projector": { "model_id": "lnmlp", "num_layers": 1, "num_attention_heads": 1, "gated_linear_unit": false, "bias_activation_fusion": false, "add_bias_linear": true, "input_size": 1280, "hidden_size": 2048, "ffn_hidden_size": 5120, "activation_func": "gelu", "bf16": true, "params_dtype": "bf16", "freeze": true, "layernorm_epsilon": 1e-06, "normalization": "RMSNorm" } }, "text_decoder": { "model_id": "qwen2_5_lm", "num_layers": 36, "pipeline_num_layers": [36], "hidden_size": 2048, "ffn_hidden_size": 11008, "num_attention_heads": 16, "max_position_embeddings": 128000, "vocab_size": 151936, "rope_theta": 1000000.0, "untie_embeddings_and_output_weights": true, "disable_bias_linear": true, "attention_dropout": 0.0, "init_method_std": 0.01, "hidden_dropout": 0.0, "position_embedding_type": "mrope", "normalization": "RMSNorm", "activation_func": "silu", "use_fused_rotary_pos_emb": true, "attention_softmax_in_fp32": true, "params_dtype": "bf16", "bf16": true, "parallel_output": false, "group_query_attention": true, "num_query_groups": 2, "mrope_section": [16, 24, 24], "rope_scaling": null, "gated_linear_unit": true, "layernorm_epsilon": 1e-06, "add_bias_linear":false, "add_qkv_bias": true, "sequence_parallel": false, "tokenizer_type": "PretrainedFromHF", "is_encoder_decoder": false }, "text_encoder": null, "video_encoder": null, "dtype": "bf16", "device": "npu", "tokenizer": { "hub_backend": "hf", "autotokenizer_name": "AutoTokenizer", "from_pretrained": "/root/autodl-tmp/ckpt/hf_path/Qwen2.5-VL-3B-Instruct" }, "generation_config": { "bos_token_id": 151643, "do_sample": true, "kv_cache":true, "output_attentions": false, "output_hidden_states": false, "max_length": 20, "min_length": 0, "min_new_tokens": null, "constraints": null, "prompt_lookup_num_tokens": null, "guidance_scale": null, "bad_words_ids": null, "begin_suppress_tokens": null, "diversity_penalty": 0.0, "early_stopping": false, "encoder_no_repeat_ngram_size": 0, "encoder_repetition_penalty": 1.0, "epsilon_cutoff": 0.0, "eta_cutoff": 0.0, "exponential_decay_length_penalty": null, "forced_bos_token_id": null, "forced_decoder_ids": null, "forced_eos_token_id": null, "length_penalty": 1.0, "low_memory": null, "max_time": null, "no_repeat_ngram_size": 0, "num_assistant_tokens": 5, "num_assistant_tokens_schedule": "heuristic", "num_beam_groups": 1, "num_return_groups": 1, "num_return_sequences": 1, "output_scores": false, "output_logits": null, "penalty_alpha": null, "remove_invalid_values": false, "repetition_penalty": 1.05, "return_dict_in_generate": false, "sequence_bias": null, "suppress_tokens": null, "typical_p": 1.0, "force_words_ids": null, "num_beams": 1, "renormalize_logits": false, "use_cache": true, "eos_token_id": [ 151645, 151643 ], "max_new_tokens": 256, "pad_token_id": 151643, "vision_start_token_id": 151652, "image_token_id": 151655, "video_token_id": 151656, "temperature": 0.1, "top_k": 1, "top_p": 0.001, "dola_layers": null, "cache_implementation": null, "cache_config": null, "return_legacy_cache": null, "min_p": null, "token_healing": false, "watermarking_config": null, "decoder_start_token_id": null, "max_matching_ngram_size": null, "stop_strings": null }, "min_pixels": 1003520, "max_pixels": 12845056, "image_path": "examples/qwen2vl/demo.jpeg", "prompts": "Describe this image and keep it within 100 words." } ``` inference_qwen2_5_vl_3b.sh ``` #!/bin/bash source /usr/local/Ascend/ascend-toolkit/set_env.sh # 该变量只用于规避megatron对其校验,对npu无效 export CUDA_DEVICE_MAX_CONNECTIONS=1 export ASCEND_SLOG_PRINT_TO_STDOUT=0 export ASCEND_GLOBAL_LOG_LEVEL=3 export TASK_QUEUE_ENABLE=2 export COMBINED_ENABLE=1 export CPU_AFFINITY_CONF=1 export HCCL_CONNECT_TIMEOUT=1200 export NPU_ASD_ENABLE=0 export ACLNN_CACHE_LIMIT=100000 export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True NPUS_PER_NODE=1 MASTER_ADDR=localhost MASTER_PORT=6000 NNODES=1 NODE_RANK=0 WORLD_SIZE=$(($NPUS_PER_NODE*$NNODES)) MM_MODEL="./examples/qwen2.5vl/inference_qwen2_5_vl_3b.json" LOAD_PATH="ckpt/mm_path/Qwen2.5-VL-3B-Instruct" TP=1 PP=1 CP=1 MBS=1 GRAD_ACC_STEP=1 DP=$(($WORLD_SIZE/$TP/$PP/$CP)) GBS=$(($MBS*$GRAD_ACC_STEP*$DP)) DISTRIBUTED_ARGS=" --nproc_per_node $NPUS_PER_NODE \ --nnodes $NNODES \ --node_rank $NODE_RANK \ --master_addr $MASTER_ADDR \ --master_port $MASTER_PORT " GPT_ARGS=" --use-mcore-models \ --tensor-model-parallel-size ${TP} \ --pipeline-model-parallel-size ${PP} \ --micro-batch-size ${MBS} \ --global-batch-size ${GBS} \ --tokenizer-type NullTokenizer \ --vocab-size 152064 \ --seq-length 1024 \ --make-vocab-size-divisible-by 1 \ --normalization RMSNorm \ --use-fused-rmsnorm \ --swiglu \ --use-fused-swiglu \ --seed 42 \ --bf16 \ --load $LOAD_PATH \ --variable-seq-lengths \ --use-flash-attn \ --no-load-optim \ --no-load-rng " MM_ARGS=" --mm-model $MM_MODEL " OUTPUT_ARGS=" --log-interval 1 \ --save-interval 10000 \ --eval-interval 10000 \ --eval-iters 5000 \ " torchrun $DISTRIBUTED_ARGS inference_vlm.py \ $GPT_ARGS \ $MM_ARGS \ $OUTPUT_ARGS \ --distributed-backend nccl ``` bash examples/qwen2.5vl/inference_qwen2_5_vl_3b.sh 报错信息: ``` building VLMModel ... > number of parameters on (tensor, pipeline) model parallel rank (0, 0): 4065787904 loading release checkpoint from ckpt/mm_path/Qwen2.5-VL-3B-Instruct could not find arguments in the checkpoint ... Traceback (most recent call last): File "/root/MindSpeed-MM/inference_vlm.py", line 29, in <module> main() File "/root/MindSpeed-MM/inference_vlm.py", line 25, in main vlm_pipeline_dict[inference_config.pipeline_class](inference_config)() File "/root/MindSpeed-MM/mindspeed_mm/tasks/inference/pipeline/qwen2vl_pipeline.py", line 23, in __init__ self.model = ParallelWrapper(model_provider) File "/root/MindSpeed-MM/mindspeed_mm/tasks/inference/pipeline/parallel_wrapper.py", line 38, in __init__ load_checkpoint(model, None, None, 'load') File "/root/MindSpeed-MM/megatron/training/checkpointing.py", line 839, in load_checkpoint model[0].load_state_dict(state_dict['model'], strict=strict) File "/root/miniconda3/envs/myenv1/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2152, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for VLMModel: Missing key(s) in state_dict: "text_decoder.output_layer.weight". [ERROR] 2025-05-22-14:55:10 (PID:8278, Device:0, RankID:-1) ERR99999 UNKNOWN application exception [2025-05-22 14:55:17,038] torch.distributed.elastic.multiprocessing.api: [ERROR] failed (exitcode: 1) local_rank: 0 (pid: 8278) of binary: /root/miniconda3/envs/myenv1/bin/python3.10 Traceback (most recent call last): File "/root/miniconda3/envs/myenv1/bin/torchrun", line 8, in <module> sys.exit(main()) File "/root/miniconda3/envs/myenv1/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper return f(*args, **kwargs) File "/root/miniconda3/envs/myenv1/lib/python3.10/site-packages/torch/distributed/run.py", line 806, in main run(args) File "/root/miniconda3/envs/myenv1/lib/python3.10/site-packages/torch/distributed/run.py", line 797, in run elastic_launch( File "/root/miniconda3/envs/myenv1/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 134, in __call__ return launch_agent(self._config, self._entrypoint, list(args)) File "/root/miniconda3/envs/myenv1/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 264, in launch_agent raise ChildFailedError( torch.distributed.elastic.multiprocessing.errors.ChildFailedError: ============================================================ inference_vlm.py FAILED ------------------------------------------------------------ Failures: <NO_OTHER_FAILURES> ------------------------------------------------------------ Root Cause (first observed failure): [0]: time : 2025-05-22_14:55:17 host : autodl-container-c86d4c9b52-22e5566c rank : 0 (local_rank: 0) exitcode : 1 (pid: 8278) error_file: <N/A> traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html ============================================================ ```
评论 (
5
)
登录
后才可以发表评论
状态
DONE
TODO
WIP
DONE
CLOSED
REJECTED
负责人
未设置
标签
未设置
项目
未立项任务
未立项任务
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (
-
)
标签 (
-
)
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
预计工期
(小时)
参与者(4)
1
https://gitee.com/ascend/MindSpeed-MM.git
git@gitee.com:ascend/MindSpeed-MM.git
ascend
MindSpeed-MM
MindSpeed-MM
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册