mindspore-ai / mindspore-ai/hyper-parallel

[Bug]: cannot import name 'is_torchdynamo_compiling' from 'transformers.models.qwen3_vl_moe.modeling_qwen3_vl_moe'

Open
#213 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
53
Forks
63
Avg merge
23h 45m
Merged PRs (30d)
63

Description

Checklist
  • 1. I have searched the existing issues (https://gitcode.com/mindspore/hyper-parallel/issues)
  • 2. I have read the relevant documentation.
  • 3. I have created a minimal reproduction case that clearly demonstrates the issue, including a complete code example and the error message with full traceback and error logs.
🐛 Describe the bug

[rank1]: File "/home/user/git/LlamaFactory/src/llamafactory/launcher.py", line 185, in
[rank1]: run_exp()
[rank1]: File "/home/user/git/LlamaFactory/src/llamafactory/train/tuner.py", line 156, in run_exp
[rank1]: _training_function(config={"args": args, "callbacks": callbacks})
[rank1]: File "/home/user/git/LlamaFactory/src/llamafactory/train/tuner.py", line 101, in _training_function
[rank1]: from .hyper_parallel import run_sft as run_sft_hp
[rank1]: File "/home/user/git/LlamaFactory/src/llamafactory/train/hyper_parallel/init.py", line 15, in
[rank1]: from .workflow import run_pt, run_sft
[rank1]: File "/home/user/git/LlamaFactory/src/llamafactory/train/hyper_parallel/workflow.py", line 29, in
[rank1]: from .trainer import HyperParallelTrainer
[rank1]: File "/home/user/git/LlamaFactory/src/llamafactory/train/hyper_parallel/trainer.py", line 25, in
[rank1]: from hyper_parallel.integration.llamafactory import (
[rank1]: File "/usr/local/python3.11.10/lib/python3.11/site-packages/hyper_parallel/integration/llamafactory/init.py", line 40, in
[rank1]: from hyper_parallel.integration.llamafactory.utils import (
[rank1]: File "/usr/local/python3.11.10/lib/python3.11/site-packages/hyper_parallel/integration/llamafactory/utils.py", line 46, in
[rank1]: from hyper_parallel.integration.llamafactory.context_parallel.inputs import (
[rank1]: File "/usr/local/python3.11.10/lib/python3.11/site-packages/hyper_parallel/integration/llamafactory/context_parallel/init.py", line 25, in
[rank1]: from .context_parallel_prepare import cp_prepare_model
[rank1]: File "/usr/local/python3.11.10/lib/python3.11/site-packages/hyper_parallel/integration/llamafactory/context_parallel/context_parallel_prepare.py", line 19, in
[rank1]: from .models import get_context_parallel_model_patches
[rank1]: File "/usr/local/python3.11.10/lib/python3.11/site-packages/hyper_parallel/integration/llamafactory/context_parallel/models/init.py", line 17, in
[rank1]: from .qwen3_vl import QWEN3VL_MOE_CONTEXT_PARALLEL_PATCH
[rank1]: File "/usr/local/python3.11.10/lib/python3.11/site-packages/hyper_parallel/integration/llamafactory/context_parallel/models/qwen3_vl/init.py", line 18, in
[rank1]: from .qwen3vl_forward import (
[rank1]: File "/usr/local/python3.11.10/lib/python3.11/site-packages/hyper_parallel/integration/llamafactory/context_parallel/models/qwen3_vl/qwen3vl_forward.py", line 20, in
[rank1]: from transformers.models.qwen3_vl_moe.modeling_qwen3_vl_moe import (
[rank1]: ImportError: cannot import name 'is_torchdynamo_compiling' from 'transformers.models.qwen3_vl_moe.modeling_qwen3_vl_moe' (/usr/local/python3.11.10/lib/python3.11/site-packages/transformers/models/qwen3_vl_moe/modeling_qwen3_vl_moe.py)

Expected behavior

Triggered when I was trying to run Llamafactory with context parallel. Llama-factory and hyper-parallel are built with the latest main branch. I'm using transformers==5.5.4, which may be an incompatible version.

Additional context
Environment info

Llama-factory and hyper-parallel are built with the latest main branch. I'm using transformers==5.5.4

Thanks for contributing 🎉!

schema_version: 1
source: gitcode
gitcode_repo: mindspore/hyper-parallel
gitcode_issue: 302
source_url: https://gitcode.com/mindspore/hyper-parallel/issues/302

Contributor guide

No contributing guide indexed for this repository

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 with context_parallel/models/qwen3_vl/qwen3vl_forward.py and the import chain shown in the traceback, then reproduce the import using transformers==5.5.4. Check how the referenced Transformers model module exposes is_torchdynamo_compiling and compare that with the integration's expected API. Done means context-parallel initialization no longer fails at this import.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.