feat(rewrite): add conditional combined workflow - #240
Open
andreatnvidia wants to merge 7 commits into
Open
Conversation
Refs #237 Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
andreatnvidia
marked this pull request as ready for review
August 12, 2026 18:33
Contributor
Greptile SummaryThe PR adds an opt-in combined Data Designer rewrite graph that generates replacements, rewrites, evaluates, and conditionally repairs rows in one statically unrolled workflow.
Confidence Score: 4/5The PR appears safe to merge, with the non-blocking limitation that CLI users cannot enable the new combined workflow. The combined workflow is opt-in and has focused scheduling and integration coverage; the remaining issue is an inconsistent configuration surface rather than a runtime correctness failure. Files Needing Attention: src/anonymizer/config/anonymizer_config.py and src/anonymizer/interface/cli/main.py Important Files Changed
|
Comment on lines
+134
to
+137
| use_combined_graph: bool = Field( | ||
| default=False, | ||
| description="Run rewrite and conditional repair iterations in one Data Designer graph.", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Closes #237
Plan Document
plans/237/combined-rewrite-graph.mdSummary
Add an opt-in rewrite workflow that executes replacement-map generation, the initial rewrite, evaluation, and a bounded number of conditional repair iterations in one Data Designer graph.
The graph statically unrolls
max_repair_iterationsand usesSkipConfig.whento skip repair and downstream re-evaluation after each row passes. It supports zero or multiple repair rounds, preserves no-entity passthrough, row order, final metrics, repair counts, and review flags, and continues to execute throughNddAdapter.run_workflow().The legacy workflow remains the default in this PR. Data Designer 0.8 does not expose terminal failed-column and seed-row provenance through its public result API, so a dropped row in the combined graph can only be attributed to
rewrite-combined. Draft Data Designer #861 implements the required lightweight provenance API. Keeping this path opt-in avoids reducing default failure observability before that API is merged, released, and integrated.For entity-bearing rewrite runs, the combined graph reduces the full pipeline's base Data Designer workflow count from five to three. The two detection workflows and the separate non-critical judge path are unchanged.
Experiment evidence
We ran a controlled self-hosted comparison on a single GB300 using GPT-OSS 120B across 12 diverse synthetic PII records. Detection, replacement maps, domain classification, sensitivity decisions, meaning units, and QA plans were generated once and reused by both paths. Both paths received the same initial evaluated rewrite state, execution order was counterbalanced across two six-record groups, and both allowed up to three repair iterations.
Ten records were selected for repair and two were clean skip controls. Both paths made the same repair decision for all 12 records: ten stopped after one repair, two stopped at iteration zero, and none still required repair. The successful run had zero workload failures and zero measured leakage for every output.
Both paths made 80 LLM requests. Across the two groups, legacy used four DD workflows for repair and re-evaluation while combined used two. Combined took 10.56 seconds versus 10.80 seconds for legacy, a 2.2% reduction. This establishes latency parity, not a speedup claim.
Ten of twelve paired outputs were byte-identical and 11/12 final human-review decisions agreed. The paired mean utility delta was -0.0867, the median was zero, and the approximate 95% interval was [-0.2496, 0.0763]. The interval includes zero; separate real-model generations and judge calls remain nondeterministic even with fixed sampling settings.
The experiment also exposed structured-payload checkpoint problems in both paths. The PR now normalizes public QA payloads at combined finalization and at legacy evaluate-to-repair boundaries. Regression tests cover mixed list and NumPy representations across real repair iterations.
Retained GB300 DCGM telemetry showed flat HBM use within both successful controlled runs, with no detectable combined-path GPU-memory regression. Combined Data Designer artifacts were larger: +187% with no repairs and +60% with one repair, although the absolute totals remained below 230 KB for two six-row groups. Retained dataframe memory increased by 6% and 22%, respectively. The five-second telemetry cadence and group-level timings do not support a reliable tail-latency comparison.
An earlier 30-pair Slurm suite remains useful only as scale and stability evidence. Its latency comparison was confounded by different repair behavior and fixed ordering, so it is not used for the performance conclusion above.
Follow-up after Data Designer #861
This PR intentionally stops at an opt-in combined workflow. After Data Designer #861 is merged and available in a supported release, a small Anonymizer follow-up will:
NddAdapter;_anonymizer_record_idand failed columns to the existing rewrite stage names;Legacy removal can follow production rollout evidence and is not part of this PR.
The branch is synchronized with current Anonymizer
main. The combined-runner routing is integrated with main's privacy-goal validation and evaluation refactor.Type of Change
Contributor Checklist
fix: handle empty entity listskills/anonymizer/SKILL.mdupdated if neededThe bundled skill remains on the unchanged legacy default and does not need an update for this opt-in path.
Validation
.venv/bin/ruff check --fix ..venv/bin/ruff format .env -u VIRTUAL_ENV .venv/bin/ty check --error-on-warningTMPDIR=<short-temp-path> .venv/bin/pytest --basetemp=<short-temp-path>/pytest- 1,209 passedDocumentation and Artifacts
make docs-buildpasses locallymake convert-notebooksThe internal plan documents the rollout decision, benchmark interpretation, completed compatibility coverage, and deferred default integration. No user-facing documentation or tutorial changed.