downshift-server 0.2.0__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- downshift_server-0.5.0/.gitattributes +5 -0
- downshift_server-0.5.0/.github/workflows/ci.yml +76 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/.github/workflows/compatibility-matrix.yml +35 -32
- downshift_server-0.5.0/.github/workflows/release.yml +96 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/.gitignore +53 -48
- downshift_server-0.5.0/CHANGELOG.md +505 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/LICENSE +21 -21
- downshift_server-0.5.0/PKG-INFO +633 -0
- downshift_server-0.5.0/README.md +583 -0
- downshift_server-0.5.0/bench/BLOG_APPENDIX_v0.4.0.md +200 -0
- downshift_server-0.5.0/bench/README.md +185 -0
- downshift_server-0.5.0/bench/REPORT_v0.4.0.md +563 -0
- downshift_server-0.5.0/bench/__init__.py +1 -0
- downshift_server-0.5.0/bench/_path.py +73 -0
- downshift_server-0.5.0/bench/cases.py +247 -0
- downshift_server-0.5.0/bench/factories.py +39 -0
- downshift_server-0.5.0/bench/hf_models.py +300 -0
- downshift_server-0.5.0/bench/inproc.py +163 -0
- downshift_server-0.5.0/bench/large/__init__.py +1 -0
- downshift_server-0.5.0/bench/large/bert_small.py +27 -0
- downshift_server-0.5.0/bench/large/cnn_large.py +39 -0
- downshift_server-0.5.0/bench/large/mlp_large.py +34 -0
- downshift_server-0.5.0/bench/loadgen.py +111 -0
- downshift_server-0.5.0/bench/naive_hf_server.py +83 -0
- downshift_server-0.5.0/bench/report.py +517 -0
- downshift_server-0.5.0/bench/results/v0.5.0/REPORT.md +495 -0
- downshift_server-0.5.0/bench/results/v0.5.0/chart_runs.csv +1006 -0
- downshift_server-0.5.0/bench/results/v0.5.0/chart_stages.csv +369 -0
- downshift_server-0.5.0/bench/results/v0.5.0/results.json +23212 -0
- downshift_server-0.5.0/bench/results/v0.5.0/results_hf.json +3264 -0
- downshift_server-0.5.0/bench/results_hf_tuned_minilm_v0.4.0.json +391 -0
- downshift_server-0.5.0/bench/results_hf_tuned_pg_v0.4.0.json +219 -0
- downshift_server-0.5.0/bench/results_hf_v0.4.0.json +1390 -0
- downshift_server-0.5.0/bench/results_v0.4.0.json +11905 -0
- downshift_server-0.5.0/bench/run.py +580 -0
- downshift_server-0.5.0/bench/servers.py +136 -0
- downshift_server-0.5.0/docs/code-docs/README.md +56 -0
- downshift_server-0.5.0/docs/code-docs/adapters.md +192 -0
- downshift_server-0.5.0/docs/code-docs/cli.md +219 -0
- downshift_server-0.5.0/docs/code-docs/http-api.md +460 -0
- downshift_server-0.5.0/docs/code-docs/python-api.md +396 -0
- downshift_server-0.5.0/docs/code-docs/serving.md +393 -0
- downshift_server-0.5.0/docs/compatibility.md +27 -0
- downshift_server-0.5.0/docs/production.md +248 -0
- downshift_server-0.5.0/examples/__init__.py +2 -0
- downshift_server-0.5.0/examples/clean_mlp.py +28 -0
- downshift_server-0.5.0/examples/data_dependent_branch.py +29 -0
- downshift_server-0.5.0/examples/scatter_include_self_false.py +30 -0
- downshift_server-0.5.0/pyproject.toml +113 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/scripts/gen_matrix.py +164 -135
- downshift_server-0.5.0/src/downshift/__init__.py +197 -0
- downshift_server-0.5.0/src/downshift/__main__.py +3 -0
- downshift_server-0.5.0/src/downshift/_imports.py +39 -0
- downshift_server-0.5.0/src/downshift/_version.py +4 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/src/downshift/adapters/_flatten.py +42 -40
- downshift_server-0.5.0/src/downshift/adapters/base.py +62 -0
- downshift_server-0.5.0/src/downshift/adapters/embedding.py +239 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/src/downshift/adapters/generic.py +97 -99
- downshift_server-0.5.0/src/downshift/adapters/hf.py +143 -0
- downshift_server-0.5.0/src/downshift/adapters/pooling.py +19 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/src/downshift/adapters/pyg.py +140 -120
- downshift_server-0.5.0/src/downshift/adapters/registry.py +142 -0
- downshift_server-0.5.0/src/downshift/adapters/text.py +72 -0
- downshift_server-0.5.0/src/downshift/cli/main.py +555 -0
- downshift_server-0.5.0/src/downshift/cli/options.py +271 -0
- downshift_server-0.5.0/src/downshift/cli/render.py +468 -0
- downshift_server-0.5.0/src/downshift/cli/runtime.py +249 -0
- downshift_server-0.5.0/src/downshift/core/axes.py +130 -0
- downshift_server-0.5.0/src/downshift/core/capture.py +182 -0
- downshift_server-0.5.0/src/downshift/core/export_cache.py +212 -0
- downshift_server-0.5.0/src/downshift/core/feeds.py +28 -0
- downshift_server-0.5.0/src/downshift/core/inputs.py +25 -0
- {downshift_server-0.2.0/src/downshift/export → downshift_server-0.5.0/src/downshift/core}/manifest.py +104 -89
- downshift_server-0.5.0/src/downshift/core/memo.py +424 -0
- downshift_server-0.5.0/src/downshift/core/phase.py +48 -0
- downshift_server-0.5.0/src/downshift/core/prevalidated.py +127 -0
- downshift_server-0.5.0/src/downshift/core/shapes.py +209 -0
- downshift_server-0.5.0/src/downshift/core/verdict.py +480 -0
- downshift_server-0.5.0/src/downshift/core/verify.py +445 -0
- downshift_server-0.5.0/src/downshift/hf_repo.py +249 -0
- downshift_server-0.5.0/src/downshift/loading.py +247 -0
- downshift_server-0.5.0/src/downshift/logs.py +76 -0
- downshift_server-0.5.0/src/downshift/serve/__init__.py +113 -0
- downshift_server-0.5.0/src/downshift/serve/app.py +525 -0
- downshift_server-0.5.0/src/downshift/serve/backends.py +323 -0
- downshift_server-0.5.0/src/downshift/serve/codec.py +180 -0
- downshift_server-0.5.0/src/downshift/serve/describe.py +297 -0
- downshift_server-0.5.0/src/downshift/serve/engine.py +599 -0
- downshift_server-0.5.0/src/downshift/serve/graphs.py +251 -0
- downshift_server-0.5.0/src/downshift/serve/middleware.py +28 -0
- downshift_server-0.5.0/src/downshift/serve/options.py +64 -0
- downshift_server-0.5.0/src/downshift/serve/predict.py +620 -0
- downshift_server-0.5.0/src/downshift/serve/reuse.py +151 -0
- downshift_server-0.5.0/src/downshift/serve/schemas.py +499 -0
- downshift_server-0.5.0/src/downshift/settings.py +181 -0
- downshift_server-0.5.0/src/downshift/sources.py +71 -0
- downshift_server-0.5.0/tests/conftest.py +146 -0
- downshift_server-0.5.0/tests/models/bf16_weights.py +28 -0
- downshift_server-0.5.0/tests/models/broken_factory.py +7 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/models/clean_mlp.py +27 -27
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/models/custom_autograd.py +40 -40
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/models/data_dependent_branch.py +27 -27
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/models/dict_input.py +32 -32
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/models/dropout_model.py +25 -25
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/models/gnn_gat.py +40 -37
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/models/gnn_gcn.py +30 -30
- downshift_server-0.5.0/tests/models/gnn_output_kinds.py +42 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/models/gnn_sage.py +30 -30
- downshift_server-0.5.0/tests/models/hf_repo.py +161 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/models/scatter_include_self_false.py +34 -34
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/models/tied_weights.py +27 -27
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/models/tiny_bert.py +23 -23
- downshift_server-0.5.0/tests/test_adapter_discovery_gating.py +56 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/test_adapters.py +491 -406
- downshift_server-0.5.0/tests/test_axes.py +113 -0
- downshift_server-0.5.0/tests/test_binary_io.py +311 -0
- downshift_server-0.5.0/tests/test_capture.py +87 -0
- downshift_server-0.5.0/tests/test_cli.py +665 -0
- downshift_server-0.5.0/tests/test_cli_startup.py +46 -0
- downshift_server-0.5.0/tests/test_demo.py +41 -0
- downshift_server-0.5.0/tests/test_describe.py +235 -0
- downshift_server-0.5.0/tests/test_embedding.py +584 -0
- downshift_server-0.5.0/tests/test_engine.py +481 -0
- downshift_server-0.5.0/tests/test_export.py +170 -0
- downshift_server-0.5.0/tests/test_export_cache.py +319 -0
- downshift_server-0.5.0/tests/test_export_pyg.py +83 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/test_fixtures.py +45 -43
- downshift_server-0.5.0/tests/test_gen_matrix.py +13 -0
- downshift_server-0.5.0/tests/test_graph_batching.py +235 -0
- downshift_server-0.5.0/tests/test_hf.py +256 -0
- downshift_server-0.5.0/tests/test_hf_text.py +479 -0
- downshift_server-0.5.0/tests/test_inputs.py +13 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/test_loading.py +198 -210
- downshift_server-0.5.0/tests/test_logs.py +222 -0
- downshift_server-0.5.0/tests/test_main_module.py +18 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/test_manifest.py +115 -95
- downshift_server-0.5.0/tests/test_memo.py +357 -0
- downshift_server-0.5.0/tests/test_package.py +24 -0
- downshift_server-0.5.0/tests/test_path_privacy.py +140 -0
- downshift_server-0.5.0/tests/test_prevalidated.py +88 -0
- downshift_server-0.5.0/tests/test_render.py +598 -0
- downshift_server-0.5.0/tests/test_review3_misc.py +343 -0
- downshift_server-0.5.0/tests/test_schemas.py +112 -0
- downshift_server-0.5.0/tests/test_serve.py +923 -0
- downshift_server-0.5.0/tests/test_serve_boot.py +96 -0
- downshift_server-0.5.0/tests/test_serve_hardening.py +595 -0
- downshift_server-0.5.0/tests/test_settings.py +148 -0
- downshift_server-0.5.0/tests/test_shapes.py +152 -0
- downshift_server-0.5.0/tests/test_verify_internals.py +405 -0
- downshift_server-0.2.0/.github/workflows/ci.yml +0 -25
- downshift_server-0.2.0/PKG-INFO +0 -265
- downshift_server-0.2.0/README.md +0 -224
- downshift_server-0.2.0/docs/blog/your-gnn-exports-cleanly.md +0 -74
- downshift_server-0.2.0/docs/compatibility.md +0 -25
- downshift_server-0.2.0/examples/01_check_a_model.ipynb +0 -243
- downshift_server-0.2.0/examples/01_check_a_model.py +0 -153
- downshift_server-0.2.0/examples/02_export_and_manifest.ipynb +0 -193
- downshift_server-0.2.0/examples/02_export_and_manifest.py +0 -117
- downshift_server-0.2.0/examples/03_serve_and_query.ipynb +0 -219
- downshift_server-0.2.0/examples/03_serve_and_query.py +0 -133
- downshift_server-0.2.0/examples/04_pyg_graph_neural_networks.ipynb +0 -155
- downshift_server-0.2.0/examples/04_pyg_graph_neural_networks.py +0 -89
- downshift_server-0.2.0/examples/05_huggingface_encoder.ipynb +0 -149
- downshift_server-0.2.0/examples/05_huggingface_encoder.py +0 -83
- downshift_server-0.2.0/examples/06_custom_adapter.ipynb +0 -207
- downshift_server-0.2.0/examples/06_custom_adapter.py +0 -146
- downshift_server-0.2.0/examples/07_cli_walkthrough.ipynb +0 -178
- downshift_server-0.2.0/examples/07_cli_walkthrough.py +0 -103
- downshift_server-0.2.0/examples/README.md +0 -43
- downshift_server-0.2.0/examples/_build_notebooks.py +0 -97
- downshift_server-0.2.0/pyproject.toml +0 -93
- downshift_server-0.2.0/src/downshift/__init__.py +0 -60
- downshift_server-0.2.0/src/downshift/adapters/base.py +0 -47
- downshift_server-0.2.0/src/downshift/adapters/hf.py +0 -95
- downshift_server-0.2.0/src/downshift/adapters/registry.py +0 -116
- downshift_server-0.2.0/src/downshift/cli/main.py +0 -428
- downshift_server-0.2.0/src/downshift/cli/render.py +0 -174
- downshift_server-0.2.0/src/downshift/export/capture.py +0 -93
- downshift_server-0.2.0/src/downshift/export/inputs.py +0 -25
- downshift_server-0.2.0/src/downshift/export/prevalidated.py +0 -70
- downshift_server-0.2.0/src/downshift/export/shapes.py +0 -61
- downshift_server-0.2.0/src/downshift/export/verdict.py +0 -211
- downshift_server-0.2.0/src/downshift/export/verify.py +0 -162
- downshift_server-0.2.0/src/downshift/loading.py +0 -166
- downshift_server-0.2.0/src/downshift/serve/app.py +0 -93
- downshift_server-0.2.0/src/downshift/serve/backends.py +0 -181
- downshift_server-0.2.0/src/downshift/serve/engine.py +0 -154
- downshift_server-0.2.0/src/downshift/serve/middleware.py +0 -24
- downshift_server-0.2.0/src/downshift/serve/schemas.py +0 -124
- downshift_server-0.2.0/src/downshift/settings.py +0 -69
- downshift_server-0.2.0/tests/conftest.py +0 -47
- downshift_server-0.2.0/tests/test_capture.py +0 -28
- downshift_server-0.2.0/tests/test_cli.py +0 -255
- downshift_server-0.2.0/tests/test_engine.py +0 -204
- downshift_server-0.2.0/tests/test_export.py +0 -87
- downshift_server-0.2.0/tests/test_export_pyg.py +0 -40
- downshift_server-0.2.0/tests/test_hf.py +0 -37
- downshift_server-0.2.0/tests/test_inputs.py +0 -13
- downshift_server-0.2.0/tests/test_prevalidated.py +0 -47
- downshift_server-0.2.0/tests/test_render.py +0 -188
- downshift_server-0.2.0/tests/test_schemas.py +0 -38
- downshift_server-0.2.0/tests/test_serve.py +0 -184
- downshift_server-0.2.0/tests/test_settings.py +0 -61
- downshift_server-0.2.0/tests/test_shapes.py +0 -78
- downshift_server-0.2.0/tests/test_verify_internals.py +0 -35
- {downshift_server-0.2.0 → downshift_server-0.5.0}/src/downshift/adapters/__init__.py +0 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/src/downshift/cli/__init__.py +0 -0
- {downshift_server-0.2.0/src/downshift/export → downshift_server-0.5.0/src/downshift/core}/__init__.py +0 -0
- /downshift_server-0.2.0/src/downshift/serve/__init__.py → /downshift_server-0.5.0/src/downshift/py.typed +0 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/__init__.py +0 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/models/__init__.py +0 -0
- {downshift_server-0.2.0 → downshift_server-0.5.0}/tests/models/dynamic_batch_cnn.py +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, develop ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.12", "3.13", "3.14"]
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: ${{ matrix.python-version }}
|
|
20
|
+
cache: pip
|
|
21
|
+
- run: pip install torch --index-url https://download.pytorch.org/whl/cpu
|
|
22
|
+
- run: pip install -e ".[dev,gnn,hf,fast]"
|
|
23
|
+
- run: ruff check .
|
|
24
|
+
- run: ruff format --check .
|
|
25
|
+
- run: mypy src
|
|
26
|
+
- run: pytest -q --cov=src/downshift --cov-report=term-missing --cov-fail-under=95
|
|
27
|
+
|
|
28
|
+
floor:
|
|
29
|
+
# This job pins the oldest torch that the dynamo exporter supports (report= on
|
|
30
|
+
# torch.onnx.export is a feature of 2.5). It also pins the oldest onnx, onnxruntime and
|
|
31
|
+
# onnxscript that we verified locally for export and run with it. onnx 1.14 (the previous
|
|
32
|
+
# floor) does not install together with the requirement onnx>=1.16 of onnxscript. onnxscript
|
|
33
|
+
# below 0.5 has a real bug in the type-promotion pass of torch 2.5 on a plain Conv2d with a
|
|
34
|
+
# dynamic batch. Neither fault is specific to the code of this project. onnxruntime 1.17
|
|
35
|
+
# needs numpy<2 for its ABI.
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v4
|
|
39
|
+
- uses: actions/setup-python@v5
|
|
40
|
+
with:
|
|
41
|
+
python-version: "3.12"
|
|
42
|
+
cache: pip
|
|
43
|
+
- run: pip install "torch==2.5.1" --index-url https://download.pytorch.org/whl/cpu
|
|
44
|
+
# transformers 5.19 calls torch.accelerator (torch 2.6 and later) on import. 5.17.0 is the
|
|
45
|
+
# last release with which this job passed.
|
|
46
|
+
- run: pip install "onnx==1.16.0" "onnxruntime==1.17.0" "onnxscript==0.5.0" "numpy<2" "transformers==5.17.0"
|
|
47
|
+
- run: pip install -e ".[dev,gnn,hf,fast]"
|
|
48
|
+
- run: ruff check .
|
|
49
|
+
- run: ruff format --check .
|
|
50
|
+
- run: mypy src
|
|
51
|
+
- name: pytest
|
|
52
|
+
# The newest releases of transformers and torch-geometric that are compatible with these
|
|
53
|
+
# pins do not change this. The dynamo tracer of torch 2.5.1 cannot export a BertModel
|
|
54
|
+
# that is built from scratch with a dynamic sequence axis. It also cannot export a few
|
|
55
|
+
# PyG message-passing patterns (ConstraintViolationError or "Unsupported: call_method"
|
|
56
|
+
# from torch itself). These errors do not come from the code of this project, and no
|
|
57
|
+
# combination of onnx, onnxruntime and onnxscript that we tried fixes them. These tests
|
|
58
|
+
# have `@pytest.mark.needs_torch_26`. conftest.py skips them here, based on
|
|
59
|
+
# torch.__version__, until the floor moves above 2.5.x. All other tests run and pass,
|
|
60
|
+
# including the rest of the hf and gnn suites.
|
|
61
|
+
run: pytest -q
|
|
62
|
+
|
|
63
|
+
windows:
|
|
64
|
+
runs-on: windows-latest
|
|
65
|
+
steps:
|
|
66
|
+
- uses: actions/checkout@v4
|
|
67
|
+
- uses: actions/setup-python@v5
|
|
68
|
+
with:
|
|
69
|
+
python-version: "3.12"
|
|
70
|
+
cache: pip
|
|
71
|
+
- run: pip install torch --index-url https://download.pytorch.org/whl/cpu
|
|
72
|
+
- run: pip install -e ".[dev,gnn,hf,fast]"
|
|
73
|
+
- run: ruff check .
|
|
74
|
+
- run: ruff format --check .
|
|
75
|
+
- run: mypy src
|
|
76
|
+
- run: pytest -q --cov=src/downshift --cov-report=term-missing --cov-fail-under=95
|
{downshift_server-0.2.0 → downshift_server-0.5.0}/.github/workflows/compatibility-matrix.yml
RENAMED
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
name: Compatibility matrix
|
|
2
|
-
|
|
3
|
-
# The matrix is the
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- uses: actions/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- run: pip install -
|
|
25
|
-
- run:
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
name: Compatibility matrix
|
|
2
|
+
|
|
3
|
+
# The matrix is the core claim of the project. An old matrix is worse than no matrix. The job
|
|
4
|
+
# therefore regenerates it every week against the current torch and onnxruntime. It opens a PR if
|
|
5
|
+
# the matrix changes.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: "0 6 * * 1" # Mondays 06:00 UTC
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
regenerate:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
contents: write
|
|
17
|
+
pull-requests: write
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
- uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: "3.12"
|
|
23
|
+
cache: pip
|
|
24
|
+
- run: pip install torch --index-url https://download.pytorch.org/whl/cpu
|
|
25
|
+
- run: pip install -e ".[dev,gnn,hf]"
|
|
26
|
+
- run: python scripts/gen_matrix.py
|
|
27
|
+
- uses: peter-evans/create-pull-request@v7
|
|
28
|
+
with:
|
|
29
|
+
commit-message: "docs: regenerate compatibility matrix"
|
|
30
|
+
title: "Weekly compatibility matrix refresh"
|
|
31
|
+
body: "Automated run of `scripts/gen_matrix.py` against current torch / onnxruntime."
|
|
32
|
+
branch: ci/compatibility-matrix
|
|
33
|
+
add-paths: |
|
|
34
|
+
docs/compatibility.md
|
|
35
|
+
README.md
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# The publication of a GitHub Release starts this job. The tag of that release must match the
|
|
4
|
+
# version in pyproject.toml. The tests must pass on it. Only then do the sdist and the wheel go
|
|
5
|
+
# to PyPI. workflow_dispatch runs only the build gates and the test gates. It publishes nothing.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
release:
|
|
9
|
+
types: [published]
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
- uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: "3.12"
|
|
23
|
+
cache: pip
|
|
24
|
+
|
|
25
|
+
- run: pip install build twine
|
|
26
|
+
|
|
27
|
+
# A release with the tag v0.1.9 that ships 0.2.0 cannot be repaired. PyPI never accepts
|
|
28
|
+
# a second upload of a version. Fail here and not after the upload.
|
|
29
|
+
- name: Check tag matches pyproject version
|
|
30
|
+
if: github.event_name == 'release'
|
|
31
|
+
run: |
|
|
32
|
+
project_version=$(python -c "import tomllib,pathlib; print(tomllib.loads(pathlib.Path('pyproject.toml').read_text())['project']['version'])")
|
|
33
|
+
tag_version="${GITHUB_REF_NAME#v}"
|
|
34
|
+
echo "pyproject: $project_version / tag: $tag_version"
|
|
35
|
+
if [ "$project_version" != "$tag_version" ]; then
|
|
36
|
+
echo "::error::Tag $GITHUB_REF_NAME does not match pyproject.toml version $project_version"
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
- run: python -m build
|
|
41
|
+
- run: twine check --strict dist/*
|
|
42
|
+
|
|
43
|
+
- uses: actions/upload-artifact@v4
|
|
44
|
+
with:
|
|
45
|
+
name: dist
|
|
46
|
+
path: dist/
|
|
47
|
+
|
|
48
|
+
test:
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
strategy:
|
|
51
|
+
matrix:
|
|
52
|
+
python-version: ["3.12", "3.13", "3.14"]
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/checkout@v4
|
|
55
|
+
- uses: actions/setup-python@v5
|
|
56
|
+
with:
|
|
57
|
+
python-version: ${{ matrix.python-version }}
|
|
58
|
+
cache: pip
|
|
59
|
+
- run: pip install torch --index-url https://download.pytorch.org/whl/cpu
|
|
60
|
+
- run: pip install -e ".[dev,gnn,hf,fast]"
|
|
61
|
+
- run: ruff check .
|
|
62
|
+
- run: ruff format --check .
|
|
63
|
+
- run: mypy src
|
|
64
|
+
- run: pytest -q --cov=src/downshift --cov-report=term-missing --cov-fail-under=95
|
|
65
|
+
|
|
66
|
+
publish-pypi:
|
|
67
|
+
if: github.event_name == 'release'
|
|
68
|
+
needs: [build, test]
|
|
69
|
+
runs-on: ubuntu-latest
|
|
70
|
+
environment:
|
|
71
|
+
name: pypi
|
|
72
|
+
url: https://pypi.org/p/downshift-server
|
|
73
|
+
permissions:
|
|
74
|
+
id-token: write # OIDC token for PyPI trusted publishing
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/download-artifact@v4
|
|
77
|
+
with:
|
|
78
|
+
name: dist
|
|
79
|
+
path: dist/
|
|
80
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
81
|
+
|
|
82
|
+
attach-to-release:
|
|
83
|
+
if: github.event_name == 'release'
|
|
84
|
+
needs: publish-pypi
|
|
85
|
+
runs-on: ubuntu-latest
|
|
86
|
+
permissions:
|
|
87
|
+
contents: write
|
|
88
|
+
steps:
|
|
89
|
+
- uses: actions/download-artifact@v4
|
|
90
|
+
with:
|
|
91
|
+
name: dist
|
|
92
|
+
path: dist/
|
|
93
|
+
- name: Upload sdist and wheel to the GitHub Release
|
|
94
|
+
env:
|
|
95
|
+
GH_TOKEN: ${{ github.token }}
|
|
96
|
+
run: gh release upload "$GITHUB_REF_NAME" dist/* --clobber --repo "$GITHUB_REPOSITORY"
|
|
@@ -1,48 +1,53 @@
|
|
|
1
|
-
# Python
|
|
2
|
-
__pycache__/
|
|
3
|
-
*.py[cod]
|
|
4
|
-
*$py.class
|
|
5
|
-
*.so
|
|
6
|
-
.Python
|
|
7
|
-
*.egg-info/
|
|
8
|
-
dist/
|
|
9
|
-
build/
|
|
10
|
-
|
|
11
|
-
# Virtual environments
|
|
12
|
-
.venv/
|
|
13
|
-
venv/
|
|
14
|
-
ENV/
|
|
15
|
-
env/
|
|
16
|
-
|
|
17
|
-
# IDEs
|
|
18
|
-
.vscode/
|
|
19
|
-
.idea/
|
|
20
|
-
*.swp
|
|
21
|
-
*.swo
|
|
22
|
-
*~
|
|
23
|
-
|
|
24
|
-
# Testing
|
|
25
|
-
.pytest_cache/
|
|
26
|
-
.mypy_cache/
|
|
27
|
-
.ruff_cache/
|
|
28
|
-
htmlcov/
|
|
29
|
-
.coverage
|
|
30
|
-
|
|
31
|
-
# OS
|
|
32
|
-
.DS_Store
|
|
33
|
-
Thumbs.db
|
|
34
|
-
|
|
35
|
-
# Project-specific
|
|
36
|
-
*.onnx
|
|
37
|
-
*.onnx.data
|
|
38
|
-
artifacts/
|
|
39
|
-
tmp/
|
|
40
|
-
|
|
41
|
-
# Local tooling config
|
|
42
|
-
.claude/
|
|
43
|
-
.docs/
|
|
44
|
-
|
|
45
|
-
# Local pre-publish validation: hits test.pypi.org/pypi.org and builds a throwaway venv;
|
|
46
|
-
# not part of the package or CI, kept out of version control on purpose.
|
|
47
|
-
scripts/validate_pypi_release.py
|
|
48
|
-
scripts/.validation/
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
*.egg-info/
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
|
|
11
|
+
# Virtual environments
|
|
12
|
+
.venv/
|
|
13
|
+
venv/
|
|
14
|
+
ENV/
|
|
15
|
+
env/
|
|
16
|
+
|
|
17
|
+
# IDEs
|
|
18
|
+
.vscode/
|
|
19
|
+
.idea/
|
|
20
|
+
*.swp
|
|
21
|
+
*.swo
|
|
22
|
+
*~
|
|
23
|
+
|
|
24
|
+
# Testing
|
|
25
|
+
.pytest_cache/
|
|
26
|
+
.mypy_cache/
|
|
27
|
+
.ruff_cache/
|
|
28
|
+
htmlcov/
|
|
29
|
+
.coverage
|
|
30
|
+
|
|
31
|
+
# OS
|
|
32
|
+
.DS_Store
|
|
33
|
+
Thumbs.db
|
|
34
|
+
|
|
35
|
+
# Project-specific
|
|
36
|
+
*.onnx
|
|
37
|
+
*.onnx.data
|
|
38
|
+
artifacts/
|
|
39
|
+
tmp/
|
|
40
|
+
|
|
41
|
+
# Local tooling config
|
|
42
|
+
.claude/
|
|
43
|
+
.docs/
|
|
44
|
+
|
|
45
|
+
# Local pre-publish validation: hits test.pypi.org/pypi.org and builds a throwaway venv;
|
|
46
|
+
# not part of the package or CI, kept out of version control on purpose.
|
|
47
|
+
scripts/validate_pypi_release.py
|
|
48
|
+
scripts/.validation/
|
|
49
|
+
|
|
50
|
+
# Benchmark harness: scripts and published runs are tracked; the downloaded Hugging Face
|
|
51
|
+
# checkpoints (GBs) and ad-hoc output are not. See bench/README.md.
|
|
52
|
+
bench/models/
|
|
53
|
+
bench/scratch/
|