Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
71 changes: 71 additions & 0 deletions .github/config/image/miles/ec2-amzn2023.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
image:
name: "miles-ec2-amzn2023"
description: "Miles 0.2.0 training for EC2 (AL2023, CUDA 13.0, built from source)"

metadata:
framework: "miles"
framework_version: "0.2.0"
os_version: "amzn2023"
customer_type: "ec2"
arch_type: "x86"
device_type: "gpu"
job_type: "training"
prod_image: "miles:0.2.0-gpu-py312-cu130-amzn2023-ec2"

build:
dockerfile: "docker/miles/Dockerfile.amzn2023"
target: "ec2"
# Python dependency pins live in docker/miles/v{miles_version}/{pyproject.toml,uv.lock},
# installed via `uv sync --locked`. The commits below pin the source builds.
python_version: "3.12"
cuda_version: "13.0.3"
uv_version: "0.13.6"
miles_version: "0.2.0"
torch_version: "2.14.1"
sglang_version: "0.5.24.dev96+gfd01715"
efa_version: "latest"
rust_version: "1.96.1"
ffmpeg_version: "n8.1"
gdrcopy_version: "2.5.1"
nvtop_version: "3.3.2"
# Mooncake's Go etcd client (libetcd_wrapper.so) is rebuilt at the locked Mooncake
# version with this Go; see the mooncake-etcd stage.
mooncake_version: "0.3.13.post1"
go_version: "1.27.4"
go_sha256: "7226736c2339719cda28fbf3a54d71aa63bcefe376e98cef00034268dab24840"
nccl_tests_commit: "ae98985f5599617be94042f4aa3637d10014ce89"
miles_commit: "8e419cc739fb09b5f21085aeacc7f6fd951084e1"
sglang_commit: "fd017154ad278e753c47ee376de611561e2455ea"
megatron_commit: "809217f40d60ea671aa9958fcdbc754b33758e42"
torchtitan_commit: "45e33cd413b64cb37a7840cfd3c9765d3c639ae1"
sgl_router_commit: "236ff1163482b9db6c53bbdfd907c9e0413eb888"
flashqla_commit: "7c7dfe16416ad21b1d03258189fc8d3b8460ae06"
mbridge_commit: "89eb10887887bc74853f89a4de258c0702932a1c"
emerging_optimizers_commit: "b309e2f01cda75dc96a6dc1a2355a7b3b64b5e16"
torch_memory_saver_commit: "118b09b3bc7b0cf386745db1eac2601d4aa7e681"
megatron_bridge_commit: "a0c6d6e09b0bd4d208c2d936608319d5ab456d87"
nvidia_resiliency_ext_commit: "6c5f2a13c7688d92a7ac7ee6e464721eb8b7345d"
deepselect_commit: "0f03b68748b304863fdf0181a11458d04ae533a9"
mscclpp_commit: "0a04f1af0c855cc2c8315a918f55a08107f745c8"
mscclpp_version: "0.10.1"
# Release that scripts/ci/build/miles/pre_build.sh mirrors the locked wheels from.
miles_wheels_repo: "radixark/miles-wheels"
miles_wheels_tag: "cu130-torch214-x86_64"
# Kubernetes clients for Miles' Helm launcher and workbench. Newer patch releases than
# upstream's install-kube-tools.sh (v1.36.3 / v4.2.3) for their Go CVE fixes.
kubectl_version: "v1.36.6"
kubectl_sha256: "29818b6729dc9262b692307470d0558d027725e738be5dd47c760261868a2634"
helm_version: "v4.3.2"
helm_sha256: "d1c0278d46beab79582d7e50f5b3dc206944ba8e577cde618513fd07daa53983"
build_parallel: "16"
torch_cuda_arch_list: "8.0;8.6;8.9;9.0;10.0;10.3"
dlc_major_version: "0"
dlc_minor_version: "1"

release:
release: false
force_release: false
public_registry: false
private_registry: false
enable_soci: false
environment: "gamma"
180 changes: 180 additions & 0 deletions .github/workflows/miles.pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
name: "Pipeline - Miles"

