Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
c068f26
feat: add Megatron-LM-FL and TE-FL dependency coupling for all platforms
AlexMa616 Sep 8, 2026
b382b50
fix(cicd): add missing test_matrix.unit.nproc_per_node for all platforms
AlexMa616 Sep 8, 2026
f4a1820
fix(cicd): improve Megatron-LM-FL installation verification logic
AlexMa616 Sep 8, 2026
4941a74
fix(cicd): remove extra newlines at end of config files
AlexMa616 Sep 8, 2026
a5a173e
fix(cicd): add Python version workaround and improve verification logic
AlexMa616 Sep 8, 2026
5f5e820
fix(cicd): improve Megatron installation verification with detailed l…
AlexMa616 Sep 8, 2026
30614c4
fix(cicd): verify megatron.core package installation correctly
AlexMa616 Sep 8, 2026
09d6838
fix: integrate dependency caches into unit tests and reorganize workf…
AlexMa616 Sep 8, 2026
5b8c81e
fix: align cache paths between prepare and test workflows
AlexMa616 Sep 8, 2026
a17653b
fix: use TE_FL_WHEEL_DIR instead of TE_FL_INSTALL_DIR
AlexMa616 Sep 8, 2026
851d695
fix(ci): resolve MUSA/Kunlunxin/Enflame platform test failures
AlexMa616 Sep 8, 2026
53e9322
fix(musa): patch TE-FL flash_attn detection for torch_musa compatibility
AlexMa616 Sep 8, 2026
a2546de
fix(metax): remove pre-installed Megatron paths to use CI-built lates…
AlexMa616 Sep 8, 2026
5ee5ba8
fix(musa/enflame): add NVTE env vars to disable flash_attn at build time
AlexMa616 Sep 8, 2026
f4b61d9
fix(all-platforms): uninstall pre-installed deps from images to preve…
AlexMa616 Sep 8, 2026
5036adb
feat(all-platforms): add megatron-energon dependency for multimodal s…
AlexMa616 Sep 8, 2026
679bc97
fix(enflame): also uninstall pre-installed megatron-core from image
AlexMa616 Sep 8, 2026
2e933ef
feat(all-platforms): unify dependency management across all platforms
AlexMa616 Sep 8, 2026
0fe8dff
fix(metax): convert pip_packages to block-style YAML array to escape …
AlexMa616 Sep 8, 2026
4df43b9
fix(cuda,ascend,hygon): convert pip_packages to block-style YAML array
AlexMa616 Sep 8, 2026
fb8dd3a
fix(ci): prevent dependency version conflicts across all platforms
AlexMa616 Sep 8, 2026
d1c13ec
style: fix ruff linting errors in compatibility_patches.py
AlexMa616 Sep 8, 2026
c0895b0
fix(tests): apply compatibility patches before pytest imports
AlexMa616 Sep 8, 2026
c395bff
style: fix import order in tests/conftest.py
AlexMa616 Sep 8, 2026
a6379c7
fix(tests): ensure megatron-lm-fl-install has absolute PYTHONPATH pri…
AlexMa616 Sep 8, 2026
a0ac07c
fix(tests): apply same PYTHONPATH priority to functional tests
AlexMa616 Sep 8, 2026
b3971b0
fix(ci): unify prepared training runtime dependencies
AlexMa616 Sep 8, 2026
cf6fc36
fix(ci): isolate vendor startup output from env exports
AlexMa616 Sep 8, 2026
2cdebbb
fix(cuda): disable unsupported NCCL EP build in CI
AlexMa616 Sep 8, 2026
ecd0667
fix(ci): prevent inspect module from receiving function as filename
AlexMa616 Sep 8, 2026
630005d
fix(ci): correct FlagScale module imports and Enflame sitecustomize l…
AlexMa616 Sep 8, 2026
ea125ca
fix(ci): allow cache miss fallback for dependency preparation failures
AlexMa616 Sep 8, 2026
8adc10a
style: apply ruff formatting to test files
AlexMa616 Sep 8, 2026
8f7134b
fix(ci): block flash_attn imports when NVTE_FLASH_ATTN=0
AlexMa616 Sep 8, 2026
68e08f1
style: apply ruff format to sitecustomize.py
AlexMa616 Sep 8, 2026
d63bc97
fix(ci): defer disabled flash attention stub failures
AlexMa616 Sep 8, 2026
de59e17
fix(ci): stabilize non-cuda training test runtime
AlexMa616 Sep 8, 2026
b7e10f3
fix(ci): remove remaining legacy training imports
AlexMa616 Sep 8, 2026
bfcd964
fix(ci): make flash attention stubs discoverable
AlexMa616 Sep 8, 2026
a0d3767
fix(ci): align FlagScale training imports with Megatron
AlexMa616 Sep 8, 2026
9b0836f
fix(ci): use FlagScale-owned training imports
AlexMa616 Sep 8, 2026
b1ad210
fix(ci): enforce prepared training dependency cache
AlexMa616 Sep 8, 2026
5ce226e
fix(train): update checkpointing Megatron import
AlexMa616 Sep 8, 2026
24a872d
fix(train): resolve FlagScale PEFT imports
AlexMa616 Sep 9, 2026
f6712b1
fix(train): import unwrap_model from megatron core
AlexMa616 Sep 9, 2026
72d94ad
fix(train): import unwrap_model from megatron core
AlexMa616 Sep 9, 2026
d9e71b9
fix(ci): align shared training unit tests
AlexMa616 Sep 9, 2026
d80f944
fix(ci): restore prepared training dependencies reliably
AlexMa616 Sep 9, 2026
1e7b447
Merge branch 'main' into feat/dependency-coupling-all-platforms
AlexMa616 Sep 9, 2026
4433309
fix(training): restore megatron overlay imports
AlexMa616 Sep 9, 2026
a991a18
fix(training): keep core utility imports in megatron
AlexMa616 Sep 9, 2026
5703ea7
fix(ci): upload prepared artifacts only on cache miss
AlexMa616 Sep 9, 2026
e893563
fix(hetero): read enable_hetero from args before defaults
AlexMa616 Sep 9, 2026
4828401
fix(training): preserve utility compatibility imports
AlexMa616 Sep 9, 2026
6c5418f
fix(ci): remove temporary compatibility patches
AlexMa616 Sep 10, 2026
18366a1
fix(ci): restore training overlay compatibility imports
AlexMa616 Sep 10, 2026
bcb7fe4
fix(training): unify import path for dist_checkpointing.utils
AlexMa616 Sep 10, 2026
6348587
revert(ci): remove unnecessary Python path setup in unit tests
AlexMa616 Sep 10, 2026
d3f6c07
fix(ci): align runner tests and checkpoint compatibility import
AlexMa616 Sep 10, 2026
3bdbbee
fix(ci): report prepare failures and restore test overlay import
AlexMa616 Sep 10, 2026
c6a8827
fix(train): validate platform and hetero arguments and refresh baselines
AlexMa616 Sep 10, 2026
662174b
fix(ci): configure prepared runtime for unit tests
AlexMa616 Sep 11, 2026
5782a06
style: format CI runtime script tests
AlexMa616 Sep 11, 2026
cab85ca
fix(ci): isolate tokenizer cache and unit runtime paths
AlexMa616 Sep 11, 2026
a7fd91c
fix(ci): clear stale prepared runtime artifacts
AlexMa616 Sep 11, 2026
d28d589
fix: handle hetero memory defaults and musa attention
AlexMa616 Sep 11, 2026
065d799
fix(tests): update hetero baselines and musa attention
AlexMa616 Sep 11, 2026
2c8c856
fix(ci): gate runtime artifacts on prepare cache misses
AlexMa616 Sep 11, 2026
50b69e2
fix: limit cuda architecture checks to cuda
AlexMa616 Sep 11, 2026
3decbe6
Merge branch 'main' into feat/dependency-coupling-all-platforms
AlexMa616 Sep 11, 2026
38d198a
fix: use platform device name in cuda checks
AlexMa616 Sep 12, 2026
eb16123
fix(tests): exclude cuda-only KERV tests on non-cuda platforms
AlexMa616 Sep 12, 2026
218fb76
fix(kunlunxin): disable incompatible fused swiglu in test
AlexMa616 Sep 12, 2026
54d8dde
fix(kunlunxin): pass swiglu fusion disable flag
AlexMa616 Sep 12, 2026
b55dab8
ci: extend unit test timeout
AlexMa616 Sep 12, 2026
9c6dd43
ci: use two processes for unit tests
AlexMa616 Sep 13, 2026
f56b467
ci: keep eight processes for cuda unit tests
AlexMa616 Sep 13, 2026
e949132
ci: add benchmark coverage for all platforms
AlexMa616 Sep 13, 2026
516203f
ci: normalize platform benchmark configs
AlexMa616 Sep 13, 2026
59f4936
ci: fix platform benchmark and train names
AlexMa616 Sep 13, 2026
0049b56
ci: avoid duplicate unit job prefix
AlexMa616 Sep 13, 2026
2f63a6b
test: update platform benchmark baselines
AlexMa616 Sep 13, 2026
b3e2066
ci: tolerate non-utf8 benchmark logs
AlexMa616 Sep 14, 2026
63fd103
test: update MUSA benchmark baseline
AlexMa616 Sep 14, 2026
947d0c8
ci: clarify platform TE-FL preferences
AlexMa616 Sep 14, 2026
8fb31f6
ci: centralize Hugging Face module cache isolation
AlexMa616 Sep 14, 2026
3f902a5
fix: serialize Hugging Face dynamic module loading
AlexMa616 Sep 14, 2026
b136034
fix: isolate Hugging Face module cache in CI
AlexMa616 Sep 14, 2026
f8fd877
refactor: rename benchmark configs to include TE backend suffix
AlexMa616 Sep 14, 2026
2c2e287
fix: update platform configs to match renamed benchmark cases
AlexMa616 Sep 14, 2026
98fd10a
fix: change MetaX te_fl_prefer from flagos to reference
AlexMa616 Sep 14, 2026
d6bbcb6
fix: rename MetaX config from flagos to reference backend
AlexMa616 Sep 14, 2026
92dac27
fix: rename MetaX gold baseline file to match config rename
AlexMa616 Sep 14, 2026
a3088a5
[Fix] Ascend get_device_arch_version() return None
Darryl233 Sep 14, 2026
494e828
Merge pull request #9 from Darryl233/feat/dependency-coupling-all-pla…
BrianPei Sep 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/configs/ascend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,38 @@ env_names:
inference: ""
serve: ""
rl: ""

