Repository navigation
119 lines (103 loc) · 3.68 KB
/
Copy path_run-cpu-ci.yml
File metadata and controls
119 lines (103 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: CPU CI Job
on:
workflow_call:
inputs:
execute_command:
type: string
required: true
ref:
description: 'Git ref to check out (empty = the triggering commit). Set by release CI to test a release branch.'
type: string
required: false
default: ''
plan_already_resolved:
description: 'Skip the --list-only preflight when a trusted caller already resolved the execution plan.'
type: boolean
required: false
default: false
secrets:
HF_TOKEN:
required: false
jobs:
# CPU-only path: GitHub-hosted ubuntu-latest, bare pip install.
# Used for fast CPU tests so they don't occupy GPU-fleet runner slots.
run-cpu:
runs-on: ubuntu-latest
timeout-minutes: 60
env:
SGLANG_SOURCE_ROOT: ${{ github.workspace }}/sglang/python
MEGATRON_SOURCE_ROOT: ${{ github.workspace }}/Megatron-LM
steps:
- name: Free disk space
shell: bash
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
df -h
- name: Checkout miles
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
# local actions load from the checked-out ref, which may predate them (/rerun-test, release CI)
- name: Checkout CI actions
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
path: .ci-actions
sparse-checkout: .github/actions
- name: Set up Python
uses: actions/setup-python@v5
with:
# Match the Miles Docker runtime.
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Resolve dependency refs
id: resolve-refs
uses: ./.ci-actions/.github/actions/resolve-dependency-refs
with:
megatron_ref: ${{ github.event.inputs.ci_megatron_pr || '' }}
sglang_ref: ${{ github.event.inputs.ci_sglang_pr || '' }}
pr_body: ${{ github.event.pull_request.body || '' }}
- name: Checkout sglang
uses: actions/checkout@v4
with:
repository: sgl-project/sglang
ref: ${{ steps.resolve-refs.outputs.ci_sglang_pr }}
path: sglang
- name: Checkout Megatron-LM
uses: actions/checkout@v4
with:
repository: radixark/Megatron-LM
ref: ${{ steps.resolve-refs.outputs.ci_megatron_pr }}
path: Megatron-LM
- name: Configure source paths
shell: bash
run: echo "PYTHONPATH=$GITHUB_WORKSPACE:$SGLANG_SOURCE_ROOT:$MEGATRON_SOURCE_ROOT" >> "$GITHUB_ENV"
- name: Install dependencies
shell: bash
env:
UV_SYSTEM_PYTHON: "1"
run: |
uv pip install -r requirements.txt -r tests/ci/requirements-ci-cpu.txt
- name: Install Megatron Bridge override
if: ${{ github.event.inputs.ci_megatron_bridge_pr != '' || contains(github.event.pull_request.body, 'ci-megatron-bridge-pr:') }}
uses: ./.ci-actions/.github/actions/install-megatron-bridge
with:
ref: ${{ github.event.inputs.ci_megatron_bridge_pr || '' }}
pr_body: ${{ github.event.pull_request.body || '' }}
- name: Verify source resolution
shell: bash
run: python tests/ci/verify_source_resolution.py
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: v4.2.3
- name: Resolve suite plan
if: ${{ !inputs.plan_already_resolved }}
shell: bash
run: ${{ inputs.execute_command }} --list-only
- name: Run tests
shell: bash
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: ${{ inputs.execute_command }}