modelscope / modelscope/ms-swift

Could not import module 'Qwen3_5MoeForConditionalGeneration'

Open
#8,201 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question stale
Dominant language
Python
Stars
15.7k
Forks
1.7k
Avg merge
1d 16h
Merged PRs (30d)
136

Description

Checklist / 检查清单
  • I have searched existing issues, and this is a new question or discussion topic. / 我已经搜索过现有的 issues,确认这是一个新的问题与讨论。
Question Description / 问题描述

环境配置如图:
ms_swift 4.0.0
transformer_engine 2.12.0
transformer_engine_cu12 2.12.0
transformer_engine_torch 2.12.0
transformers 5.2.0
transformers-stream-generator 0.0.5
推理qwen3.5模型报错:
/gemini/envs/qwen/lib/python3.10/site-packages/triton/runtime/jit.py", line 648, in init
src = src[re.search(r"^def\s+\w+\s*(", src, re.MULTILINE).start():]
AttributeError: 'NoneType' object has no attribute 'start'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/gemini/envs/qwen/demo.py", line 3, in
from transformers import AutoProcessor, Qwen3_5MoeForConditionalGeneration
File "/gemini/envs/qwen/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 2132, in getattr
raise ModuleNotFoundError(
ModuleNotFoundError: Could not import module 'Qwen3_5MoeForConditionalGeneration'. Are this object's requirements defined correctly?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the import in demo.py with the listed Python, transformers, ms-swift, and Transformer Engine versions. Trace the Qwen3_5MoeForConditionalGeneration import through the traceback and compare the failing dependency versions; done means the module imports and Qwen3.5 inference starts without the Triton error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.