Skip to content

[moe] resolve the default EP group before tagging parameters - #6486

Merged
JazyJiang merged 1 commit into
feat/moe-ep-layerfrom
fix/ep-default-process-group
Oct 28, 2026
Merged

JazyJiang merged 1 commit into
feat/moe-ep-layerfrom
fix/ep-default-process-group

Conversation

@richardoo-707

Copy link
Copy Markdown
Collaborator

Problem and change

Fixes #6485. Stacked on #6477: base feat/moe-ep-layer, head fix/ep-default-process-group.

When distributed is initialized, constructing EPMoELayer with its default ep_group=None computes the WORLD size correctly but tags expert parameters with None. The existing get_ep_size(param) then raises an assertion. Resolve the default group to dist.group.WORLD before creating the default dispatcher or tagging parameters. Explicit subgroups and construction before distributed initialization retain their current behavior.

Add a CPU/Gloo regression for initialized and uninitialized construction, include it in both CPU batch manifests, and extend the existing four-GPU parameter-contract test to cover WORLD and explicit subgroups. No changes to gradient scaling, the getter API, checkpoint layout, dependencies, image configuration, or version.txt.

Validation

Tested commit: c1702d851d9086415e6a942224220ddfdca57e60 (parent 055853017e23c778402b2c8d965838cb09fb43e4).

Check Result
New CPU regression with original parent layer.py mounted over the fixed snapshot 1 failed, 1 passed; exit 1, confirming the regression detects the original default-group mismatch
New CPU regression on the fixed snapshot 2 passed, 0 skipped; exit 0
Repository CPU gate 29 passed, 0 skipped; exit 0; includes both new regression cases
Targeted Black/isort and git diff --check Passed
Four-GPU test_ep_moe_layer.py / Layer 3 Not run: all eight GPUs on the development server had active compute processes; no GPU was acquired

Commands inside the existing dependency image, with /workspace bound read-only to the exact source archive and zero visible GPUs:

python -m pytest -p no:cacheprovider -v -ra --tb=short \
  --junitxml=/results/cpu-after.xml tests/test_moe/test_ep_moe_layer_cpu.py

PYTEST_ADDOPTS='-p no:cacheprovider' COLOSSAL_RESULTS=/results/cpu-gate \
  bash .github/scripts/ci/run_cpu_unit_tests.sh

The targeted regression ran with FAST_TEST unset. The CPU gate used its normal FAST_MODE=1 / FAST_TEST=1 setting; these two new cases are not reduced by that setting. No new skip, xfail, ignore, tolerance change, or failure retry was added. One initial CPU-gate launch stopped before pytest because Windows git archive exported CRLF shell scripts; regenerating the unchanged commit with git -c core.autocrlf=false archive fixed the source packaging. Results above are from the corrected archive.

Environment: Ubuntu 22.04.5 LTS; Python 3.10.12; Torch 2.13.0+cu130 (CUDA runtime 13.0); Transformers 5.17.0; PEFT 0.21.2; pytest 7.4.4. GPU count 0, Gloo backend; no CUDA kernels/toolkit or flash-attn path exercised. Image: wangzhijian/colossalai-ci:torch2.13-cu130-tf5.17.0-peft0.21.2-20261022-091529, local image ID sha256:ae8ff34bf340a692803edca6e0f38a576fc1a2b206c01b4ef6f7c2a40dfd8c10. Containers had no network or GPU access and used the existing environment without installing dependencies.

The source import was verified as /workspace/colossalai/__init__.py. Source archive SHA256: 56af8c927ba8d094d728bb00124feb8e31544c2d49c38cc1d57ca2ee555c1fc1.

Logs/JUnit on server 30005: /mnt/beegfs/ricardoo/codex-ep-default-group-20261027/results/ (cpu-before.*, cpu-after.*, cpu-gate/cpu-local-1.{log,xml}). The reproducible red/green command wrapper is validate.sh in the same task directory.

Risk and rollback

The runtime change only makes default-group metadata explicit after distributed initialization; the communication group and numerical operations are unchanged. Revert this commit to roll back. No release or installation changes are needed. Keep as Draft pending the four-GPU regression; this validation does not claim a Layer 3 pass.

@JazyJiang
JazyJiang marked this pull request as ready for review October 28, 2026 01:37
@JazyJiang
JazyJiang requested a review from a team as a code owner October 28, 2026 01:37
@JazyJiang
JazyJiang merged commit 941eadc into feat/moe-ep-layer Oct 28, 2026
1 check passed
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.

2 participants