# Setup script for environment preparation
setup_script: .github/scripts/set_env_ascend.sh

# Test matrix configuration for unit tests
test_matrix:
unit:
nproc_per_node: 2

# =============================================================================
# Dependencies Configuration (Megatron-LM-FL & TE-FL)
# =============================================================================
dependencies:
megatron_lm_fl:
enabled: true
repository: flagos-ai/Megatron-LM-FL
ref: main
runtime:
install_mode: pythonpath
environment: {}

te_fl:
enabled: true
repository: flagos-ai/TransformerEngine-FL
ref: main
build_mode: python
build_environment:
TE_FL_SKIP_CUDA: "1"
runtime:
environment:
TE_FL_SKIP_CUDA: "1"
TE_FL_PREFER: flagos
install_pip_args: []
pip_packages:
- "megatron-energon[av_decode]~=7.0"
37 changes: 37 additions & 0 deletions .github/configs/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,40 @@ env_names:
inference: "flagscale-inference"
serve: "flagscale-inference"
rl: "flagscale-rl"

# Setup script for environment preparation
setup_script: .github/scripts/set_env_cuda.sh

# Test matrix configuration for unit tests
test_matrix:
unit:
nproc_per_node: 8

# =============================================================================
# Dependencies Configuration (Megatron-LM-FL & TE-FL)
# =============================================================================
dependencies:
megatron_lm_fl:
enabled: true
repository: flagos-ai/Megatron-LM-FL
ref: main
runtime:
install_mode: pythonpath
environment: {}

