Skip to content

feat(miles): add the Miles v0.2.0 AL2023 EC2 training image - #7075

Draft
Yadan-Wei wants to merge 3 commits into
mainfrom
weiyadan/miles-v0.2.0-ec2
Draft

Yadan-Wei wants to merge 3 commits into
mainfrom
weiyadan/miles-v0.2.0-ec2

Conversation

@Yadan-Wei

@Yadan-Wei Yadan-Wei commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Purpose

Add the Miles v0.2.0 AL2023 EC2 training image on its own, so the EC2 variant can be released before the SageMaker Training one. This is #7062 without the SageMaker target, as one commit on current main. #7062 stays open for the SageMaker target, and its description and commits record how the v0.2.0 image was put together.

Changes from #7062:

  • No sagemaker-amzn2023.yml, so the pipeline builds and tests only ec2-amzn2023.yml.
  • The Dockerfile drops the sagemaker stage. The base stage the two targets shared stays, and the ec2 stage is unchanged, so the SageMaker target can be added on top later.
  • test_sagemaker_path_exists (the /opt/ml check) goes, with the step that passed the build target to the unit tests.
  • The customer-type gates in the multi-GPU and multi-node tests go. They only skipped runs on the SageMaker image, so the EC2 image runs the same tests as before.

All other files match #7062, which has the same two follow-up commits on top of 18d7803 (627c038 and 8cc6700). Nothing else the image build reads has changed on main since #7062's base.

What the image contains:

  • Miles v0.2.0 (8e419cc7), matched to radixark/miles:v0.2.0 (amd64 sha256:92b5a817…):
    • The lock constraints are that image's pip freeze, plus security bumps.
    • The 10 release wheels from cu130-torch214-x86_64 match its hashes.
    • pip check matches upstream's, minus the lines for packages this image doesn't ship.
  • Source builds at upstream's v0.2.0 commits: SGLang fd01715 (0.5.24.dev96), Megatron-LM 809217f, torchtitan 45e33cd (v0.4.0), torch_memory_saver 118b09b and Megatron-Bridge a0c6d6e. sglang-router is rebuilt from source at 236ff11.
  • Upstream's source layout: /root/miles, /root/Megatron-LM, /root/torchtitan and /sgl-workspace/sglang. Miles' Helm charts and recipes assume these paths, so they work on EKS, ECS and EC2 as they do with radixark/miles.
  • Stack: CUDA 13.0.3, torch 2.14.1, Python 3.12, EFA, kubectl v1.36.6 and Helm v4.3.2.
  • Security:

OSS compliance: the OSS compliance check on this image passed and blocked nothing. eb86e08 fixes what it found that the image can fix itself:

  • psycopg and psycopg-binary 3.3.8 are LGPL-3.0, and upstream Miles requires them, so they stay. THIRD_PARTY_SOURCE_CODE_URLS now lists their source tarball at the installed version.
  • sgl-model-gateway, the router binary, now has build-from-source and source URL entries, as kubectl and Helm do.
  • te_fa4_needs_sm90.patch changes an Apache-2.0 file, and its added comment now says Amazon modified it.
  • Two sets of upstream files name a license that isn't open source: torchtitan's FLUX model, whose tokenizer cites the Llama 3 Community License, and SGLang's Hunyuan3D mesh extensions, adapted from Tencent's non-commercial license. Miles uses neither, so the sparse checkouts leave them out.
  • New unit tests check the source URLs and tracking entries, and that no file in the four source checkouts names such a license.

Review fixes (c23a904):

  • EFA_VERSION is latest, but the EFA install layer was cached until something before it changed. CACHE_REFRESH is now declared right before the install, so the layer rebuilds daily and picks up new EFA releases, as fix: rebuild the vllm (AL2023) efa layer daily so efa latest picks up new releases #7053 did for the vLLM AL2023 image. The venv and source copies before it stay cached.
  • The PR workflow now also runs for the shared test code the pipeline uses: test/efa, test/requirements.txt, and the harness that the multi-GPU and multi-node tests import (test/__init__.py, test/conftest.py and six test_utils modules, listed by name as in telemetry.pr.yml).

Telemetry is left for the final pre-merge change, as in #7062.

Test Plan

The PR pipeline on ec2-amzn2023.yml:

  • build
  • sanity, security and unit tests
  • single-GPU tests on L4
  • multi-GPU tests on the A100 reservation, including upstream's GRPO, checkpoint-resume and SFT runs
  • upstream's CPU suites
  • EFA and two-node GRPO tests on 2× p4d