on:
workflow_call:
inputs:
config-file:
description: "Path to image config YAML"
required: true
type: string
tag-suffix:
description: "CI tag suffix (run_id or pr-NUMBER)"
required: true
type: string
build:
description: "Whether to build the image"
required: false
type: boolean
default: true
run-sanity-test:
description: "Run sanity tests"
required: false
type: boolean
default: true
run-security-test:
description: "Run security tests"
required: false
type: boolean
default: false
run-unit-test:
description: "Run CPU-only unit tests against the image"
required: false
type: boolean
default: true
run-single-gpu-test:
description: "Run single-GPU functional tests against the image"
required: false
type: boolean
default: true
run-multi-gpu-test:
description: "Run multi-GPU functional tests on a reserved GPU instance"
required: false
type: boolean
default: true
run-upstream-test:
description: "Run the upstream Miles CPU suites against the image"
required: false
type: boolean
default: true
run-efa-test:
description: "Run the shared two-node EFA tests"
required: false
type: boolean
default: true
run-multi-node-test:
description: "Run the two-node GRPO test on reserved EFA instances"
required: false
type: boolean
default: true
outputs:
image-uri:
description: "Built image URI"
value: ${{ jobs.build.outputs.image-uri }}

jobs:
build:
if: ${{ inputs.build }}
concurrency:
group: ${{ github.workflow }}-build-${{ inputs.config-file }}-${{ github.ref }}
cancel-in-progress: true
runs-on:
- codebuild-runner-${{ github.run_id }}-${{ github.run_attempt }}
fleet:x86-sglang-build-runner
buildspec-override:true
timeout-minutes: 720
env:
WHEELS_BUCKET: ${{ vars.WHEELS_BUCKET }}
outputs:
image-uri: ${{ steps.build.outputs.image-uri }}
steps:
- uses: actions/checkout@v6
- id: build
uses: ./.github/actions/build-image
with:
config-file: ${{ inputs.config-file }}
aws-account-id: ${{ vars.CI_AWS_ACCOUNT_ID }}
aws-region: ${{ vars.AWS_REGION }}
tag-suffix: ${{ inputs.tag-suffix }}

sanity-test:
if: ${{ always() && !cancelled() && inputs.run-sanity-test && needs.build.result != 'failure' }}
needs: [build]
concurrency:
group: ${{ github.workflow }}-sanity-test-${{ inputs.config-file }}-${{ github.ref }}
cancel-in-progress: true
uses: ./.github/workflows/_reusable.sanity-tests.yml
with:
config-file: ${{ inputs.config-file }}
image-uri: ${{ needs.build.outputs.image-uri || '' }}

security-test:
if: ${{ always() && !failure() && !cancelled() && inputs.run-security-test }}
needs: [build]
concurrency:
group: ${{ github.workflow }}-security-test-${{ inputs.config-file }}-${{ github.ref }}
cancel-in-progress: true
uses: ./.github/workflows/_reusable.security-tests.yml
with:
config-file: ${{ inputs.config-file }}
image-uri: ${{ needs.build.outputs.image-uri || '' }}

unit-test:
if: ${{ always() && !cancelled() && inputs.run-unit-test && needs.build.result != 'failure' }}
needs: [build]
concurrency:
group: ${{ github.workflow }}-unit-test-${{ inputs.config-file }}-${{ github.ref }}
cancel-in-progress: true
uses: ./.github/workflows/miles.tests-unit.yml
with:
config-file: ${{ inputs.config-file }}
image-uri: ${{ needs.build.outputs.image-uri || '' }}

single-gpu-test:
if: ${{ always() && !cancelled() && inputs.run-single-gpu-test && needs.build.result != 'failure' }}
needs: [build]
concurrency:
group: ${{ github.workflow }}-single-gpu-test-${{ inputs.config-file }}-${{ github.ref }}
cancel-in-progress: true
uses: ./.github/workflows/miles.tests-single-gpu.yml
with:
config-file: ${{ inputs.config-file }}
image-uri: ${{ needs.build.outputs.image-uri || '' }}

multi-gpu-test:
if: ${{ always() && !cancelled() && inputs.run-multi-gpu-test && needs.build.result != 'failure' }}
needs: [build]
concurrency:
group: ${{ github.workflow }}-multi-gpu-test-${{ inputs.config-file }}-${{ github.ref }}
cancel-in-progress: true
uses: ./.github/workflows/miles.tests-multi-gpu.yml
with:
config-file: ${{ inputs.config-file }}
image-uri: ${{ needs.build.outputs.image-uri || '' }}
secrets: inherit