te_fl:
enabled: true
repository: flagos-ai/TransformerEngine-FL
ref: main
build_mode: cuda
build_environment:
# NCCL-EP requires the internal nccl_device.h header, which is not
# shipped by the system NCCL installation in the CUDA CI image.
NVTE_WITH_NCCL_EP: "0"
runtime:
environment:
NVTE_WITH_NCCL_EP: "0"
TE_FL_PREFER: flagos
install_pip_args: []
pip_packages:
- "megatron-energon[av_decode]~=7.0"
44 changes: 44 additions & 0 deletions .github/configs/enflame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,47 @@ pkg_mgr: "pip"
env_path: ""
env_names:
train: ""
hetero_train: ""
inference: ""
serve: ""
rl: ""

# Setup script for environment preparation
setup_script: .github/scripts/set_env_enflame.sh

# Test matrix configuration for unit tests
test_matrix:
unit:
nproc_per_node: 2

# =============================================================================
# Dependencies Configuration (Megatron-LM-FL & TE-FL)
# =============================================================================
dependencies:
megatron_lm_fl:
enabled: true
repository: flagos-ai/Megatron-LM-FL
ref: main
runtime:
install_mode: pythonpath
environment: {}

te_fl:
enabled: true
repository: flagos-ai/TransformerEngine-FL
ref: main
build_mode: python
build_environment:
TE_FL_SKIP_CUDA: "1"
NVTE_FLASH_ATTN: "0"
NVTE_FUSED_ATTN: "0"
runtime:
environment:
TE_FL_SKIP_CUDA: "1"
TE_FL_PREFER: flagos
NVTE_FLASH_ATTN: "0"
NVTE_FUSED_ATTN: "0"
install_pip_args: []
pip_packages:
- onnxscript
- megatron-energon[av_decode]~=7.0
35 changes: 35 additions & 0 deletions .github/configs/hygon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,38 @@ env_names:
inference: ""
serve: ""
rl: ""

