Skip to content

fix: get_tensor_model_parallel_group_if_none is missing for mcore v0.12.1#53

Open
quancs wants to merge 1 commit into
ISEEKYAN:mainfrom
quancs:npu_support_qwen3_vl
Open

fix: get_tensor_model_parallel_group_if_none is missing for mcore v0.12.1#53
quancs wants to merge 1 commit into
ISEEKYAN:mainfrom
quancs:npu_support_qwen3_vl

Conversation

@quancs

@quancs quancs commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

solve the issue: #50

Adiactive added a commit to Adiactive/AReaL that referenced this pull request Apr 28, 2026
mbridge >= 310e8fb (used on the NPU branch via pyproject.npu.toml) imports
``get_tensor_model_parallel_group_if_none`` from ``megatron.core.utils`` at
module load time in its qwen3_vl modules. That symbol does not exist in
megatron-core 0.12.1 (the version shipped with MindSpeed on Ascend NPU),
so importing mbridge raises ImportError before any AReaL code runs.

Mirror the fallback added in ISEEKYAN/mbridge#53 — but inside AReaL, since
mbridge is a pinned dependency we don't want to fork. Inject the function
into ``megatron.core.utils`` right after the MindSpeed adaptor init and
before the first ``import mbridge`` in ``megatron_engine.py``. The shim is
a no-op on mcore >= 0.13 (skipped via ``hasattr``) and matches the
deprecation-warning behavior of the upstream mcore implementation.

Also resolve a latent F821 in the same file: move
``MegatronBridgeLoRA`` into a ``TYPE_CHECKING`` import so the
``bridge_lora: MegatronBridgeLoRA | None`` annotation no longer requires a
runtime ``megatron.bridge`` import on NPU (where the package is absent and
the import is already deferred to call time).
Adiactive added a commit to Adiactive/AReaL that referenced this pull request Apr 28, 2026
mbridge >= 310e8fb (used on the NPU branch via pyproject.npu.toml) imports
``get_tensor_model_parallel_group_if_none`` from ``megatron.core.utils`` at
module load time in its qwen3_vl modules. That symbol does not exist in
megatron-core 0.12.1 (the version shipped with MindSpeed on Ascend NPU),
so importing mbridge raises ImportError before any AReaL code runs.

Mirror the fallback added in ISEEKYAN/mbridge#53 — but inside AReaL, since
mbridge is a pinned dependency we don't want to fork. Inject the function
into ``megatron.core.utils`` right after the MindSpeed adaptor init and
before the first ``import mbridge`` in ``megatron_engine.py``. The shim is
a no-op on mcore >= 0.13 (skipped via ``hasattr``) and matches the
deprecation-warning behavior of the upstream mcore implementation.

Also resolve a latent F821 in the same file: move
``MegatronBridgeLoRA`` into a ``TYPE_CHECKING`` import so the
``bridge_lora: MegatronBridgeLoRA | None`` annotation no longer requires a
runtime ``megatron.bridge`` import on NPU (where the package is absent and
the import is already deferred to call time).
Adiactive added a commit to Adiactive/AReaL that referenced this pull request Apr 29, 2026
mbridge >= 310e8fb (used on the NPU branch via pyproject.npu.toml) imports
``get_tensor_model_parallel_group_if_none`` from ``megatron.core.utils`` at
module load time in its qwen3_vl modules. That symbol does not exist in
megatron-core 0.12.1 (the version shipped with MindSpeed on Ascend NPU),
so importing mbridge raises ImportError before any AReaL code runs.

Mirror the fallback added in ISEEKYAN/mbridge#53 — but inside AReaL, since
mbridge is a pinned dependency we don't want to fork. Inject the function
into ``megatron.core.utils`` right after the MindSpeed adaptor init and
before the first ``import mbridge`` in ``megatron_engine.py``. The shim is
a no-op on mcore >= 0.13 (skipped via ``hasattr``) and matches the
deprecation-warning behavior of the upstream mcore implementation.

Also resolve a latent F821 in the same file: move
``MegatronBridgeLoRA`` into a ``TYPE_CHECKING`` import so the
``bridge_lora: MegatronBridgeLoRA | None`` annotation no longer requires a
runtime ``megatron.bridge`` import on NPU (where the package is absent and
the import is already deferred to call time).
Adiactive added a commit to Adiactive/AReaL that referenced this pull request Apr 29, 2026
mbridge >= 310e8fb (used on the NPU branch via pyproject.npu.toml) imports
``get_tensor_model_parallel_group_if_none`` from ``megatron.core.utils`` at
module load time in its qwen3_vl modules. That symbol does not exist in
megatron-core 0.12.1 (the version shipped with MindSpeed on Ascend NPU),
so importing mbridge raises ImportError before any AReaL code runs.

