Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
Comment thread
zywind marked this conversation as resolved.
Resolved
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Durable implementation guidance belongs with the code it describes: function and

See [STYLE_GUIDE.md](STYLE_GUIDE.md) for detailed code style conventions (Python, markdown, Dockerfiles, shell scripts, testing, config files, docstrings).

Use `uv` for everything -- never `pip` or raw `python`. Python 3.11–3.13 with modern syntax (`X | Y`, `list[str]`, `Self`). Python 3.14+ is not supported.
Use `uv` for everything -- never `pip` or raw `python`. Python 3.11–3.14 with modern syntax (`X | Y`, `list[str]`, `Self`).

Common commands: `mise run test` (unit tests), `mise run format` (auto-fix formatting + lint + copyright), `mise run check` (read-only local quality checks), `mise run validate` (pre-PR quality, lock, and CI unit checks), `mise run typecheck` (ty only). Always use mise tasks or the wrapper scripts in `tools/` instead of running `ruff` or `ty` directly. Use `uv run` for Python execution. When in doubt, inspect `mise tasks` and `pytest --markers`.

Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Please read our [Code of Conduct](CODE_OF_CONDUCT.md) before contributing.

### Prerequisites

- Python 3.11–3.13 (project supports Python 3.11, 3.12, and 3.13; `.python-version` pins 3.13 for bootstrapping at the repo root. Python 3.14+ is not supported — see [Troubleshooting](docs/user-guide/troubleshooting.md#python-314-is-not-supported))
- Python 3.11–3.14 (project supports Python 3.11, 3.12, 3.13, and 3.14; `.python-version` pins 3.13 for bootstrapping at the repo root)
- Git 2.34+ (minimum required for SSH commit signing)

> Note: Other tools like [uv](https://docs.astral.sh/uv/), [dprint](https://dprint.dev/), [ruff](https://docs.astral.sh/ruff/), [ty](https://github.com/astral-sh/ty), and [gh](https://cli.github.com/) are installed automatically by `make setup` (via [mise](https://mise.jdx.dev/)). Tool versions are declared in `.mise.toml` and locked in `mise.lock` (committed), ensuring reproducible toolchains across developer systems and CI. These should not interfere with locally installed tools.
Expand Down Expand Up @@ -786,8 +786,9 @@ uv --no-config pip install \
--python "${SMOKE_VENV}/bin/python" \
--default-index https://pypi.org/simple \
--index https://flashinfer.ai/whl/cu129 \
--index https://flashinfer.ai/whl/ \
--index https://download.pytorch.org/whl/cu129 \
--index https://wheels.vllm.ai/ee0da84ab9e04ac7610e28580af62c365e898389/cu129 \
--index https://wheels.vllm.ai/0.26.0/cu129 \
--index-strategy unsafe-best-match \
"nemo-safe-synthesizer[cu129,engine]==${NSS_VERSION}"
uv --no-config pip check --python "${SMOKE_VENV}/bin/python"
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Read detailed usage below, or jump to the documentation with [Getting Started](h

### Prerequisites

- Python 3.11–3.13 (`.python-version` pins 3.13 for local/dev bootstrap; any 3.11, 3.12, or 3.13 interpreter works. Python 3.14+ is NOT supported because vLLM currently declares `<3.14` support while upstream resolves Python 3.14 wheel compatibility across its dependency stack)
- Python 3.11–3.14 (`.python-version` pins 3.13 for local/dev bootstrap; any 3.11, 3.12, 3.13, or 3.14 interpreter works)
- [uv](https://docs.astral.sh/uv/) (recommended) or pip -- Python package manager
- NVIDIA GPU (A100 or larger) for training and generation
- Linux only -- macOS, Windows, and Apple Silicon are not supported for training or generation. A CPU-only install is available for development and configuration validation.
Expand All @@ -20,15 +20,17 @@ Read detailed usage below, or jump to the documentation with [Getting Started](h
# With uv (recommended):
uv pip install "nemo-safe-synthesizer[cu129,engine]" \
--index https://flashinfer.ai/whl/cu129 \
--index https://flashinfer.ai/whl/ \
--index https://download.pytorch.org/whl/cu129 \
--index https://wheels.vllm.ai/ee0da84ab9e04ac7610e28580af62c365e898389/cu129 \
--index https://wheels.vllm.ai/0.26.0/cu129 \
--index-strategy unsafe-best-match

# With pip:
pip install "nemo-safe-synthesizer[cu129,engine]" \
--extra-index-url https://download.pytorch.org/whl/cu129 \
--extra-index-url https://flashinfer.ai/whl/cu129 \
--extra-index-url https://wheels.vllm.ai/ee0da84ab9e04ac7610e28580af62c365e898389/cu129
--extra-index-url https://flashinfer.ai/whl/ \
--extra-index-url https://wheels.vllm.ai/0.26.0/cu129
```

Or install from source:
Expand Down
2 changes: 1 addition & 1 deletion STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ How to write clear, testable Python -- independent of which library primitives y

### Type hints

The codebase targets Python 3.11–3.13 and uses native typing syntax throughout. Expect 3.11 as the minimum for the foreseeable future; the upper bound tracks dependency availability (currently vLLM declares `<3.14` support while its dependency stack gains full `cp314` wheel coverage).
The codebase targets Python 3.11–3.14 and uses native typing syntax throughout. Expect 3.11 as the minimum for the foreseeable future; the upper bound tracks dependency availability (`requires-python` is currently `<3.15`).

Even though `.python-version` pins Python 3.13 for local development and CI defaults, shared package code must stay Python 3.11 syntax-compatible until the NMP platform moves its base Python version to 3.12. Do not use Python 3.12-only syntax yet, including PEP 695 `type` statements or bracketed generic class/function parameters. Prefer `TypeAlias`, `TypeVar`, and `typing_extensions` backports when newer typing features are useful before the minimum runtime moves.

Expand Down
4 changes: 3 additions & 1 deletion containers/Dockerfile.test_ci
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
--no-sources \
--default-index https://pypi.org/simple \
--index https://download.pytorch.org/whl/cpu \
--index https://flashinfer.ai/whl/ \
--index-strategy unsafe-best-match \
"nemo-safe-synthesizer[cpu,engine] @ file://${wheel}" && \
uv --no-config pip check --python /opt/wheel-cpu/bin/python && \
Expand All @@ -53,8 +54,9 @@ RUN --mount=type=cache,target=/root/.cache/uv \
--dry-run \
--default-index https://pypi.org/simple \
--index https://flashinfer.ai/whl/cu129 \
--index https://flashinfer.ai/whl/ \
--index https://download.pytorch.org/whl/cu129 \
--index https://wheels.vllm.ai/ee0da84ab9e04ac7610e28580af62c365e898389/cu129 \
--index https://wheels.vllm.ai/0.26.0/cu129 \
--index-strategy unsafe-best-match \
"nemo-safe-synthesizer[cu129,engine] @ file://${wheel}" && \
rm -rf /opt/wheel-cpu /opt/wheel-cu129
Expand Down
30 changes: 22 additions & 8 deletions cuda_deps.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ base_runtime_deps = []
torch_runtime_deps = [
"accelerate>=1.1.0",
"bitsandbytes>=0.46.1",
"flashinfer-python==0.6.12; sys_platform == 'linux'",
"flashinfer-cubin==0.6.12; sys_platform == 'linux'",
"flashinfer-python==0.6.14; sys_platform == 'linux'",
"flashinfer-cubin==0.6.14; sys_platform == 'linux'",
"gliner",
"kernels>=0.12.1,<0.15",
"opacus",
"peft>=0.18.0",
"sentence-transformers",
"openai>=2.25.0",
"trl>=0.23.0",
"xgrammar>=0.2.0; sys_platform == 'linux'",
]

cuda_runtime_deps = [
{ name = "flashinfer-jit-cache", version = "0.6.12", local = "{torch_local_version}", sys_platform = "linux", source_kind = "flashinfer" },
{ name = "flashinfer-jit-cache", version = "0.6.14", local = "{torch_local_version}", sys_platform = "linux", source_kind = "flashinfer" },
{ name = "nvidia-cublas-{cuda_package_suffix}", sys_platform = "linux" },
"nvidia-ml-py; sys_platform == 'linux'",
"torch-c-dlpack-ext",
Expand Down Expand Up @@ -64,7 +65,7 @@ dependencies = [
"torchao==0.17.0",
"transformers==5.12.0",
"triton>=2.0.0; sys_platform=='linux'",
"vllm==0.24.0; sys_platform=='linux'",
"vllm==0.26.0; sys_platform=='linux'",
]

[[indexes]]
Expand All @@ -83,8 +84,13 @@ url = "https://pypi.nvidia.com"
explicit = true

[[indexes]]
name = "vllm-v0-24-0-cu129"
url = "https://wheels.vllm.ai/ee0da84ab9e04ac7610e28580af62c365e898389/cu129"
name = "flashinfer-cubin"
url = "https://flashinfer.ai/whl/"
explicit = true

[[indexes]]
name = "vllm-v0-26-0-cu129"
url = "https://wheels.vllm.ai/0.26.0/cu129"
explicit = true

[cuda_indexes.pytorch]
Expand All @@ -99,13 +105,21 @@ explicit = true

# Static source entries are grouped by the extra they activate. The generator
# supplies that extra and rejects a conflicting explicit value.
[sources.cpu]
flashinfer-cubin = [
{ index = "flashinfer-cubin", marker = "sys_platform == 'linux'" },
]

[sources.cu129]
flashinfer-cubin = [
{ index = "flashinfer-cubin", marker = "sys_platform == 'linux'" },
]
vllm = [
{ index = "vllm-v0-24-0-cu129", marker = "sys_platform == 'linux'", extra = "cu129" },
{ index = "vllm-v0-26-0-cu129", marker = "sys_platform == 'linux'", extra = "cu129" },
]

[variants.cu129]
cuda_package_suffix = "cu12"
dependencies = [
"vllm==0.24.0+{torch_local_version}; sys_platform == 'linux'",
"vllm==0.26.0+{torch_local_version}; sys_platform == 'linux'",
]
3 changes: 2 additions & 1 deletion docs/dev-notes/posts/introducing-nemo-safe-synthesizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ Each score maps to concrete remediation guidance in the documentation. The [Prod
pip install "nemo-safe-synthesizer[cu129,engine]" \
--extra-index-url https://download.pytorch.org/whl/cu129 \
--extra-index-url https://flashinfer.ai/whl/cu129 \
--extra-index-url https://wheels.vllm.ai/ee0da84ab9e04ac7610e28580af62c365e898389/cu129
--extra-index-url https://flashinfer.ai/whl/ \
--extra-index-url https://wheels.vllm.ai/0.26.0/cu129
```

The quickest way to run your first pipeline is the CLI:
Expand Down
13 changes: 11 additions & 2 deletions docs/tutorials/differential-privacy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,19 @@
"# SPDX-License-Identifier: Apache-2.0\n",
"\n",
"if command -v uv > /dev/null 2>&1; then\n",
" uv pip install \"nemo-safe-synthesizer[engine,cu129]\" --index https://flashinfer.ai/whl/cu129 --index https://download.pytorch.org/whl/cu129 --index https://wheels.vllm.ai/ee0da84ab9e04ac7610e28580af62c365e898389/cu129 --index-strategy unsafe-best-match\n",
" uv pip install \"nemo-safe-synthesizer[engine,cu129]\" \\\n",
" --index https://flashinfer.ai/whl/cu129 \\\n",
" --index https://flashinfer.ai/whl/ \\\n",
" --index https://download.pytorch.org/whl/cu129 \\\n",
" --index https://wheels.vllm.ai/0.26.0/cu129 \\\n",
" --index-strategy unsafe-best-match\n",
" uv pip install kagglehub\n",
"else\n",
" pip install \"nemo-safe-synthesizer[engine,cu129]\" --extra-index-url https://flashinfer.ai/whl/cu129 --extra-index-url https://download.pytorch.org/whl/cu129 --extra-index-url https://wheels.vllm.ai/ee0da84ab9e04ac7610e28580af62c365e898389/cu129\n",
" pip install \"nemo-safe-synthesizer[engine,cu129]\" \\\n",
" --extra-index-url https://flashinfer.ai/whl/cu129 \\\n",
" --extra-index-url https://flashinfer.ai/whl/ \\\n",
" --extra-index-url https://download.pytorch.org/whl/cu129 \\\n",
" --extra-index-url https://wheels.vllm.ai/0.26.0/cu129\n",
" pip install kagglehub\n",
"fi\n"
]
Expand Down
13 changes: 11 additions & 2 deletions docs/tutorials/safe-synthesizer-101.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,19 @@
"# SPDX-License-Identifier: Apache-2.0\n",
"\n",
"if command -v uv > /dev/null 2>&1; then\n",
" uv pip install \"nemo-safe-synthesizer[engine,cu129]\" --index https://flashinfer.ai/whl/cu129 --index https://download.pytorch.org/whl/cu129 --index https://wheels.vllm.ai/ee0da84ab9e04ac7610e28580af62c365e898389/cu129 --index-strategy unsafe-best-match\n",
" uv pip install \"nemo-safe-synthesizer[engine,cu129]\" \\\n",
" --index https://flashinfer.ai/whl/cu129 \\\n",
" --index https://flashinfer.ai/whl/ \\\n",
" --index https://download.pytorch.org/whl/cu129 \\\n",
" --index https://wheels.vllm.ai/0.26.0/cu129 \\\n",
" --index-strategy unsafe-best-match\n",
" uv pip install datasets\n",
"else\n",
" pip install \"nemo-safe-synthesizer[engine,cu129]\" --extra-index-url https://flashinfer.ai/whl/cu129 --extra-index-url https://download.pytorch.org/whl/cu129 --extra-index-url https://wheels.vllm.ai/ee0da84ab9e04ac7610e28580af62c365e898389/cu129\n",
" pip install \"nemo-safe-synthesizer[engine,cu129]\" \\\n",
" --extra-index-url https://flashinfer.ai/whl/cu129 \\\n",
" --extra-index-url https://flashinfer.ai/whl/ \\\n",
" --extra-index-url https://download.pytorch.org/whl/cu129 \\\n",
" --extra-index-url https://wheels.vllm.ai/0.26.0/cu129\n",
" pip install datasets\n",
"fi\n"
]
Expand Down
13 changes: 11 additions & 2 deletions docs/tutorials/time-series-financial-transactions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,18 @@
"# SPDX-License-Identifier: Apache-2.0\n",
"\n",
"if command -v uv > /dev/null 2>&1; then\n",
" uv pip install \"nemo-safe-synthesizer[engine,cu129]\" --index https://flashinfer.ai/whl/cu129 --index https://download.pytorch.org/whl/cu129 --index https://wheels.vllm.ai/ee0da84ab9e04ac7610e28580af62c365e898389/cu129 --index-strategy unsafe-best-match\n",
" uv pip install \"nemo-safe-synthesizer[engine,cu129]\" \\\n",
" --index https://flashinfer.ai/whl/cu129 \\\n",
" --index https://flashinfer.ai/whl/\\\n",
" --index https://download.pytorch.org/whl/cu129 \\\n",
" --index https://wheels.vllm.ai/0.26.0/cu129 \\\n",
" --index-strategy unsafe-best-match\n",
"else\n",
" pip install \"nemo-safe-synthesizer[engine,cu129]\" --extra-index-url https://flashinfer.ai/whl/cu129 --extra-index-url https://download.pytorch.org/whl/cu129 --extra-index-url https://wheels.vllm.ai/ee0da84ab9e04ac7610e28580af62c365e898389/cu129\n",
" pip install \"nemo-safe-synthesizer[engine,cu129]\" \\\n",
" --extra-index-url https://flashinfer.ai/whl/cu129 \\\n",
" --extra-index-url https://flashinfer.ai/whl/ \\\n",
" --extra-index-url https://download.pytorch.org/whl/cu129 \\\n",
" --extra-index-url https://wheels.vllm.ai/0.26.0/cu129\n",
"fi"
]
},
Expand Down
8 changes: 5 additions & 3 deletions docs/user-guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ does at each stage.

### Prerequisites

- Python 3.11–3.13 (dev tooling pins 3.13 via `.python-version` in the repo root; Python 3.14+ is not supported -- see [Troubleshooting](troubleshooting.md#python-314-is-not-supported))
- Python 3.11–3.14 (dev tooling pins 3.13 via `.python-version` in the repo root)
- CUDA runtime 12.9+
- NVIDIA GPU (A100 or larger) for training and generation

Expand All @@ -37,16 +37,18 @@ indexes outside PyPI. You must pass the extra index URLs shown below.
pip install "nemo-safe-synthesizer[cu129,engine]" \
--extra-index-url https://download.pytorch.org/whl/cu129 \
--extra-index-url https://flashinfer.ai/whl/cu129 \
--extra-index-url https://wheels.vllm.ai/ee0da84ab9e04ac7610e28580af62c365e898389/cu129
--extra-index-url https://flashinfer.ai/whl/ \
--extra-index-url https://wheels.vllm.ai/0.26.0/cu129
```

=== "uv"

```bash
uv pip install "nemo-safe-synthesizer[cu129,engine]" \
--index https://flashinfer.ai/whl/cu129 \
--index https://flashinfer.ai/whl/ \
--index https://download.pytorch.org/whl/cu129 \
--index https://wheels.vllm.ai/ee0da84ab9e04ac7610e28580af62c365e898389/cu129 \
--index https://wheels.vllm.ai/0.26.0/cu129 \
--index-strategy unsafe-best-match
```

Expand Down
19 changes: 8 additions & 11 deletions docs/user-guide/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ configuration, and NER parallelism, see [Environment Variables](environment.md).

| Symptom | Likely Cause | Fix |
|---------|-------------|-----|
| Install fails on Python 3.14 | vLLM and dependency wheels are not ready | [Use Python 3.11–3.13](#python-314-is-not-supported) |
| Install fails on Python 3.15+ | Outside `requires-python` upper bound | [Use Python 3.11–3.14](#unsupported-python-versions) |
| "kernels package not installed" | Optional Kernels Hub backend selected without `kernels` installed | Set `training.attn_implementation: sdpa` |
| `ConnectionError` during startup | No internet / model not cached | [Pre-cache models](environment.md#pre-caching-models) |
| OOM in training | VRAM exhausted | [Reduce batch size, quantize](#out-of-memory-during-training) |
Expand Down Expand Up @@ -71,15 +71,15 @@ configuration reference.
`uv sync` fails with an error mentioning incompatible `transformers` and
`vllm` requirements.

Safe Synthesizer requires `transformers>=5.12,<5.12.1` with vLLM 0.24.0.
Safe Synthesizer requires `transformers>=5.12,<5.12.1` with vLLM 0.26.0.
Keep vLLM's constraints intact so the resolver selects the tested
Transformers/vLLM pairing.

```toml
[project]
dependencies = [
"transformers>=5.12,<5.12.1",
"vllm==0.24.0",
"vllm==0.26.0",
]
```

Expand Down Expand Up @@ -108,12 +108,10 @@ The warning is informational. To suppress it, switch to a model with a
fast tokenizer (most popular models do; check
`AutoTokenizer.from_pretrained(model).is_fast`).

### Python 3.14 Is Not Supported
### Unsupported Python Versions

Safe Synthesizer requires **Python 3.11, 3.12, or 3.13**. Python 3.14+ is not
supported because vLLM currently declares `<3.14` support while upstream
resolves Python 3.14 wheel compatibility across its dependency stack. Attempting
to install on Python 3.14 fails with an unresolvable dependency error during
Safe Synthesizer supports Python 3.11, 3.12, 3.13, and 3.14. Python 3.15+ is
not supported. Attempting to install on an unsupported interpreter fails during
`pip install` or `uv pip install`.

To fix, create a virtual environment with a supported interpreter:
Expand All @@ -123,9 +121,8 @@ uv venv --python 3.13
source .venv/bin/activate
```

The project's `pyproject.toml` enforces `requires-python = ">=3.11, <3.14"`, so
package managers will reject the install on unsupported versions. This upper
bound will be raised once all transitive dependencies ship `cp314` wheels.
The project's `pyproject.toml` enforces `requires-python = ">=3.11, <3.15"`, so
package managers will reject the install on unsupported versions.

---

Expand Down
Loading
Loading