# Setup script for environment preparation
setup_script: .github/scripts/set_env_hygon.sh

# Test matrix configuration for unit tests
test_matrix:
unit:
nproc_per_node: 2

# =============================================================================
# Dependencies Configuration (Megatron-LM-FL & TE-FL)
# =============================================================================
dependencies:
megatron_lm_fl:
enabled: true
repository: flagos-ai/Megatron-LM-FL
ref: main
runtime:
install_mode: pythonpath
environment: {}

te_fl:
enabled: true
repository: flagos-ai/TransformerEngine-FL
ref: main
build_mode: python
build_environment:
TE_FL_SKIP_CUDA: "1"
runtime:
environment:
TE_FL_SKIP_CUDA: "1"
TE_FL_PREFER: flagos
install_pip_args: []
pip_packages:
- "megatron-energon[av_decode]~=7.0"
38 changes: 38 additions & 0 deletions .github/configs/kunlunxin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,41 @@ pkg_mgr: "conda"
env_path: "/root/miniconda"
env_names:
train: "python310_torch29_cuda"
hetero_train: "python310_torch29_cuda"
inference: "python310_torch29_cuda"
serve: "python310_torch29_cuda"
rl: "python310_torch29_cuda"

# Setup script for environment preparation
setup_script: .github/scripts/set_env_kunlunxin.sh

# Test matrix configuration for unit tests
test_matrix:
unit:
nproc_per_node: 2

# =============================================================================
# Dependencies Configuration (Megatron-LM-FL & TE-FL)
# =============================================================================
dependencies:
megatron_lm_fl:
enabled: true
repository: flagos-ai/Megatron-LM-FL
ref: main
runtime:
install_mode: pythonpath
environment: {}

te_fl:
enabled: true
repository: flagos-ai/TransformerEngine-FL
ref: main
build_mode: python
build_environment:
TE_FL_SKIP_CUDA: "1"
runtime:
environment:
TE_FL_SKIP_CUDA: "1"
TE_FL_PREFER: flagos
install_pip_args: []
pip_packages: ["megatron-energon[av_decode]~=7.0"]
37 changes: 37 additions & 0 deletions .github/configs/metax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,40 @@ env_names:
inference: ""
serve: ""
rl: ""

# Setup script for environment preparation
setup_script: .github/scripts/set_env_metax.sh

# Test matrix configuration for unit tests
test_matrix:
unit:
nproc_per_node: 2

# =============================================================================
# Dependencies Configuration (Megatron-LM-FL & TE-FL)
# =============================================================================
dependencies:
megatron_lm_fl:
enabled: true
repository: flagos-ai/Megatron-LM-FL
ref: main
runtime:
install_mode: pythonpath
environment: {}