Test Result

  • feat(miles): add AL2023 images for Miles v0.2.0 #7062 at 18d7803: every check passed, on both targets.
  • Hopper validation: I ran the EC2 image from 18d7803 (sha256:6950d452…) on a p5.48xlarge (8× H100), the way the CI jobs do. Everything passed:
    • the unit tests;
    • the single-GPU tests, 24/24, on the FA3/FA4 attention paths that L4 never reaches;
    • a FlashMLA kernel check: SGLang's sgl_flash_mla dense decode on SM90 and the nv_dev flash_mla sparse prefill both come within about 0.002 relative error of a float32 reference;
    • NCCL all-reduce at 413 GB/s bus bandwidth (256 MB);
    • torchrun collectives, Megatron parallelism and SGLang at TP 2;
    • SGLang serving DeepSeek-V2-Lite with the flashmla and triton backends;
    • upstream's GRPO (async and colocated), checkpoint-resume and SFT runs, from /root/miles with upstream's PYTHONPATH.
  • This PR at d168bf8: the pipeline passed on ec2-amzn2023.yml:
    • build, sanity, the ECR scan and unit tests;
    • single-GPU tests on L4;
    • multi-GPU tests on A100, with upstream's GRPO, checkpoint-resume and SFT runs;
    • all five upstream CPU suites;
    • the EFA tests and the two-node GRPO run on 2× p4d.
  • This PR at c23a904: every check passed again. The two follow-up commits change no code that Miles runs, so the Hopper run still covers them.
  • pre-commit run --all-files passes.

Toggle if you are merging into main Branch

PR Checklist

  • I ran pre-commit run --all-files locally before creating this PR. (Read DEVELOPMENT.md for details).

Adds only the EC2 variant of the Miles v0.2.0 AL2023 training DLC, so
it can be released ahead of the SageMaker Training image. This is
#7062 without the SageMaker target:
- No sagemaker-amzn2023.yml config, so CI builds and tests only
  ec2-amzn2023.yml.
- The Dockerfile keeps the base stage the two targets shared, and the
  ec2 stage is unchanged, so the SageMaker target can be added on top
  later.
- The /opt/ml unit test and the customer-type gates in the multi-GPU
  and multi-node tests are gone: every test runs on the one image.

The image build inputs match #7062 at 18d7803, whose EC2 image passed
CI and the manual H100 validation.

Signed-off-by: Yadan Wei <weiyadan@amazon.com>
@Yadan-Wei

Copy link
Copy Markdown
Collaborator Author

/rerun

The OSS compliance run on the v0.2.0 EC2 image passed and blocked
nothing. It flagged a few gaps this image can close itself:
- psycopg and psycopg-binary 3.3.8 are LGPL-3.0 and had no entry in
  THIRD_PARTY_SOURCE_CODE_URLS; the shared generator doesn't know them.
  Upstream Miles requires them, so they stay. The Dockerfile now lists
  the psycopg source tarball for both at their installed version, which
  also covers psycopg-binary's C source (psycopg_c).
- sgl-model-gateway, the router binary built from sgl-router-for-miles,
  was the one untracked binary. It now has BUILD_FROM_SOURCE and source
  URL entries, as kubectl and Helm do.
- te_fa4_needs_sm90.patch changes an Apache-2.0 file. The added comment
  now says Amazon modified it (Apache-2.0 section 4(b)).
- Two upstream sources name a license that isn't open source, and Miles
  uses neither, so the sparse checkouts leave them out:
  - torchtitan's FLUX model, whose tokenizer cites the Llama 3
    Community License, with its two recipe modules;
  - SGLang's Hunyuan3D mesh extensions, adapted from Tencent's
    non-commercial license. SGLang loads them lazily, only for
    Hunyuan3D texture generation.

Unit tests check that the LGPL packages' sources are listed, that every
built binary is tracked, and that no file in the four source checkouts
names such a license, using the same patterns as the review's sweep.

Signed-off-by: Yadan Wei <weiyadan@amazon.com>
Two review fixes:
- EFA_VERSION is "latest", but the EFA install layer was cached until
  something before it changed: CACHE_REFRESH was only declared later, in
  the target stage. It is now declared right before the EFA install, so
  the layer rebuilds with each day's build and picks up new EFA
  releases, as #7053 did for the vLLM AL2023 image. The install is the
  last step of runtime-base, so the venv and source copies before it
  stay cached; nccl-tests and the base and target stages rebuild with
  it.
- The PR workflow now also runs for changes to the shared test code the
  pipeline runs: the EFA suite (test/efa), test/requirements.txt, and
  the harness the multi-GPU and multi-node tests import (test/__init__.py,
  test/conftest.py and six test_utils modules). As in telemetry.pr.yml,
  it lists the test_utils modules by name, so other test_utils changes
  don't start the GPU pipeline.

Signed-off-by: Yadan Wei <weiyadan@amazon.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant