-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (163 loc) · 6.07 KB
/
Copy pathci.yaml
File metadata and controls
177 lines (163 loc) · 6.07 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: CI
# Runs on every push to main and on every PR targeting main.
#
# Scope: platform-neutral unit tests with 100% line coverage on the
# library modules we actually ship for this commit. We deliberately
# DO NOT run:
#
# * tests/core/ — needs HuggingFace weights
# * tests/system/ — same, plus is slow
# * tests/inference_engine/proposer/ — uses real Qwen3 sparse
# proposer; HF-cache-bound
# * tests/backends/mlx/test_{verifier,proposer,cache,torch_bridge}.py
# — Apple-Silicon only
#
# Mac and CUDA contributors run the full suite locally via
# scripts/run_platform_tests.sh and push the platform-test reports to
# the PR branch as evidence; this CI workflow guards the platform-
# neutral surface so a regression there cannot land on main.
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch: {}
# Cancel superseded runs on the same branch — saves CI time on
# rapid-fire pushes.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit-tests:
name: unit tests + 100% coverage
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Show installed key versions
run: |
python -c "import torch, fastapi, pydantic, prometheus_client, transformers; \
print('torch', torch.__version__); \
print('fastapi', fastapi.__version__); \
print('pydantic', pydantic.VERSION); \
print('transformers', transformers.__version__); \
print('prometheus_client', __import__('importlib.metadata', fromlist=['version']).version('prometheus_client'))"
- name: Run platform-neutral test suite with 100% coverage
env:
PYTHONPATH: .
run: |
pytest \
tests/inference_engine/server/ \
tests/inference_engine/memory/ \
tests/inference_engine/scheduler/ \
tests/inference_engine/pipeline/ \
tests/training/repr_align/ \
tests/backends/mlx/test_env.py \
--cov=inference_engine.server \
--cov=inference_engine.memory \
--cov=inference_engine.scheduler \
--cov=inference_engine.pipeline \
--cov=training.repr_align \
--cov-report=term \
--cov-report=xml:coverage.xml \
--cov-fail-under=100 \
--junitxml=junit.xml \
-v
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-py${{ matrix.python-version }}
path: |
coverage.xml
junit.xml
if-no-files-found: warn
retention-days: 14
package-import-smoke:
name: package import smoke
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Import every shipping subpackage
env:
PYTHONPATH: .
run: |
python -c "import inference_engine; \
import inference_engine.server; \
import inference_engine.server.app; \
import inference_engine.server.config; \
import inference_engine.server.engine; \
import inference_engine.server.metrics; \
import inference_engine.server.errors; \
import inference_engine.server.auth; \
import inference_engine.server.tokenizer; \
import inference_engine.server.streaming; \
import inference_engine.server.schemas; \
import inference_engine.memory; \
import inference_engine.memory.slab; \
import inference_engine.memory.pool; \
import inference_engine.scheduler; \
import inference_engine.scheduler.config; \
import inference_engine.scheduler.scheduler; \
import inference_engine.scheduler.session; \
import inference_engine.pipeline; \
import inference_engine.pipeline.coordinator; \
import inference_engine.proposer; \
import inference_engine.proposer.sparse_logits; \
import inference_engine.backends.mlx.env; \
import training.repr_align; \
print('all imports succeeded')"
docker-build:
name: docker build + import smoke
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
tags: kakeya:ci-${{ github.sha }}
push: false
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Smoke-test image (import only — weights would require HF cache)
run: |
# Confirm the package imports inside the image without
# touching HF cache.
docker run --rm \
--entrypoint python \
kakeya:ci-${{ github.sha }} \
-c "import inference_engine.server.app; print('image imports clean')"
# Confirm the server CLI parses (--help exits 0 before any
# model load, so we don't need HF cache).
docker run --rm \
kakeya:ci-${{ github.sha }} \
--help