upstream-test:
if: ${{ always() && !cancelled() && inputs.run-upstream-test && needs.build.result != 'failure' }}
needs: [build]
concurrency:
group: ${{ github.workflow }}-upstream-test-${{ inputs.config-file }}-${{ github.ref }}
cancel-in-progress: true
uses: ./.github/workflows/miles.tests-upstream.yml
with:
config-file: ${{ inputs.config-file }}
image-uri: ${{ needs.build.outputs.image-uri || '' }}
secrets: inherit

# The two-node jobs run to completion: cancelling one mid-run would leave its EFA
# instances to the stale-instance sweep.
efa-test:
if: ${{ always() && !cancelled() && inputs.run-efa-test && needs.build.result != 'failure' }}
needs: [build]
concurrency:
group: ${{ github.workflow }}-efa-test-${{ inputs.config-file }}-${{ github.ref }}
cancel-in-progress: false
uses: ./.github/workflows/_reusable.efa-tests.yml
with:
config-file: ${{ inputs.config-file }}
image-uri: ${{ needs.build.outputs.image-uri || '' }}

multi-node-test:
if: ${{ always() && !cancelled() && inputs.run-multi-node-test && needs.build.result != 'failure' }}
needs: [build]
concurrency:
group: ${{ github.workflow }}-multi-node-test-${{ inputs.config-file }}-${{ github.ref }}
cancel-in-progress: false
uses: ./.github/workflows/miles.tests-multi-node.yml
with:
config-file: ${{ inputs.config-file }}
image-uri: ${{ needs.build.outputs.image-uri || '' }}
secrets: inherit
81 changes: 81 additions & 0 deletions .github/workflows/miles.pr-amzn2023.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: "PR - Miles AL2023"

on:
pull_request:
branches: [main]
types: [opened, reopened, synchronize]
paths:
- ".github/config/image/miles/*-amzn2023.yml"
- ".github/workflows/miles.pipeline.yml"
- ".github/workflows/miles.pr-amzn2023.yml"
- ".github/workflows/miles.tests-multi-gpu.yml"
- ".github/workflows/miles.tests-multi-node.yml"
- ".github/workflows/miles.tests-single-gpu.yml"
- ".github/workflows/miles.tests-unit.yml"
- ".github/workflows/miles.tests-upstream.yml"
- "docker/miles/**"
- "scripts/ci/build/miles/**"
- "scripts/docker/common/**"
- "scripts/docker/miles/**"
# Shared test code the pipeline runs: the EFA suite, and the harness and
# test_utils modules that the multi-GPU and multi-node tests import.
- "test/__init__.py"
- "test/conftest.py"
- "test/efa/**"
- "test/miles/**"
- "test/requirements.txt"
- "test/sanity/**"
- "test/security/data/ecr_scan_allowlist/miles/**"
- "test/test_utils/__init__.py"
- "test/test_utils/aws.py"
- "test/test_utils/constants.py"
- "test/test_utils/efa_helpers.py"
- "test/test_utils/gpu_instance.py"
- "test/test_utils/logger.py"
- "!docs/**"

permissions:
contents: read
pull-requests: read

jobs:
gatekeeper:
runs-on:
- codebuild-runner-${{ github.run_id }}-${{ github.run_attempt }}
fleet:default-runner
buildspec-override:true
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.base.sha }}
fetch-depth: 1
- uses: ./.github/actions/pr-permission-gate

discover:
needs: [gatekeeper]
runs-on:
- codebuild-runner-${{ github.run_id }}-${{ github.run_attempt }}
fleet:default-runner
buildspec-override:true
outputs:
configs: ${{ steps.discover.outputs.configs }}
steps:
- uses: actions/checkout@v6
- id: discover
uses: ./.github/actions/discover-configs
with:
pattern: ".github/config/image/miles/*-amzn2023.yml"

pipeline:
needs: [discover]
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.discover.outputs.configs) }}
uses: ./.github/workflows/miles.pipeline.yml
with:
config-file: ${{ matrix.config_file }}
tag-suffix: pr-${{ github.event.pull_request.number }}
build: true
run-security-test: true
secrets: inherit
Loading
Loading