|
| 1 | +# MoE training on Aurora |
| 2 | + |
| 3 | +This tree contains the source used for the 256-node Aurora run |
| 4 | +`CODEX_AGPT_MOE256_SAFE_20260810T164655Z_7dee5484`. Jobs `8747196`, |
| 5 | +`8747197`, and `8760880` used the same source archive and advanced the same |
| 6 | +training run to checkpoints 9,000, 18,000, and 27,000. The final segment ran |
| 7 | +at about 530 tokens/s/tile with finite loss and gradients. |
| 8 | + |
| 9 | +## Model and run |
| 10 | + |
| 11 | +The `AGPT_2B_50K_MOE_sdpa_aurora_full_sonic` flavor has: |
| 12 | + |
| 13 | +- 12,293,801,984 total parameters and 2,016,708,608 active parameters; |
| 14 | +- 24 layers, model dimension 2,048, 16 query heads, and 4 KV heads; |
| 15 | +- 36 routed experts, top-3 routing, and two shared-expert equivalents; |
| 16 | +- expert hidden dimension 2,112 and vocabulary size 50,304. |
| 17 | + |
| 18 | +The production configuration uses 256 nodes and all 3,072 Aurora tiles. It |
| 19 | +uses EP=12, a 256-way replicated DP dimension, a 12-way sharded DP dimension, |
| 20 | +sequence length 2,048, and global batch size 3,072 sequences. This is |
| 21 | +6,291,456 tokens per step. Parameters are BF16 with FP32 reduction and master |
| 22 | +weights. The optimizer is fused AdamW with a peak learning rate of 2.2e-4. |
| 23 | + |
| 24 | +The exact training configuration is |
| 25 | +`torchtitan/experiments/ezpz/moe_runs/agpt_moe_2b_50k_ep12_dp256_50k.json`. |
| 26 | +The PBS launcher is |
| 27 | +`torchtitan/experiments/ezpz/submit/aurora/submit_agpt_dense_moe_256n_50k.pbs`. |
| 28 | + |
| 29 | +## Prepare the source and kernels |
| 30 | + |
| 31 | +Use an Aurora PyTorch environment with XPU and SYCL extension support. The |
| 32 | +validated run loaded oneAPI 2025.3.1 and used `CCL_OP_SYNC=1` with XCCL expert |
| 33 | +transport. |
| 34 | + |
| 35 | +```bash |
| 36 | +module load oneapi/release/2025.3.1 hdf5 pti-gpu mpifileutils |
| 37 | +export PYTHONPATH="$PWD:$PWD/vendor/aurora_moe_dropin/src" |
| 38 | + |
| 39 | +python3 -m aurora_moe.build \ |
| 40 | + --torchtitan-full-sonic \ |
| 41 | + --build-dir "$PWD/outputs/aurora_moe_kernels" |
| 42 | +``` |
| 43 | + |
| 44 | +Build the extensions once on one allocated XPU. Do not let thousands of |
| 45 | +training ranks race through JIT compilation. The launcher accepts the build |
| 46 | +directory through `TT_MOE_KERNEL_CACHE` and a relocatable packed environment |
| 47 | +through `TT_VENV_TAR`. |
| 48 | + |
| 49 | +Create an immutable source archive after committing the tree: |
| 50 | + |
| 51 | +```bash |
| 52 | +eval "$(python3 \ |
| 53 | + torchtitan/experiments/ezpz/submit/aurora/freeze_matched_dense_moe_2n_1100.py)" |
| 54 | +``` |
| 55 | + |
| 56 | +The command sets `PAIR_ID`, `TT_INPUT_DIR`, and |
| 57 | +`TT_SOURCE_ARCHIVE_SHA256`. The archive includes the vendored Aurora MoE |
| 58 | +Python and SYCL sources and records a SHA-256 manifest. |
| 59 | + |
| 60 | +## Submit the 256-node run |
| 61 | + |
| 62 | +The dataset list, tokenizer, validated BlendCorpus cache, and packed Python |
| 63 | +environment are external artifacts and are not committed. The launcher keeps |
| 64 | +the paths from the recorded run as defaults. Override them when using another |
| 65 | +checkout, and provide hashes for the tokenizer and dataset list. |
| 66 | + |
| 67 | +```bash |
| 68 | +qsub -v \ |
| 69 | +TT_ROOT="$PWD",\ |
| 70 | +TT_INPUT_DIR="$TT_INPUT_DIR",\ |
| 71 | +TT_SOURCE_ARCHIVE_SHA256="$TT_SOURCE_ARCHIVE_SHA256",\ |
| 72 | +TT_SNAPSHOT_ID="$PAIR_ID",\ |
| 73 | +TT_TRAIN_CASE=moe,\ |
| 74 | +TT_VENV_TAR=/absolute/path/to/venv.tar.gz,\ |
| 75 | +TT_MOE_KERNEL_CACHE="$PWD/outputs/aurora_moe_kernels",\ |
| 76 | +TT_DATA_CACHE_PATH=/absolute/path/to/blendcorpus-cache,\ |
| 77 | +TT_DATA_LIST=/absolute/path/to/dolma_v1_7_llama2_live.txt,\ |
| 78 | +TT_DATA_LIST_SHA256=sha256-of-data-list,\ |
| 79 | +TT_TOKENIZER=/absolute/path/to/tokenizer.model,\ |
| 80 | +TT_TOKENIZER_SHA256=sha256-of-tokenizer \ |
| 81 | +torchtitan/experiments/ezpz/submit/aurora/submit_agpt_dense_moe_256n_50k.pbs |
| 82 | +``` |
| 83 | + |
| 84 | +The job logs to W&B, checkpoints every 500 steps, retains the newest two |
| 85 | +checkpoints, and is resumable by submitting the same snapshot and run ID |
| 86 | +again. W&B credentials must be available to the batch job. |
| 87 | + |
| 88 | +## Verification |
| 89 | + |
| 90 | +The architecture and parameter-count contract is covered by |
| 91 | +`tests/unit_tests/test_agpt_moe_config.py`. Backend equivalence and routing |
| 92 | +count behavior are covered by `test_moe_expert_backends.py` and |
| 93 | +`test_moe_routing_counts.py`. The production launcher validates source, |
| 94 | +tokenizer, and dataset-list hashes before starting distributed training. |
0 commit comments