Mirror the fallback added in ISEEKYAN/mbridge#53 — but inside AReaL, since
mbridge is a pinned dependency we don't want to fork. Inject the function
into ``megatron.core.utils`` right after the MindSpeed adaptor init and
before the first ``import mbridge`` in ``megatron_engine.py``. The shim is
a no-op on mcore >= 0.13 (skipped via ``hasattr``) and matches the
deprecation-warning behavior of the upstream mcore implementation.

Also resolve a latent F821 in the same file: move
``MegatronBridgeLoRA`` into a ``TYPE_CHECKING`` import so the
``bridge_lora: MegatronBridgeLoRA | None`` annotation no longer requires a
runtime ``megatron.bridge`` import on NPU (where the package is absent and
the import is already deferred to call time).
Adiactive added a commit to Adiactive/AReaL that referenced this pull request Apr 29, 2026
mbridge >= 310e8fb (used on the NPU branch via pyproject.npu.toml) imports
``get_tensor_model_parallel_group_if_none`` from ``megatron.core.utils`` at
module load time in its qwen3_vl modules. That symbol does not exist in
megatron-core 0.12.1 (the version shipped with MindSpeed on Ascend NPU),
so importing mbridge raises ImportError before any AReaL code runs.

Mirror the fallback added in ISEEKYAN/mbridge#53 — but inside AReaL, since
mbridge is a pinned dependency we don't want to fork. Inject the function
into ``megatron.core.utils`` right after the MindSpeed adaptor init and
before the first ``import mbridge`` in ``megatron_engine.py``. The shim is
a no-op on mcore >= 0.13 (skipped via ``hasattr``) and matches the
deprecation-warning behavior of the upstream mcore implementation.

Also resolve a latent F821 in the same file: move
``MegatronBridgeLoRA`` into a ``TYPE_CHECKING`` import so the
``bridge_lora: MegatronBridgeLoRA | None`` annotation no longer requires a
runtime ``megatron.bridge`` import on NPU (where the package is absent and
the import is already deferred to call time).
Adiactive added a commit to Adiactive/AReaL that referenced this pull request Apr 30, 2026
mbridge >= 310e8fb (used on the NPU branch via pyproject.npu.toml) imports
``get_tensor_model_parallel_group_if_none`` from ``megatron.core.utils`` at
module load time in its qwen3_vl modules. That symbol does not exist in
megatron-core 0.12.1 (the version shipped with MindSpeed on Ascend NPU),
so importing mbridge raises ImportError before any AReaL code runs.

Mirror the fallback added in ISEEKYAN/mbridge#53 — but inside AReaL, since
mbridge is a pinned dependency we don't want to fork. Inject the function
into ``megatron.core.utils`` right after the MindSpeed adaptor init and
before the first ``import mbridge`` in ``megatron_engine.py``. The shim is
a no-op on mcore >= 0.13 (skipped via ``hasattr``) and matches the
deprecation-warning behavior of the upstream mcore implementation.

Also resolve a latent F821 in the same file: move
``MegatronBridgeLoRA`` into a ``TYPE_CHECKING`` import so the
``bridge_lora: MegatronBridgeLoRA | None`` annotation no longer requires a
runtime ``megatron.bridge`` import on NPU (where the package is absent and
the import is already deferred to call time).
Adiactive added a commit to Adiactive/AReaL that referenced this pull request May 6, 2026
mbridge >= 310e8fb (used on the NPU branch via pyproject.npu.toml) imports
``get_tensor_model_parallel_group_if_none`` from ``megatron.core.utils`` at
module load time in its qwen3_vl modules. That symbol does not exist in
megatron-core 0.12.1 (the version shipped with MindSpeed on Ascend NPU),
so importing mbridge raises ImportError before any AReaL code runs.

Mirror the fallback added in ISEEKYAN/mbridge#53 — but inside AReaL, since
mbridge is a pinned dependency we don't want to fork. Inject the function
into ``megatron.core.utils`` right after the MindSpeed adaptor init and
before the first ``import mbridge`` in ``megatron_engine.py``. The shim is
a no-op on mcore >= 0.13 (skipped via ``hasattr``) and matches the
deprecation-warning behavior of the upstream mcore implementation.

Also resolve a latent F821 in the same file: move
``MegatronBridgeLoRA`` into a ``TYPE_CHECKING`` import so the
``bridge_lora: MegatronBridgeLoRA | None`` annotation no longer requires a
runtime ``megatron.bridge`` import on NPU (where the package is absent and
the import is already deferred to call time).
Adiactive added a commit to Adiactive/AReaL that referenced this pull request May 6, 2026
mbridge >= 310e8fb (used on the NPU branch via pyproject.npu.toml) imports
``get_tensor_model_parallel_group_if_none`` from ``megatron.core.utils`` at
module load time in its qwen3_vl modules. That symbol does not exist in
megatron-core 0.12.1 (the version shipped with MindSpeed on Ascend NPU),
so importing mbridge raises ImportError before any AReaL code runs.

Mirror the fallback added in ISEEKYAN/mbridge#53 — but inside AReaL, since
mbridge is a pinned dependency we don't want to fork. Inject the function
into ``megatron.core.utils`` right after the MindSpeed adaptor init and
before the first ``import mbridge`` in ``megatron_engine.py``. The shim is
a no-op on mcore >= 0.13 (skipped via ``hasattr``) and matches the
deprecation-warning behavior of the upstream mcore implementation.

Also resolve a latent F821 in the same file: move
``MegatronBridgeLoRA`` into a ``TYPE_CHECKING`` import so the
``bridge_lora: MegatronBridgeLoRA | None`` annotation no longer requires a
runtime ``megatron.bridge`` import on NPU (where the package is absent and
the import is already deferred to call time).
Adiactive added a commit to Adiactive/AReaL that referenced this pull request May 8, 2026
mbridge >= 310e8fb (used on the NPU branch via pyproject.npu.toml) imports
``get_tensor_model_parallel_group_if_none`` from ``megatron.core.utils`` at
module load time in its qwen3_vl modules. That symbol does not exist in
megatron-core 0.12.1 (the version shipped with MindSpeed on Ascend NPU),
so importing mbridge raises ImportError before any AReaL code runs.

Mirror the fallback added in ISEEKYAN/mbridge#53 — but inside AReaL, since
mbridge is a pinned dependency we don't want to fork. Inject the function
into ``megatron.core.utils`` right after the MindSpeed adaptor init and
before the first ``import mbridge`` in ``megatron_engine.py``. The shim is
a no-op on mcore >= 0.13 (skipped via ``hasattr``) and matches the
deprecation-warning behavior of the upstream mcore implementation.

Also resolve a latent F821 in the same file: move
``MegatronBridgeLoRA`` into a ``TYPE_CHECKING`` import so the
``bridge_lora: MegatronBridgeLoRA | None`` annotation no longer requires a
runtime ``megatron.bridge`` import on NPU (where the package is absent and
the import is already deferred to call time).
Adiactive added a commit to Adiactive/AReaL that referenced this pull request May 8, 2026
mbridge >= 310e8fb (used on the NPU branch via pyproject.npu.toml) imports
``get_tensor_model_parallel_group_if_none`` from ``megatron.core.utils`` at
module load time in its qwen3_vl modules. That symbol does not exist in
megatron-core 0.12.1 (the version shipped with MindSpeed on Ascend NPU),
so importing mbridge raises ImportError before any AReaL code runs.

Mirror the fallback added in ISEEKYAN/mbridge#53 — but inside AReaL, since
mbridge is a pinned dependency we don't want to fork. Inject the function
into ``megatron.core.utils`` right after the MindSpeed adaptor init and
before the first ``import mbridge`` in ``megatron_engine.py``. The shim is
a no-op on mcore >= 0.13 (skipped via ``hasattr``) and matches the
deprecation-warning behavior of the upstream mcore implementation.

Also resolve a latent F821 in the same file: move
``MegatronBridgeLoRA`` into a ``TYPE_CHECKING`` import so the
``bridge_lora: MegatronBridgeLoRA | None`` annotation no longer requires a
runtime ``megatron.bridge`` import on NPU (where the package is absent and
the import is already deferred to call time).
Adiactive added a commit to Adiactive/AReaL that referenced this pull request May 12, 2026
mbridge >= 310e8fb (used on the NPU branch via pyproject.npu.toml) imports
``get_tensor_model_parallel_group_if_none`` from ``megatron.core.utils`` at
module load time in its qwen3_vl modules. That symbol does not exist in
megatron-core 0.12.1 (the version shipped with MindSpeed on Ascend NPU),
so importing mbridge raises ImportError before any AReaL code runs.

