Skip to content

Commit 44e9d54

Browse files
authored
fix: add pii replacement time to summary (#646)
<!-- SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. --> <!-- SPDX-License-Identifier: Apache-2.0 --> <!-- Thank you for contributing to Safe Synthesizer! --> # Summary <!-- Brief description of changes --> Fix a little bug where PII Replacer time is not shown in the summary. It used to be None, with the fix, it shows <img width="254" height="179" alt="image" src="https://github.com/user-attachments/assets/42c0a831-3c61-4783-a734-98d4a94a30f3" /> ## Pre-Review Checklist <!-- These checks should be completed before a PR is reviewed, --> <!-- but you can submit a draft early to indicate that the issue is being worked on. --> Ensure that the following pass: - [x] `mise run format && mise run check` or via prek validation. - [x] `mise run test` passes locally - [ ] `mise run test:e2e` passes locally - [ ] `mise run test:ci-container` passes locally (recommended) - [ ] GPU CI status check passes -- comment `/sync` on this PR to trigger a run (auto-triggers on ready-for-review) ## Pre-Merge Checklist <!-- These checks need to be completed before a PR is merged, --> <!-- but as PRs often change significantly during review, --> <!-- it's OK for them to be incomplete when review is first requested. --> - [ ] New or updated tests for any fix or new behavior - [ ] Updated documentation for new features and behaviors, including docstrings for API docs. ## Other Notes <!-- Please add the issue number that should be closed when this PR is merged. --> - Closes #209 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added PII replacement duration to the timing details included in Safe Synthesizer results. * Results now consistently report this timing information across evaluation workflows. * **Bug Fixes** * Corrected an issue where PII replacement time was not included in generated result summaries. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: nina-xu <19981858+nina-xu@users.noreply.github.com>
1 parent 0fddfb1 commit 44e9d54

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/nemo_safe_synthesizer/results.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def make_nss_summary(
9292
def make_nss_results(
9393
generate_results: GenerateJobResults | pd.DataFrame,
9494
total_time: float | None = None,
95+
pii_replacer_time: float | None = None,
9596
training_time: float | None = None,
9697
generation_time: float | None = None,
9798
evaluation_time: float | None = None,
@@ -106,6 +107,7 @@ def make_nss_results(
106107
generate_results: Generation output -- a ``GenerateJobResults`` or
107108
a raw ``DataFrame`` of synthetic records.
108109
total_time: Total wall-clock time in seconds.
110+
pii_replacer_time: PII replacement phase time in seconds.
109111
training_time: Training phase time in seconds.
110112
generation_time: Generation phase time in seconds.
111113
evaluation_time: Evaluation phase time in seconds.
@@ -121,6 +123,7 @@ def make_nss_results(
121123
"""
122124
timing = SafeSynthesizerTiming(
123125
total_time_sec=total_time,
126+
pii_replacer_time_sec=pii_replacer_time,
124127
evaluation_time_sec=evaluation_time,
125128
training_time_sec=training_time,
126129
generation_time_sec=generation_time,

src/nemo_safe_synthesizer/sdk/library_builder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ def evaluate(self) -> SafeSynthesizer:
631631

632632
self.results = make_nss_results(
633633
total_time=time.monotonic() - self._total_start,
634+
pii_replacer_time=self._pii_replacer_time,
634635
training_time=training_time,
635636
generation_time=generation_time,
636637
evaluation_time=evaluation_time,

0 commit comments

Comments
 (0)