te_fl:
enabled: true
repository: flagos-ai/TransformerEngine-FL
ref: main
build_mode: python
build_environment:
TE_FL_SKIP_CUDA: "1"
runtime:
environment:
TE_FL_SKIP_CUDA: "1"
TE_FL_PREFER: flagos
install_pip_args: []
pip_packages:
- flag-gems
- sqlalchemy
- "megatron-energon[av_decode]~=7.0"
40 changes: 40 additions & 0 deletions .github/configs/musa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,43 @@ env_names:
inference: ""
serve: ""
rl: ""

# Setup script for environment preparation
setup_script: .github/scripts/set_env_musa.sh

# Test matrix configuration for unit tests
test_matrix:
unit:
nproc_per_node: 2

# =============================================================================
# Dependencies Configuration (Megatron-LM-FL & TE-FL)
# =============================================================================
dependencies:
megatron_lm_fl:
enabled: true
repository: flagos-ai/Megatron-LM-FL
ref: main
runtime:
install_mode: pythonpath
environment: {}

te_fl:
enabled: true
repository: flagos-ai/TransformerEngine-FL
ref: main
build_mode: python
build_environment:
TE_FL_SKIP_CUDA: "1"
NVTE_FLASH_ATTN: "0"
NVTE_FUSED_ATTN: "0"
runtime:
environment:
TE_FL_SKIP_CUDA: "1"
TE_FL_PREFER: flagos
NVTE_FLASH_ATTN: "0"
NVTE_FUSED_ATTN: "0"
install_pip_args: []
pip_packages:
- onnxscript
- megatron-energon[av_decode]~=7.0
62 changes: 62 additions & 0 deletions .github/scripts/install_megatron_runtime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env bash

set -euo pipefail

: "${MEGATRON_INSTALL_DIR:?MEGATRON_INSTALL_DIR is required}"

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/set_env_common.sh"

python_bin="${CI_PYTHON_BIN:-$(command -v python3)}"
if [ ! -x "$python_bin" ]; then
echo "::error::Python executable not found: $python_bin" >&2
exit 1
fi

if [ ! -d "$MEGATRON_INSTALL_DIR" ]; then
echo "::error::Megatron-LM-FL install directory is missing: $MEGATRON_INSTALL_DIR" >&2
exit 1
fi

# Remove only a site-packages copy. Keep the prepared target directory intact
# even when it is already present on PYTHONPATH from an earlier CI step.
echo "Removing any site-packages megatron-core to ensure PYTHONPATH priority..."
env -u PYTHONPATH PYTHONNOUSERSITE=1 \
"$python_bin" -m pip uninstall -y megatron-core >/dev/null 2>&1 || true

ci_configure_training_pythonpath
ci_export_env PYTHONNOUSERSITE 1

"$python_bin" - <<'PY'
import sys
import os

megatron_path = os.environ.get("MEGATRON_INSTALL_DIR")
if megatron_path and megatron_path not in sys.path:
sys.path.insert(0, megatron_path)

try:
import megatron
import megatron.core
print(f"Megatron-LM-FL Python: {sys.executable}")
print(f"Megatron-LM-FL import passed: {megatron.__file__}")
print(f"Megatron-Core version: {getattr(megatron.core, '__version__', 'unknown')}")
print(f"Megatron-Core path: {megatron.core.__file__}")

expected_root = os.path.realpath(megatron_path)
actual_path = os.path.realpath(megatron.core.__file__)
if os.path.commonpath([expected_root, actual_path]) != expected_root:
raise ImportError(
f"megatron.core resolved outside the prepared runtime: {actual_path}"
)

# Verify critical modules exist
try:
from megatron.core.transformer.cuda_graph_config import CudaGraphConfig
print(f"✓ cuda_graph_config module available")
except (ImportError, ModuleNotFoundError) as e:
print(f"⚠ Warning: cuda_graph_config not available (expected for Megatron-Core < 0.18): {e}")
except ImportError as e:
print(f"::error::Failed to import Megatron-LM-FL: {e}", file=sys.stderr)
sys.exit(1)
PY
Loading
Loading