Mirror the fallback added in ISEEKYAN/mbridge#53 — but inside AReaL, since
mbridge is a pinned dependency we don't want to fork. Inject the function
into ``megatron.core.utils`` right after the MindSpeed adaptor init and
before the first ``import mbridge`` in ``megatron_engine.py``. The shim is
a no-op on mcore >= 0.13 (skipped via ``hasattr``) and matches the
deprecation-warning behavior of the upstream mcore implementation.

Also resolve a latent F821 in the same file: move
``MegatronBridgeLoRA`` into a ``TYPE_CHECKING`` import so the
``bridge_lora: MegatronBridgeLoRA | None`` annotation no longer requires a
runtime ``megatron.bridge`` import on NPU (where the package is absent and
the import is already deferred to call time).
Adiactive added a commit to Adiactive/AReaL that referenced this pull request Jun 23, 2026
mbridge >= 310e8fb (used on the NPU branch via pyproject.npu.toml) imports
``get_tensor_model_parallel_group_if_none`` from ``megatron.core.utils`` at
module load time in its qwen3_vl modules. That symbol does not exist in
megatron-core 0.12.1 (the version shipped with MindSpeed on Ascend NPU),
so importing mbridge raises ImportError before any AReaL code runs.

Mirror the fallback added in ISEEKYAN/mbridge#53 — but inside AReaL, since
mbridge is a pinned dependency we don't want to fork. Inject the function
into ``megatron.core.utils`` right after the MindSpeed adaptor init and
before the first ``import mbridge`` in ``megatron_engine.py``. The shim is
a no-op on mcore >= 0.13 (skipped via ``hasattr``) and matches the
deprecation-warning behavior of the upstream mcore implementation.

Also resolve a latent F821 in the same file: move
``MegatronBridgeLoRA`` into a ``TYPE_CHECKING`` import so the
``bridge_lora: MegatronBridgeLoRA | None`` annotation no longer requires a
runtime ``megatron.bridge`` import on NPU (where the package is absent and
the import is already deferred to call time).
Adiactive added a commit to Adiactive/AReaL that referenced this pull request Jun 23, 2026
mbridge >= 310e8fb (used on the NPU branch via pyproject.npu.toml) imports
``get_tensor_model_parallel_group_if_none`` from ``megatron.core.utils`` at
module load time in its qwen3_vl modules. That symbol does not exist in
megatron-core 0.12.1 (the version shipped with MindSpeed on Ascend NPU),
so importing mbridge raises ImportError before any AReaL code runs.

Mirror the fallback added in ISEEKYAN/mbridge#53 — but inside AReaL, since
mbridge is a pinned dependency we don't want to fork. Inject the function
into ``megatron.core.utils`` right after the MindSpeed adaptor init and
before the first ``import mbridge`` in ``megatron_engine.py``. The shim is
a no-op on mcore >= 0.13 (skipped via ``hasattr``) and matches the
deprecation-warning behavior of the upstream mcore implementation.

Also resolve a latent F821 in the same file: move
``MegatronBridgeLoRA`` into a ``TYPE_CHECKING`` import so the
``bridge_lora: MegatronBridgeLoRA | None`` annotation no longer requires a
runtime ``megatron.bridge`` import on NPU (where the package is absent and
the import is already deferred to call time).
HwVanICI pushed a commit to HwVanICI/AReaL that referenced this pull request Jun 25, 2026
mbridge >= 310e8fb (used on the NPU branch via pyproject.npu.toml) imports
``get_tensor_model_parallel_group_if_none`` from ``megatron.core.utils`` at
module load time in its qwen3_vl modules. That symbol does not exist in
megatron-core 0.12.1 (the version shipped with MindSpeed on Ascend NPU),
so importing mbridge raises ImportError before any AReaL code runs.

Mirror the fallback added in ISEEKYAN/mbridge#53 — but inside AReaL, since
mbridge is a pinned dependency we don't want to fork. Inject the function
into ``megatron.core.utils`` right after the MindSpeed adaptor init and
before the first ``import mbridge`` in ``megatron_engine.py``. The shim is
a no-op on mcore >= 0.13 (skipped via ``hasattr``) and matches the
deprecation-warning behavior of the upstream mcore implementation.

Also resolve a latent F821 in the same file: move
``MegatronBridgeLoRA`` into a ``TYPE_CHECKING`` import so the
``bridge_lora: MegatronBridgeLoRA | None`` annotation no longer requires a
runtime ``megatron.bridge`` import on NPU (where the package is absent and
the import is already deferred to call time).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant