chore: upgrade vLLM to 0.20.0, cuda to 12.9 - #464
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
b866117 to
4a11f2b
Compare
19c6a3c to
52c86b0
Compare
|
/sync |
| ), | ||
| ), | ||
| ] = "kernels-community/vllm-flash-attn3" | ||
| ] = "sdpa" |
There was a problem hiding this comment.
let's try FLASH_ATTN- should be bundled.
There was a problem hiding this comment.
uh oh
FAILED tests/e2e/test_safe_synthesizer.py::test_train_and_generate_defaults - ValueError: Specified attn_implementation="FLASH_ATTN" is not supported. The only possible arguments are attn_implementation="eager", "attn_implementation=flash_attention_3", "attn_implementation=flash_attention_2", "attn_implementation=sdpa", "attn_implementation=flex_attention"`.
There was a problem hiding this comment.
flash_attention_3 - my bad. if we have to do spda then that's alright for a bit
There was a problem hiding this comment.
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=============================================================================== short test summary info ===============================================================================
FAILED tests/e2e/test_safe_synthesizer.py::test_train_and_generate_defaults - ImportError: FlashAttention3 has been toggled on, but it cannot be used due to the following error: the package flash_attn_3 seems to be not installed.
gadzooks, looks like we need another dep? (I tried it but saw it wasn't installed)
52c86b0 to
87bc009
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (32)
✅ Files skipped from review due to trivial changes (17)
🚧 Files skipped from review as they are similar to previous changes (14)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🧰 Additional context used📓 Path-based instructions (6)**/*.sh📄 CodeRabbit inference engine (STYLE_GUIDE.md)
Files:
⚙️ CodeRabbit configuration file
Files:
**/*.{py,sh,yaml,yml}📄 CodeRabbit inference engine (STYLE_GUIDE.md)
Files:
**/*📄 CodeRabbit inference engine (STYLE_GUIDE.md)
Files:
⚙️ CodeRabbit configuration file
Files:
**/*.{sh,bash}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{py,sh,yaml,yml,md}📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
script/**⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (1)📓 Common learnings🪛 Shellcheck (0.11.0)script/slurm/slurm_nss_matrix.sh[info] 123-123: Not following: ./.venv/bin/activate was not specified as input (see shellcheck -x). (SC1091) 🔇 Additional comments (1)
WalkthroughThis PR upgrades CUDA from version 12.8 to 12.9 across the codebase, changes the default attention implementation from a kernels-community vLLM backend to PyTorch SDPA, updates PyTorch/FlashInfer/vLLM versions, disables vLLM deep_gemm by default, and revises all documentation and tests accordingly. ChangesCUDA 12.9 & Attention Implementation Upgrade
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Trivy (0.69.3)Trivy execution failed: 2026-05-14T17:42:18Z FATAL Fatal error run error: fs scan error: scan error: scan failed: failed analysis: post analysis error: post analysis error: kubernetes scan error: fs filter error: fs filter error: walk error range error: stat .coderabbit-opengrep-fallback.yml: no such file or directory: range error: stat .coderabbit-opengrep-fallback.yml: no such file or directory Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (6)
docs/user-guide/docker.md (1)
16-23:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate the CUDA verification image to match the 12.9 prerequisite.
Line 16 documents CUDA 12.9 as the baseline, but the verification command on line 22 uses
cuda:12.8.1-runtime-ubuntu22.04. This mismatch can lead to environment checks against the wrong version. Per the documentation guidelines for this file, the GPU verification snippet should reflect the supported CUDA version.Suggested patch
-docker run --rm --gpus all nvidia/cuda:12.8.1-runtime-ubuntu22.04 nvidia-smi +docker run --rm --gpus all nvidia/cuda:12.9.0-runtime-ubuntu22.04 nvidia-smiREADME.md (1)
208-228:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winFix the training attention example before users copy it.
The example now says
spda, but the valid value in the table issdpa, and the paragraph/table still describe the oldkernels-community/vllm-flash-attn3default. Copy-pasting this section now either passes an invalid backend name or teaches the pre-PR default. Please update the example and the default/fallback text together.src/nemo_safe_synthesizer/config/training.py (1)
245-259:⚠️ Potential issue | 🟠 Major | ⚡ Quick winFix config default to use a valid HuggingFace attention implementation identifier.
attn_implementationdefaults to"FLASH_ATTN", which is not a valid HuggingFace attention implementation. The field feeds HuggingFace's model loader via_resolve_attn_implementation(), which passes non-kernels-community/values through as-is. This means"FLASH_ATTN"will be rejected by HuggingFace. The description correctly documents valid HF values (sdpa,eager,flash_attention_2), and tests reset the field to"sdpa", indicating that is the intended default. Change the default from"FLASH_ATTN"to"sdpa"(or another valid HF identifier you intend), and ensure the description and implementation remain aligned.docs/developer-guide/docker.md (1)
99-105:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate the Build Arguments table default for
CUDA_VERSION.The table still lists
12.8.1, but this PR moves the Docker stack to12.9.1. That mismatch can cause users to build against the wrong CUDA base if they follow the table.Suggested doc fix
-| `CUDA_VERSION` | `12.8.1` | CUDA toolkit version in the base image tag | +| `CUDA_VERSION` | `12.9.1` | CUDA toolkit version in the base image tag |As per coding guidelines: "If CUDA version or extras change, update the documented CUDA base image tags."
.agents/skills/uv-build/SKILL.md (1)
5-5:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate stale trigger keyword from
cu128tocu129.Line 5 still lists
cu128in the skill trigger description, which is now out of sync with the rest of this skill doc and can misroute trigger matching.Proposed fix
-description: "uv package management, dependency groups, PyTorch index handling, hatch build system, and versioning for this repo. Triggers on: uv, uv sync, uv lock, uv add, uv build, dependency, pyproject.toml, extras, cpu, cu128, hatch, wheel, version, publish." +description: "uv package management, dependency groups, PyTorch index handling, hatch build system, and versioning for this repo. Triggers on: uv, uv sync, uv lock, uv add, uv build, dependency, pyproject.toml, extras, cpu, cu129, hatch, wheel, version, publish."Makefile (1)
89-96:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winSync
bootstrap-nssusage text with supported extras.Lines 89 and 95 still advertise
{dev,engine,cpu,cuda}even thoughcu129is now a first-class extra. This creates avoidable workflow confusion when reading in-file help.Proposed fix
-# Usage: make bootstrap-nss {dev,engine,cpu,cuda} +# Usage: make bootstrap-nss {dev,engine,cpu,cuda,cu129} ... -bootstrap-nss: .venv ## Bootstrap Python dependencies. Usage: make bootstrap-nss {dev,engine,cpu,cuda} +bootstrap-nss: .venv ## Bootstrap Python dependencies. Usage: make bootstrap-nss {dev,engine,cpu,cuda,cu129}As per coding guidelines: “Treat Makefile targets as the validation source of truth. Check that new targets are documented with target-name: ## Description...”.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: ec1cf8d1-908f-4de0-b7a9-4fd65ed3e735
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock,!uv.lock
📒 Files selected for processing (28)
.agents/skills/git-worktrees/SKILL.md.agents/skills/uv-build/SKILL.md.claude/commands/bootstrap.md.coderabbit.yaml.cursor/setup-worktree.sh.github/actions/setup-gpu-test-env/action.ymlAGENTS.mdCONTRIBUTING.mdMakefileREADME.mdcontainers/Dockerfile.cudadocs/developer-guide/docker.mddocs/index.mddocs/user-guide/configuration.mddocs/user-guide/docker.mddocs/user-guide/getting-started.mdpyproject.tomlscript/slurm/README.mdscript/slurm/slurm_nss_matrix.shsrc/nemo_safe_synthesizer/config/training.pysrc/nemo_safe_synthesizer/defaults.pysrc/nemo_safe_synthesizer/generation/regex_manager.pysrc/nemo_safe_synthesizer/generation/vllm_backend.pytests/TESTING.mdtests/e2e/test_dataset_config.pytests/e2e/test_safe_synthesizer.pytests/evaluation/components/benchmark_nearest_neighbor.pytests/training/test_huggingface_backend.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Unit Tests (3.11)
- GitHub Check: Unit Tests (3.13)
- GitHub Check: Unit Tests (3.12)
🧰 Additional context used
📓 Path-based instructions (28)
**/*.md
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
**/*.md: Do not use decorative**bold**in body text, list items, or docstrings. Use headers, list markers, colons, and backticks for structure. Bold is acceptable in table header-like cells and MkDocs Material card grid titles.
Use--(em-dash) for asides, not-(hyphen).
Use single backticks for code identifiers, paths, and CLI commands in Markdown.
UseMermaiddiagrams with no spaces in node IDs, quoted labels with special characters, and no explicit colors or styles.
Include SPDX copyright header at the top using HTML-comment syntax (<!-- ... -->).
If a Markdown file starts with YAML frontmatter (---), place the SPDX copyright header inside the frontmatter block using hash-comment syntax, not HTML comments.
Limit line length to 120 characters in Markdown files.
Files:
docs/user-guide/docker.mddocs/user-guide/configuration.mddocs/index.mdscript/slurm/README.mdtests/TESTING.mdAGENTS.mdREADME.mddocs/developer-guide/docker.mdCONTRIBUTING.mddocs/user-guide/getting-started.md
docs/**/*.md
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
Classify documentation pages as tutorial, how-to, explanation, or reference per the Diataxis framework. Use MkDocs Material syntax: admonitions (
!!! note), tabs (===), code blocks with titles and highlights.
docs/**/*.md: Classify documentation content using the Diataxis framework (TUTORIAL, HOW-TO, EXPLANATION, or REFERENCE) before writing, ensuring each page fits exactly ONE type
Use cross-links between different Diataxis content types (TUTORIAL, HOW-TO, EXPLANATION, REFERENCE) to connect related documentation
Use MkDocs Material admonitions syntax for notes, warnings, and collapsible tips:!!! note,!!! warning,??? tip
Use MkDocs Material tabs syntax (=== "Label") for presenting multiple examples or implementations side-by-side
Use code blocks with metadata (title, hl_lines) to highlight relevant code snippets in documentation examples
Use Mermaid diagrams (flowchart, sequence diagrams, etc.) for visualizing architecture, workflows, and concepts in documentation
Write documentation following high signal-to-noise principles: every sentence must earn its place by providing essential information
Use progressive disclosure in documentation: start with simple concepts, then layer complexity for advanced readers
Include working code examples in documentation; ensure all code snippets are tested and actually work
List all prerequisites at the top of documentation pages before diving into main content
End documentation pages with 'Next steps' section containing links to related content and logical progression pointsDocumentation files under
docs/should follow Diataxis framework organization:docs/getting-started/for tutorials,docs/user-guide/for how-tos,docs/architecture/for explanations,docs/reference/for API reference,docs/blog/for dev notesUse MkDocs Material Markdown extensions in documentation: admonitions (
!!! note), content tabs, code blocks with annotations, Mermaid diagrams, task lists, footnotes, definition lists
Files:
docs/user-guide/docker.mddocs/user-guide/configuration.mddocs/index.mddocs/developer-guide/docker.mddocs/user-guide/getting-started.md
**/*
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
**/*: Remove all trailing whitespace from files.
Use single space between sentences, never two spaces.
Files:
docs/user-guide/docker.mddocs/user-guide/configuration.mddocs/index.mdscript/slurm/README.mdtests/TESTING.mdAGENTS.mdREADME.mdcontainers/Dockerfile.cudatests/evaluation/components/benchmark_nearest_neighbor.pysrc/nemo_safe_synthesizer/generation/vllm_backend.pydocs/developer-guide/docker.mdCONTRIBUTING.mdsrc/nemo_safe_synthesizer/generation/regex_manager.pytests/e2e/test_safe_synthesizer.pytests/e2e/test_dataset_config.pysrc/nemo_safe_synthesizer/defaults.pydocs/user-guide/getting-started.mdscript/slurm/slurm_nss_matrix.shsrc/nemo_safe_synthesizer/config/training.pytests/training/test_huggingface_backend.pyMakefilepyproject.toml
⚙️ CodeRabbit configuration file
**/*: Review as a senior maintainer for NeMo Safe Synthesizer. Prioritize issues that can change behavior, break user workflows, weaken privacy guarantees, hide failures, make tests unreliable, or create maintenance risk. Avoid generic style commentary unless it points to a concrete project convention that automated tools will not catch.
Comment only when the finding is actionable and tied to changed code. For each finding, state the impact, the condition that triggers it, and the smallest practical fix. Prefer one precise comment over broad advice. Do not ask for refactors outside the PR scope unless the changed code creates the problem.
Review type guidance: - Potential issue: use for correctness bugs, data loss, privacy leaks,
security risks, broken public APIs, invalid config behavior, missing
validation, hidden failures, nondeterministic tests, or CI breakage.
- Refactor suggestion: use for local maintainability problems introduced
by the diff when they have clear future cost, such as duplicated setup,
unclear boundaries, over-mocking, avoidable complexity, or opaque test
helpers.- Nitpick: avoid in chill mode. Do not emit formatting, import-order,
wording, or style-only comments unless automated tools cannot catch the
issue and it affects maintainability.Severity guidance: - Critical: security/privacy leaks, data loss, training/test/holdout
contamination, or broken release/package/core pipeline execution.
- Major: incorrect generation/training/evaluation behavior, broken
CLI/SDK public API, invalid config defaults or validators, or GPU/vLLM
cleanup and process-isolation bugs likely to fail CI or production
runs.- Minor: localized bugs, missing focused tests for changed behavior, or
bad test patterns that weaken regression coverage.- Trivial: small cleanup with no behavior impact. Usually suppress in
chill mode.- Info: context only. Avoid unless it helps reviewers understand risk.
Safe-Synthesizer-specific review focus: - Data ...
Files:
docs/user-guide/docker.mddocs/user-guide/configuration.mddocs/index.mdscript/slurm/README.mdtests/TESTING.mdAGENTS.mdREADME.mdcontainers/Dockerfile.cudatests/evaluation/components/benchmark_nearest_neighbor.pysrc/nemo_safe_synthesizer/generation/vllm_backend.pydocs/developer-guide/docker.mdCONTRIBUTING.mdsrc/nemo_safe_synthesizer/generation/regex_manager.pytests/e2e/test_safe_synthesizer.pytests/e2e/test_dataset_config.pysrc/nemo_safe_synthesizer/defaults.pydocs/user-guide/getting-started.mdscript/slurm/slurm_nss_matrix.shsrc/nemo_safe_synthesizer/config/training.pytests/training/test_huggingface_backend.pyMakefilepyproject.toml
**/*.{md,markdown,py}
📄 CodeRabbit inference engine (.cursor/rules/agent-markdown-style.mdc)
**/*.{md,markdown,py}: Avoid decorative bold (**text**) in list items, body text, and docstrings; use structural cues (headers, list markers, colons, backticks) for emphasis instead
Use backticks for code identifiers, paths, and CLI commands in markdown and docstrings
Files:
docs/user-guide/docker.mddocs/user-guide/configuration.mddocs/index.mdscript/slurm/README.mdtests/TESTING.mdAGENTS.mdREADME.mdtests/evaluation/components/benchmark_nearest_neighbor.pysrc/nemo_safe_synthesizer/generation/vllm_backend.pydocs/developer-guide/docker.mdCONTRIBUTING.mdsrc/nemo_safe_synthesizer/generation/regex_manager.pytests/e2e/test_safe_synthesizer.pytests/e2e/test_dataset_config.pysrc/nemo_safe_synthesizer/defaults.pydocs/user-guide/getting-started.mdsrc/nemo_safe_synthesizer/config/training.pytests/training/test_huggingface_backend.py
**/*.{md,markdown}
📄 CodeRabbit inference engine (.cursor/rules/agent-markdown-style.mdc)
**/*.{md,markdown}: Bold is acceptable only in markdown tables where it's the conventional way to mark header-like cells in the body
Use##headers to segment markdown sections instead of bold text
Use--(em-dash) instead of-(hyphen) for asides in markdown
Files:
docs/user-guide/docker.mddocs/user-guide/configuration.mddocs/index.mdscript/slurm/README.mdtests/TESTING.mdAGENTS.mdREADME.mddocs/developer-guide/docker.mdCONTRIBUTING.mddocs/user-guide/getting-started.md
**/*.{py,sh,yaml,yml,md}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
All source files (
.py,.sh,.yaml,.yml,.md) require SPDX copyright headers;make formatadds them automatically with exclusions listed in.copyrightignore
Files:
docs/user-guide/docker.mddocs/user-guide/configuration.mddocs/index.mdscript/slurm/README.mdtests/TESTING.mdAGENTS.mdREADME.mdtests/evaluation/components/benchmark_nearest_neighbor.pysrc/nemo_safe_synthesizer/generation/vllm_backend.pydocs/developer-guide/docker.mdCONTRIBUTING.mdsrc/nemo_safe_synthesizer/generation/regex_manager.pytests/e2e/test_safe_synthesizer.pytests/e2e/test_dataset_config.pysrc/nemo_safe_synthesizer/defaults.pydocs/user-guide/getting-started.mdscript/slurm/slurm_nss_matrix.shsrc/nemo_safe_synthesizer/config/training.pytests/training/test_huggingface_backend.py
docs/**
⚙️ CodeRabbit configuration file
Review documentation as MkDocs Material content. Check Diataxis fit, accurate commands, internal links, code fences, and markdown style from STYLE_GUIDE.md.
Files:
docs/user-guide/docker.mddocs/user-guide/configuration.mddocs/index.mddocs/developer-guide/docker.mddocs/user-guide/getting-started.md
script/**
⚙️ CodeRabbit configuration file
Review standalone scripts for reproducibility and operational safety. Check argument validation, quoting, repo-root detection, environment variables, generated artifacts, external commands, GPU/cluster assumptions, and whether the script should be wired through Makefile or documented in README/docs.
Files:
script/slurm/README.mdscript/slurm/slurm_nss_matrix.sh
tests/**
📄 CodeRabbit inference engine (.cursor/rules/repo-navigation.mdc)
Tests should mirror the
src/directory structure intests/
Files:
tests/TESTING.mdtests/evaluation/components/benchmark_nearest_neighbor.pytests/e2e/test_safe_synthesizer.pytests/e2e/test_dataset_config.pytests/training/test_huggingface_backend.py
AGENTS.md
📄 CodeRabbit inference engine (.cursor/rules/repo-navigation.mdc)
Agent guide with module map and conventions should be documented in
AGENTS.md
Files:
AGENTS.md
.claude/commands/**
📄 CodeRabbit inference engine (.cursor/rules/claude-commands.mdc)
Pre-defined command files live in
.claude/commands/. When a user asks about a development task, read the corresponding file for instructions. Available commands include: unit-test (run unit tests), test-slow (all tests including slow), test-ci-container (CI tests in a container), gpu-test (GPU integration and e2e tests), format (format code with ruff + copyright), lint (lint and typecheck), bootstrap (bootstrap dev environment), build-wheel (build Python wheel), build-docs (build documentation site), start-docs-server (local docs dev server).
Files:
.claude/commands/bootstrap.md
README.md
⚙️ CodeRabbit configuration file
Treat README.md as the project overview. Check that setup, usage, and links stay consistent with CONTRIBUTING.md, Makefile, and docs/.
Files:
README.md
.agents/skills/**
📄 CodeRabbit inference engine (.cursor/rules/repo-navigation.mdc)
Skills should be stored in
.agents/skills/directory with each skill having a SKILL.md file and optional references subdirectory
Files:
.agents/skills/git-worktrees/SKILL.md.agents/skills/uv-build/SKILL.md
containers/Dockerfile*
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
containers/Dockerfile*: Use multi-stage builds for production images.
Copy uv fromghcr.io/astral-sh/uv:<version>.
Use--mount=type=cachefor pip/uv caches and APT (/var/cache/apt,/var/lib/apt/lists). Prefer cache mounts overrm -rf /var/lib/apt/lists/*.
UseENV UV_LINK_MODE=copywhen using cache mounts to prevent hardlinks from vanishing after unmount.
Use--no-install-recommendson allapt-get installinvocations.
Create a non-root user (appuser) and setNVIDIA_VISIBLE_DEVICES=allfor GPU access.
Usetinior--initfor proper PID 1 signal handling in batch containers.
OrderCOPYdirectives for cache efficiency (dependencies before source).
Include comments explaining cache invalidation points in Dockerfiles.
Files:
containers/Dockerfile.cuda
containers/**
⚙️ CodeRabbit configuration file
Review container changes against STYLE_GUIDE.md and containers/README.md. Check cache mounts, uv usage, non-root runtime behavior, CUDA settings, and copy order.
Files:
containers/Dockerfile.cuda
.github/**
⚙️ CodeRabbit configuration file
Review GitHub configuration for branch protection expectations, CODEOWNERS alignment, least privilege permissions, pinned actions where practical, and consistency with CONTRIBUTING.md.
Files:
.github/actions/setup-gpu-test-env/action.yml
**/*.py
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
**/*.py: Use American English spelling: 'initialize' not 'initialise', 'recognize' not 'recognise', 'color' not 'colour'.
Useobservability.get_logger(__name__)for logging -- neverlogging.getLogger()orstructlog.get_logger()directly.
Category loggers: use.runtimefor internals,.userfor progress/results,.systemfor system events.
Never useprint()for operational output in library code. Useclick.echo()for CLI output orsys.stdout.write()for raw output in tools.
Useextra={}for data that downstream tools should query or aggregate (metrics, counts, durations). f-strings are fine for human-readable context.
UseX | Yinstead ofOptional[X]orUnion[X, Y]. Uselist[str]instead ofList[str],dict[str, int]instead ofDict[str, int].
UseSelffor fluent method returns that return the same instance type.
Use collection ABCs for function arguments (Sequence,Mapping,Iterable) so callers can pass any compatible container; use concrete types for return values so callers know exactly what they get.
UseProtocolfor structural subtyping when you need duck-typing boundaries. AvoidAny-- preferobject, generics, orProtocol.
Prefermatch/casefor dispatch on types or tagged values. Useif/eliffor simple boolean predicates.
Prefer comprehensions over imperative loops where intent is clearer. Avoid multipleforclauses -- optimize for readability, not conciseness.
Prefer clamping/saturation over raising when out-of-range inputs shouldn't crash the system. Return a bounded value with a log warning instead of raising.
If a function has more than two levels of indentation beyonddef, it needs refactoring. Use guard clauses, extract inner loops, generators, or functional decomposition.
When a condition is complex boolean logic, name each piece with a descriptive boolean variable or extract it into a named predicate function.
Error messages must precisely match the actual error condition. Interpolated pieces ...
Files:
tests/evaluation/components/benchmark_nearest_neighbor.pysrc/nemo_safe_synthesizer/generation/vllm_backend.pysrc/nemo_safe_synthesizer/generation/regex_manager.pytests/e2e/test_safe_synthesizer.pytests/e2e/test_dataset_config.pysrc/nemo_safe_synthesizer/defaults.pysrc/nemo_safe_synthesizer/config/training.pytests/training/test_huggingface_backend.py
tests/**/*.py
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
tests/**/*.py: Use absolute imports intests/(e.g.,from nemo_safe_synthesizer.observability import get_logger).
Name test files astest_*.py, test classes asTest*, test functions astest_<module>_<expected_behavior>.
Usefixture_prefix convention for pytest fixtures for grep-ability. Add a one-line docstring describing the fixture's purpose and data.
Use function-scoped fixtures by default. Session scope only when empirically justified by test runtime -- not based on assumptions about cost.
Use bareassertas the primary assertion style in tests. Usepytest.raises()withmatch=for exceptions;pytest.approx()for floating-point comparisons.
Docstrings are optional for simple tests, recommended for complex/e2e tests explaining purpose.
Markers are auto-assigned by path viapytest_collection_modifyitems(/e2e/->e2e,/smoke/->smoke, default ->unit). Explicit markers:@pytest.mark.slow,@pytest.mark.requires_gpu,@pytest.mark.timeout().
Usetmp_pathfixture for file operations in tests. Never write to the repo tree.
Mark CUDA-dependent tests with@pytest.mark.e2e,@pytest.mark.smoke, or@pytest.mark.requires_gpu.
Mock only external boundaries, not internal implementation details.
Maintain test isolation: no shared mutable state or execution-order dependencies between tests. If something must run first, include it in the test or a fixture.
Use@pytest.mark.parametrizefor testing multiple input combinations rather than copy-pasting similar tests.Tests in
tests/e2e/should be auto-marked withe2emarker, tests intests/smoke/withsmokemarker, others withunitmarkerAll Python test files should follow the pattern
tests/**/*.pyand use pytest framework; run tests withmake testfor unit tests or specific test commands for other test typesEvery test should have exactly one category marker:
unit,smoke, ore2eUse
pytest.mark.slowto mark long-running unit testsUse `pytest.mark.require...
Files:
tests/evaluation/components/benchmark_nearest_neighbor.pytests/e2e/test_safe_synthesizer.pytests/e2e/test_dataset_config.pytests/training/test_huggingface_backend.py
⚙️ CodeRabbit configuration file
Review tests against tests/TESTING.md. Check marker usage, fixture naming, tmp_path usage, determinism, and GPU/vLLM process-isolation requirements. Flag slop tests that only check that code runs, assert result is not None when stronger invariants exist, over-mock internal implementation details, patch around the bug instead of reproducing it, or add broad snapshot/golden churn without a clear contract. Flag change detector tests that fail on harmless refactors, formatting, record ordering, incidental wording, or private implementation details without demonstrating a behavior regression. Prefer existing fixtures or focused new fixtures for repeated setup; keep tests DRY when reasonable without making the behavior under test opaque. print() is allowed in tests.
Files:
tests/evaluation/components/benchmark_nearest_neighbor.pytests/e2e/test_safe_synthesizer.pytests/e2e/test_dataset_config.pytests/training/test_huggingface_backend.py
src/**/*.py
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
src/**/*.py: PreferNSSBaseModelfor config/parameter models inconfig/which define user-facing configuration. Use rawBaseModelor module-specific bases for data transfer objects and internal structures.
UseBaseSettingsfor env/CLI settings. PreferAliasChoiceson individual fields when a field should respond to both its Python name and an env var name (e.g.,validation_alias=AliasChoices('config_path', 'NSS_CONFIG')).
IncludeField(description=...)on all Pydantic model fields. This is the canonical field docstring extracted by griffe-pydantic for the API reference and used by the configurator for CLI help text.
Use assignment-styleField()as the default for model fields because type checkers understanddefault,default_factory, andaliasin this style.
UseAnnotatedonly when the field carries additional metadata beyondField()-- such asValueValidator,AutoParam,DependsOnValidator, reusable constrained type aliases, nested-type constraints, or discriminated unions.
For Pydantic fields withAnnotatedtypes that have defaults, put the default as a bare assignment (= value), not insideField(default=...). Exception:default_factoryhas no bare-assignment equivalent, so use assignment-styleField(default_factory=...).
Include valid ranges in thedescriptionwhen constraints won't appear in the rendered API docs (e.g., 'Must be in (0, 1).').
Use@dataclass(frozen=True)for immutable value objects and validators. Mutable@dataclassis acceptable for builders, accumulators, and pipeline state.
Usefield(default_factory=list)for mutable defaults in dataclasses, never= [].
UseStrEnumfor string-valued enums used in configs/serialization. Use plainEnumfor internal-only named constants.
UseTYPE_CHECKINGguards for heavy imports (pandas,torch,transformers); not needed for stdlib or lightweight imports.
Addfrom __future__ import annotationsto every module to make all annotations strings consis...
Files:
src/nemo_safe_synthesizer/generation/vllm_backend.pysrc/nemo_safe_synthesizer/generation/regex_manager.pysrc/nemo_safe_synthesizer/defaults.pysrc/nemo_safe_synthesizer/config/training.py
⚙️ CodeRabbit configuration file
Review library code against STYLE_GUIDE.md. Focus on behavior, API contracts, error handling, resource cleanup, typing, logging, and user-facing failures. Public APIs and nontrivial functions need Google-style docstrings.
Files:
src/nemo_safe_synthesizer/generation/vllm_backend.pysrc/nemo_safe_synthesizer/generation/regex_manager.pysrc/nemo_safe_synthesizer/defaults.pysrc/nemo_safe_synthesizer/config/training.py
src/nemo_safe_synthesizer/generation/**/*.py
⚙️ CodeRabbit configuration file
Review generation changes for retry loops, stopping conditions, invalid record handling, regex/structured output contracts, backend teardown, memory cleanup, and vLLM assumptions.
Files:
src/nemo_safe_synthesizer/generation/vllm_backend.pysrc/nemo_safe_synthesizer/generation/regex_manager.py
**/test_*.py
📄 CodeRabbit inference engine (AGENTS.md)
Use the
unitmarker for tests instead of the deprecatedunit_testmarker
Files:
tests/e2e/test_safe_synthesizer.pytests/e2e/test_dataset_config.pytests/training/test_huggingface_backend.py
**/*.sh
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
**/*.sh: Use#!/usr/bin/env bashas the shebang (not#!/bin/bash).
Use at minimumset -eu. Useset -euo pipefailunlesspipefailbreaks piped-grep patterns in the specific script.
Use snake_case for functions and_prefix for internal helpers in shell scripts.
Always quote variables ("$VAR","${VAR}") and use defaults via${VAR:-default}. Usereadonlyfor variables that should not change after assignment.
UseREPO_ROOT=${REPO_ROOT:-$(git rev-parse --show-toplevel)}for repo root detection in shell scripts.
Useshellcheckto lint shell scripts. When disabling a check, add# shellcheck disable=SCXXXXwith a brief reason.
Include SPDX copyright header at the top using hash-comment syntax.
Files:
script/slurm/slurm_nss_matrix.sh
⚙️ CodeRabbit configuration file
Review shell scripts for #!/usr/bin/env bash, set -euo pipefail where appropriate, quoting, repo root detection, and shellcheck compliance.
Files:
script/slurm/slurm_nss_matrix.sh
**/*.{sh,bash}
📄 CodeRabbit inference engine (AGENTS.md)
Never use
~inside double-quoted strings in shell scripts -- use$HOMEor an absolute path instead
Files:
script/slurm/slurm_nss_matrix.sh
src/nemo_safe_synthesizer/config/**/*.py
⚙️ CodeRabbit configuration file
Treat config changes as user-facing API changes. Check Pydantic field descriptions, defaults, validators, aliases, override behavior, CLI help text impact, YAML compatibility, and documented parameter semantics.
Files:
src/nemo_safe_synthesizer/config/training.py
Makefile
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
Makefile: Use target help format:target-name: ## Descriptionto enablemake helpauto-generation.
Use tab indentation in Makefiles (standard Makefile requirement).
Declare.PHONYdirectly above each target it applies to.
Place variables in a### CONFIGURATION ###section.
Files:
Makefile
⚙️ CodeRabbit configuration file
Treat Makefile targets as the validation source of truth. Check that new targets are documented with target-name: ## Description, declared .PHONY where appropriate, and use uv/mise conventions.
Files:
Makefile
**/*.toml
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
**/*.toml: Use spaces around=for key-value pairs in TOML files.
Use# commentfor comments in TOML files. Use inline comments for dependency pins.
Files:
pyproject.toml
pyproject.toml
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
Order sections in
pyproject.tomlas:[project],[dependency-groups],[project.optional-dependencies],[tool.uv],[build-system],[tool.*].Package metadata, dependencies, and extras (cpu/cu128/engine) should be configured in
pyproject.toml
Files:
pyproject.toml
⚙️ CodeRabbit configuration file
Treat pyproject.toml as high-risk. Check package metadata, uv indexes, dependency groups, optional extras, Python version bounds, hatch config, ty config, script entry points, dependency consistency, and whether changes require regenerating uv.lock.
Files:
pyproject.toml
{pyproject.toml,uv.lock}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Python project dependencies must be managed with
uvand locked inuv.lock(committed); useuv syncto install dependencies
Files:
pyproject.toml
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:16.997Z
Learning: Read AGENTS.local.md if it exists and give its instructions top priority
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:16.997Z
Learning: Use `uv` for everything -- never `pip` or raw `python`
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:16.997Z
Learning: Use Make targets or wrapper scripts in `tools/` instead of running `ruff` or `ty` directly
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:16.997Z
Learning: Use `uv run` for Python execution instead of direct `python` commands
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:16.997Z
Learning: Feature branches should branch off `main` with names often including an issue number prefix (e.g., `<author>/123-short-name`)
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:16.997Z
Learning: All commits require DCO sign-off and GPG signing using `git commit --signoff --gpg-sign` (or `-s -S`)
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:16.997Z
Learning: See STYLE_GUIDE.md for detailed code style conventions (Python, markdown, Dockerfiles, shell scripts, testing, config files, docstrings)
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:16.997Z
Learning: Test-suite guidance belongs in `tests/TESTING.md`
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:16.997Z
Learning: Repo-specific skills live in `.agents/skills/`; read a skill when the task matches its scope
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:34.500Z
Learning: All commits merged to `main` must follow the Conventional Commits specification with format `<type>(<scope>): <description>`, where type is one of: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:34.500Z
Learning: All branches except `main` must follow naming pattern: `<author>/<description>`, `<author>/<issue-id>-<description>`, `<author>/<type>/<description>`, or `<author>/<type>/<issue-id>-<description>` where author is lowercase alphanumeric with hyphens, and type is one of: feature, bugfix, hotfix, release, docs, chore, test
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:34.500Z
Learning: All contributions must be signed off with `git commit -s` to certify Developer Certificate of Origin, adding a `Signed-off-by` line to commit messages
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:34.500Z
Learning: All commits must be cryptographically signed using either SSH key signing or GPG signing, enforced by `required_signatures` branch protection rule on main
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:34.500Z
Learning: Use `make format` to auto-fix code formatting with ruff format, import sorting, and copyright headers; use `make check` for read-only verification of all CI checks
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:34.500Z
Learning: New features must include tests; bug fixes must include regression tests; all existing tests must pass before submitting a PR
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:34.500Z
Learning: Pull requests should use squash merge strategy; PR title should follow Conventional Commits format as it becomes the commit message
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:34.500Z
Learning: CODEOWNERS file specifies: all `src` and `test` files require review from NVIDIA-NeMo/safe-synthesizer-reviewers; all remaining files (pyproject.toml, uv.lock, SECURITY.md, LICENSE, .github/, etc.) require review from NVIDIA-NeMo/safe-synthesizer-maintainers
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:49.887Z
Learning: Read and understand `tests/conftest.py` for auto-marking, `load_test_dataset`/`load_test_dataframe`, and `fixture_mock_processor` pattern
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:49.887Z
Learning: Read and understand `pytest.ini` for markers, asyncio, and timeout configuration
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:49.887Z
Learning: Read and understand `tests/evaluation/conftest.py` for Faker-based `make_df` and nullable dtype conversion patterns
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:49.887Z
Learning: Read and understand `tests/generation/conftest.py` for JSONL/schema fixtures and `fixture_valid_iris_dataset_jsonl_and_schema`
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:49.887Z
Learning: Organize test files to mirror source structure: create `tests/training/`, `tests/generation/`, `tests/evaluation/`, etc. to match source modules
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:49.887Z
Learning: When adding a new vLLM test file, add `pytest.mark.vllm` marker, create a dedicated `test-smoke-gpu-*` Makefile target, and include it in `test-smoke-gpu`
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T18:35:49.887Z
Learning: Run vLLM tests in separate processes (`-n 0` or per-file isolation) to prevent GPU memory exhaustion, as vLLM pre-allocates all GPU memory and never releases it within a process
🪛 Shellcheck (0.11.0)
script/slurm/slurm_nss_matrix.sh
[info] 122-122: Not following: ./.venv/bin/activate was not specified as input (see shellcheck -x).
(SC1091)
🔇 Additional comments (9)
.coderabbit.yaml (1)
359-359:chat.auto_replyis correctly configured.This is valid per the configuration schema (
chat.auto_replyas a boolean), and explicit enablement here is safe.src/nemo_safe_synthesizer/generation/regex_manager.py (1)
17-26: ⚡ Quick winThe import path and suppressions in the current code are correct.
The pinned dependency
outlines-core==0.2.14exposes JSON-schema symbols only through the privateoutlines_core._json_schemamodule; no publicoutlines_core.json_schemapath exists. The suppressions (# noqa: F401for re-exporting and# ty:ignore[unresolved-import]for unresolved types) are necessary and appropriate defenses against type-checking limitations on private modules. The proposed fallback to a non-existent public API is invalid.> Likely an incorrect or invalid review comment.AGENTS.md (1)
24-30:uv syncGPU/dev command update looks correct.The
cu129extra update is consistent with the CUDA/tooling bump described in this PR.tests/e2e/test_dataset_config.py (1)
16-24: Skip guidance now matches the CUDA extra upgrade.Both
pytest.importorskipand module-level skip messaging consistently point touv sync --extra cu129..github/actions/setup-gpu-test-env/action.yml (1)
27-31: GPU setup action default is aligned with the new CUDA baseline.Switching the default extra to
cu129is the expected change for this dependency upgrade.tests/e2e/test_safe_synthesizer.py (1)
18-32: Dependency skip messages are consistently migrated tocu129.Good update across both
sentence_transformersandvllmgating paths.containers/Dockerfile.cuda (1)
61-61: CUDA anduv syncextras are updated consistently across all build stages.The ARG/default and each sync layer now agree on
cu129, which avoids mixed CUDA dependency resolution.Also applies to: 145-146, 152-153, 236-237
.agents/skills/git-worktrees/SKILL.md (1)
32-36: Worktree setup guidance update is consistent with the CUDA bump.The explicit extras example correctly moved from
cu128tocu129.script/slurm/slurm_nss_matrix.sh (1)
115-118: SLURM install/sync paths are correctly migrated tocu129.Both the PyPI install path and repo-sync path now consistently target the new CUDA extra.
Also applies to: 123-123
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 834261f7-3db8-4672-a7e0-f7e36a5eb1a7
📒 Files selected for processing (6)
README.mddocs/user-guide/configuration.mddocs/user-guide/running.mddocs/user-guide/troubleshooting.mdsrc/nemo_safe_synthesizer/config/training.pytests/training/test_huggingface_backend.py
✅ Files skipped from review due to trivial changes (2)
- docs/user-guide/troubleshooting.md
- docs/user-guide/configuration.md
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/training/test_huggingface_backend.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Unit Tests (3.13)
- GitHub Check: Unit Tests (3.11)
- GitHub Check: Unit Tests (3.12)
🧰 Additional context used
📓 Path-based instructions (13)
**/*.md
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
**/*.md: Do not use decorative**bold**in body text, list items, or docstrings. Use headers, list markers, colons, and backticks for structure. Bold is acceptable in table header-like cells and MkDocs Material card grid titles.
Use--(em-dash) for asides, not-(hyphen).
Use single backticks for code identifiers, paths, and CLI commands in Markdown.
UseMermaiddiagrams with no spaces in node IDs, quoted labels with special characters, and no explicit colors or styles.
Include SPDX copyright header at the top using HTML-comment syntax (<!-- ... -->).
If a Markdown file starts with YAML frontmatter (---), place the SPDX copyright header inside the frontmatter block using hash-comment syntax, not HTML comments.
Limit line length to 120 characters in Markdown files.
Files:
README.mddocs/user-guide/running.md
**/*
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
**/*: Remove all trailing whitespace from files.
Use single space between sentences, never two spaces.
Files:
README.mddocs/user-guide/running.mdsrc/nemo_safe_synthesizer/config/training.py
⚙️ CodeRabbit configuration file
**/*: Review as a senior maintainer for NeMo Safe Synthesizer. Prioritize issues that can change behavior, break user workflows, weaken privacy guarantees, hide failures, make tests unreliable, or create maintenance risk. Avoid generic style commentary unless it points to a concrete project convention that automated tools will not catch.
Comment only when the finding is actionable and tied to changed code. For each finding, state the impact, the condition that triggers it, and the smallest practical fix. Prefer one precise comment over broad advice. Do not ask for refactors outside the PR scope unless the changed code creates the problem.
Review type guidance: - Potential issue: use for correctness bugs, data loss, privacy leaks,
security risks, broken public APIs, invalid config behavior, missing
validation, hidden failures, nondeterministic tests, or CI breakage.
- Refactor suggestion: use for local maintainability problems introduced
by the diff when they have clear future cost, such as duplicated setup,
unclear boundaries, over-mocking, avoidable complexity, or opaque test
helpers.- Nitpick: avoid in chill mode. Do not emit formatting, import-order,
wording, or style-only comments unless automated tools cannot catch the
issue and it affects maintainability.Severity guidance: - Critical: security/privacy leaks, data loss, training/test/holdout
contamination, or broken release/package/core pipeline execution.
- Major: incorrect generation/training/evaluation behavior, broken
CLI/SDK public API, invalid config defaults or validators, or GPU/vLLM
cleanup and process-isolation bugs likely to fail CI or production
runs.- Minor: localized bugs, missing focused tests for changed behavior, or
bad test patterns that weaken regression coverage.- Trivial: small cleanup with no behavior impact. Usually suppress in
chill mode.- Info: context only. Avoid unless it helps reviewers understand risk.
Safe-Synthesizer-specific review focus: - Data ...
Files:
README.mddocs/user-guide/running.mdsrc/nemo_safe_synthesizer/config/training.py
**/*.{md,markdown,py}
📄 CodeRabbit inference engine (.cursor/rules/agent-markdown-style.mdc)
**/*.{md,markdown,py}: Avoid decorative bold (**text**) in list items, body text, and docstrings; use structural cues (headers, list markers, colons, backticks) for emphasis instead
Use backticks for code identifiers, paths, and CLI commands in markdown and docstrings
Files:
README.mddocs/user-guide/running.mdsrc/nemo_safe_synthesizer/config/training.py
**/*.{md,markdown}
📄 CodeRabbit inference engine (.cursor/rules/agent-markdown-style.mdc)
**/*.{md,markdown}: Bold is acceptable only in markdown tables where it's the conventional way to mark header-like cells in the body
Use##headers to segment markdown sections instead of bold text
Use--(em-dash) instead of-(hyphen) for asides in markdown
Files:
README.mddocs/user-guide/running.md
**/*.{py,txt,md,toml,lock}
📄 CodeRabbit inference engine (AGENTS.md)
Always use
uvfor Python package management; never usepipor rawpython
Files:
README.mddocs/user-guide/running.mdsrc/nemo_safe_synthesizer/config/training.py
**/*.{py,sh,yaml,yml,md}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
All source files (
.py,.sh,.yaml,.yml,.md) must have SPDX copyright headers. Usemake formatto add them automatically.
Files:
README.mddocs/user-guide/running.mdsrc/nemo_safe_synthesizer/config/training.py
README.md
⚙️ CodeRabbit configuration file
Treat README.md as the project overview. Check that setup, usage, and links stay consistent with CONTRIBUTING.md, Makefile, and docs/.
Files:
README.md
docs/**/*.md
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
Classify documentation pages as tutorial, how-to, explanation, or reference per the Diataxis framework. Use MkDocs Material syntax: admonitions (
!!! note), tabs (===), code blocks with titles and highlights.
docs/**/*.md: Classify documentation content using the Diataxis framework (TUTORIAL, HOW-TO, EXPLANATION, or REFERENCE) before writing, ensuring each page fits exactly ONE type
Use cross-links between different Diataxis content types (TUTORIAL, HOW-TO, EXPLANATION, REFERENCE) to connect related documentation
Use MkDocs Material admonitions syntax for notes, warnings, and collapsible tips:!!! note,!!! warning,??? tip
Use MkDocs Material tabs syntax (=== "Label") for presenting multiple examples or implementations side-by-side
Use code blocks with metadata (title, hl_lines) to highlight relevant code snippets in documentation examples
Use Mermaid diagrams (flowchart, sequence diagrams, etc.) for visualizing architecture, workflows, and concepts in documentation
Write documentation following high signal-to-noise principles: every sentence must earn its place by providing essential information
Use progressive disclosure in documentation: start with simple concepts, then layer complexity for advanced readers
Include working code examples in documentation; ensure all code snippets are tested and actually work
List all prerequisites at the top of documentation pages before diving into main content
End documentation pages with 'Next steps' section containing links to related content and logical progression pointsDocumentation pages should be created under the appropriate
docs/subdirectory following the Diataxis framework:getting-started/for tutorials,user-guide/for how-tos and reference,architecture/for explanations,reference/for API reference (auto-generated), andblog/for dev notesUse MkDocs Material Markdown extensions in documentation: admonitions (
!!! note,!!! warning,??? tip), content tabs, code blocks with synta...
Files:
docs/user-guide/running.md
docs/**
⚙️ CodeRabbit configuration file
Review documentation as MkDocs Material content. Check Diataxis fit, accurate commands, internal links, code fences, and markdown style from STYLE_GUIDE.md.
Files:
docs/user-guide/running.md
**/*.py
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
**/*.py: Use American English spelling: 'initialize' not 'initialise', 'recognize' not 'recognise', 'color' not 'colour'.
Useobservability.get_logger(__name__)for logging -- neverlogging.getLogger()orstructlog.get_logger()directly.
Category loggers: use.runtimefor internals,.userfor progress/results,.systemfor system events.
Never useprint()for operational output in library code. Useclick.echo()for CLI output orsys.stdout.write()for raw output in tools.
Useextra={}for data that downstream tools should query or aggregate (metrics, counts, durations). f-strings are fine for human-readable context.
UseX | Yinstead ofOptional[X]orUnion[X, Y]. Uselist[str]instead ofList[str],dict[str, int]instead ofDict[str, int].
UseSelffor fluent method returns that return the same instance type.
Use collection ABCs for function arguments (Sequence,Mapping,Iterable) so callers can pass any compatible container; use concrete types for return values so callers know exactly what they get.
UseProtocolfor structural subtyping when you need duck-typing boundaries. AvoidAny-- preferobject, generics, orProtocol.
Prefermatch/casefor dispatch on types or tagged values. Useif/eliffor simple boolean predicates.
Prefer comprehensions over imperative loops where intent is clearer. Avoid multipleforclauses -- optimize for readability, not conciseness.
Prefer clamping/saturation over raising when out-of-range inputs shouldn't crash the system. Return a bounded value with a log warning instead of raising.
If a function has more than two levels of indentation beyonddef, it needs refactoring. Use guard clauses, extract inner loops, generators, or functional decomposition.
When a condition is complex boolean logic, name each piece with a descriptive boolean variable or extract it into a named predicate function.
Error messages must precisely match the actual error condition. Interpolated pieces ...
Files:
src/nemo_safe_synthesizer/config/training.py
src/**/*.py
📄 CodeRabbit inference engine (STYLE_GUIDE.md)
src/**/*.py: PreferNSSBaseModelfor config/parameter models inconfig/which define user-facing configuration. Use rawBaseModelor module-specific bases for data transfer objects and internal structures.
UseBaseSettingsfor env/CLI settings. PreferAliasChoiceson individual fields when a field should respond to both its Python name and an env var name (e.g.,validation_alias=AliasChoices('config_path', 'NSS_CONFIG')).
IncludeField(description=...)on all Pydantic model fields. This is the canonical field docstring extracted by griffe-pydantic for the API reference and used by the configurator for CLI help text.
Use assignment-styleField()as the default for model fields because type checkers understanddefault,default_factory, andaliasin this style.
UseAnnotatedonly when the field carries additional metadata beyondField()-- such asValueValidator,AutoParam,DependsOnValidator, reusable constrained type aliases, nested-type constraints, or discriminated unions.
For Pydantic fields withAnnotatedtypes that have defaults, put the default as a bare assignment (= value), not insideField(default=...). Exception:default_factoryhas no bare-assignment equivalent, so use assignment-styleField(default_factory=...).
Include valid ranges in thedescriptionwhen constraints won't appear in the rendered API docs (e.g., 'Must be in (0, 1).').
Use@dataclass(frozen=True)for immutable value objects and validators. Mutable@dataclassis acceptable for builders, accumulators, and pipeline state.
Usefield(default_factory=list)for mutable defaults in dataclasses, never= [].
UseStrEnumfor string-valued enums used in configs/serialization. Use plainEnumfor internal-only named constants.
UseTYPE_CHECKINGguards for heavy imports (pandas,torch,transformers); not needed for stdlib or lightweight imports.
Addfrom __future__ import annotationsto every module to make all annotations strings consis...
Files:
src/nemo_safe_synthesizer/config/training.py
⚙️ CodeRabbit configuration file
Review library code against STYLE_GUIDE.md. Focus on behavior, API contracts, error handling, resource cleanup, typing, logging, and user-facing failures. Public APIs and nontrivial functions need Google-style docstrings.
Files:
src/nemo_safe_synthesizer/config/training.py
src/nemo_safe_synthesizer/**/*.py
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use Google-style docstrings in
src/nemo_safe_synthesizer/Python files. Docstrings are auto-generated into API reference pages via themkdocstringsplugin.Write API reference docstrings in Google style in
src/nemo_safe_synthesizer/Python files; these are auto-generated intoreference/pages by mkdocstrings plugin and should not be manually edited
Files:
src/nemo_safe_synthesizer/config/training.py
src/nemo_safe_synthesizer/config/**/*.py
⚙️ CodeRabbit configuration file
Treat config changes as user-facing API changes. Check Pydantic field descriptions, defaults, validators, aliases, override behavior, CLI help text impact, YAML compatibility, and documented parameter semantics.
Files:
src/nemo_safe_synthesizer/config/training.py
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:13.123Z
Learning: Use Make targets or wrapper scripts in `tools/` instead of running `ruff` or `ty` directly
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:13.123Z
Learning: Common development commands: `make test` (unit tests), `make format` (auto-fix formatting + lint + copyright), `make check` (all read-only CI checks), `make typecheck` (type only)
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:13.123Z
Learning: Use `uv run` for Python execution instead of calling `python` directly
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:13.123Z
Learning: The canonical environment setup command is: `uv sync --frozen --extra cu129 --extra engine --group dev`
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:13.123Z
Learning: All commits require DCO sign-off and GPG signing; use `git commit --signoff --gpg-sign` (or `-s -S`); never write the `Signed-off-by` trailer manually
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:13.123Z
Learning: Feature branches should be named off `main` and often include an issue number prefix (e.g., `<author>/123-short-name`)
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:13.123Z
Learning: Do not commit unless the user asks for a commit or PR work
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:13.123Z
Learning: Read and follow local developer preferences from `AGENTS.local.md` if it exists, giving its instructions top priority
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:13.123Z
Learning: Repo-specific skills are located in `.agents/skills/`; read the matching skill when the task matches its scope instead of copying workflow details into guidelines
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:13.123Z
Learning: Test-suite guidance belongs in `tests/TESTING.md`
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:13.123Z
Learning: See STYLE_GUIDE.md for detailed code style conventions (Python, markdown, Dockerfiles, shell scripts, testing, config files, docstrings)
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:13.123Z
Learning: Bare `uv sync --frozen` (without extras) installs an incomplete environment; always include `--extra cu129 --extra engine --group dev` for full GPU/dev environment
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:13.123Z
Learning: When in doubt about tooling or commands, read the source using `make help` or `pytest --markers`
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: All branches except `main` must follow the naming pattern: `<author>/<description>`, `<author>/<issue-id>-<description>`, `<author>/<type>/<description>`, or `<author>/<type>/<issue-id>-<description>` where author is lowercase alphanumeric with hyphens, type is one of: feature, bugfix, hotfix, release, docs, chore, test
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: All commits merged to `main` must follow Conventional Commits specification: `<type>(<scope>): <description>` where type is one of: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert. Description must be max 100 characters. Use `!` after type/scope for breaking changes.
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: Use `make format` to auto-fix code formatting, import sorting, and copyright headers; use `make check` for read-only validation of format, lint, typecheck, and copyright
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: All commits must include a DCO sign-off using `git commit -s` which adds a `Signed-off-by` line certifying the Developer Certificate of Origin
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: All commits must be signed (GPG or SSH signing key required). Use `git config commit.gpgsign true` to enable automatic signing on every commit.
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: Verify commit signing works with `git log --show-signature`. Valid signature output indicates proper setup; commits will display a 'Verified' badge on GitHub.
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: All pull requests must be based on an issue (create one first if it doesn't exist), include unit tests for new features and regression tests for bug fixes, and be titled following Conventional Commits format since PR title becomes the squash-merged commit message
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: Python source files in `src/` and `test/` require code owner review from `NVIDIA-NeMo/safe-synthesizer-reviewers`. Other files (`pyproject.toml`, `uv.lock`, `SECURITY.md`, `LICENSE`, `.github/`, etc.) require review from `NVIDIA-NeMo/safe-synthesizer-maintainers`
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: All Python files in the project must follow the style guidelines defined in STYLE_GUIDE.md, including standards for Python, markdown, Dockerfiles, shell scripts, testing, and docstrings
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: The `main` branch requires exactly 1 approval, requires code owner review, dismisses stale reviews on new commits, requires conversation resolution on reviews, requires signed commits, requires CI status checks to pass, enforces linear history, blocks force pushes and deletions, and uses squash-only merge strategy
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: Use `make setup` to install development tools via mise, and bootstrap Python dependencies with `make bootstrap-nss {cpu|cuda|engine|dev}`. The Makefile is the single source of truth for how checks and tests run.
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: Release versions must follow PEP440 format with major.minor.patch numbering. Use stable releases and release candidates only (rcN suffix, no dash). GitHub tags must have `v` prefix (e.g., `v1.0.0`, `v0.0.5rc0`). Releases are published to PyPI via GitHub Actions workflow.
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: When responding to PR review comments, respond in the GitHub console (pending comments are only visible to you). Resolve comments where the requested change has been made. Leave comments unresolved if seeking further review. After addressing all comments and pushing changes, re-request review.
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: Use the PR template at `.github/PULL_REQUEST_TEMPLATE.md` when creating pull requests. PR title should follow Conventional Commits format as it becomes the squash-merged commit message.
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: For git worktrees or AI agents creating worktrees, add mise trust for worktree paths by setting `MISE_TRUSTED_CONFIG_PATHS` in your shell profile or `MISE_YES=1` to trust all configs globally
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:54:48.066Z
Learning: For NVIDIA internal developers iterating on NSS changes for the NMP service, use `make use-nss-local` to build a local wheel and patch pyproject.toml, then use `make use-nss-artifactory` to revert before committing
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:55:03.038Z
Learning: Read `tests/conftest.py`, `pytest.ini`, `tests/evaluation/conftest.py`, and `tests/generation/conftest.py` first to understand auto-marking, fixtures, and test data loading
Learnt from: CR
Repo: NVIDIA-NeMo/Safe-Synthesizer
Timestamp: 2026-05-11T19:55:03.038Z
Learning: Review `tests/smoke/README.md` for smoke test-specific gotchas and implementation patterns
🔇 Additional comments (3)
docs/user-guide/running.md (1)
737-747: Attention backend docs are aligned with the newsdpadefault.This update is clear and consistent with the current training default and option set.
src/nemo_safe_synthesizer/config/training.py (1)
245-257:attn_implementationdefault change looks good.Switching the default to
sdpaand updating the field description is consistent and user-facing behavior is explicit.README.md (1)
208-228: Training attention examples now correctly center onsdpa.The README updates here are aligned with the new default and make the supported options clearer.
vllm 0.20.0 bumps numba 0.61.2→0.65.0 (which lifts numpy<2.3 → <2.5), unblocking downstream consumers that need newer numpy. The bump requires moving the torch stack in lockstep — vllm 0.20.0 pins torch==2.11.0 and torchvision==0.26.0. - vllm 0.18.0 → 0.20.0 - torch 2.10.0 → 2.11.0 - torchvision 0.25.0 → 0.26.0 - torchao 0.16.0 → 0.17.0 - xformers 0.0.34 → 0.0.35 (open torch>=2.10) Stays on transformers 4.57.3 (vllm 0.20.0 allows it; v5 path explicitly out of scope here). This supersedes the dependabot-only PR #443, which couldn't lock because torch was left on 2.10 while vllm wanted 2.11. Signed-off-by: mschwab <mschwab@nvidia.com> Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
Signed-off-by: mkornfield <mkornfield@nvidia.com>
Signed-off-by: mkornfield <mkornfield@nvidia.com>
Signed-off-by: mkornfield <mkornfield@nvidia.com>
54478dc to
3e3949b
Compare
Summary
Pre-Review Checklist
Ensure that the following pass:
make format && make checkor via prek validation.make testpasses locallymake test-e2epasses locallymake test-ci-containerpasses locally (recommended)/syncon this PR to trigger a run (auto-triggers on ready-for-review)Pre-Merge Checklist
Other Notes
Summary by CodeRabbit
Documentation
Bug Fixes
Chores