Add checkpointing support to the SWIFT mechanism - #95
Open
copybara-service[bot] wants to merge 1 commit into
Open
Add checkpointing support to the SWIFT mechanism#95copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
cl/952333775
branch
2 times, most recently
from
July 29, 2026 01:04
4609771 to
585366d
Compare
Introduces `dpsynth.filesystem.FileSystem`, a small pluggable wrapper over filesystem operations (open/exists/makedirs/remove), and `dpsynth.checkpoint.Checkpointer`, which persists and restores intermediate mechanism state as `.npz` blobs via `mbi.save` / `mbi.load`. The checkpointer separates two storage roles so that resume-only state is never confused with inspectable output: - A `PrivateStore` holds resume-only state (exact marginals, noisy measurements, the estimated model). It is read back to resume a preempted run and is never intended for human inspection; it may contain sensitive intermediates and must be given the same protections as the input data. - A `PublicSink` holds DP-safe outputs intended to be inspected or consumed downstream. It is write-only (egress) and is never read back by the library. `LocalDirStore` and `LocalDirSink` implement the two roles on top of `FileSystem` (writing under `private/` and `public/` respectively); `Checkpointer.local(working_dir)` wires them up. The same two roles map cleanly onto a Trusted Execution Environment's release APIs (a private store onto the recovery-info channel, a public sink onto the unencrypted-release channel), so the abstraction doubles as a TEE hook. `SWIFTMechanism` gains an optional `checkpointer` field. When it has a private store, SWIFT persists resume-only state and resumes from the latest completed phase after a preemption: a fully completed run (model + noisy measurements) resumes straight to synthesis, and exact marginals are reused to skip recomputation. Sensitive intermediates are deleted once they are no longer needed. When the checkpointer has no stores (the default) every operation is a no-op, so existing behavior is unchanged. PiperOrigin-RevId: 952333775
copybara-service
Bot
force-pushed
the
cl/952333775
branch
from
July 29, 2026 01:18
585366d to
d893feb
Compare
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.
Add checkpointing support to the SWIFT mechanism
Introduces
dpsynth.filesystem.FileSystem, a small pluggable wrapper overfilesystem operations (open/exists/makedirs/remove), and
dpsynth.checkpoint.Checkpointer, which persists and restores intermediatemechanism state as
.npzblobs viambi.save/mbi.load.The checkpointer separates two storage roles so that resume-only state is never
confused with inspectable output:
PrivateStoreholds resume-only state (exact marginals, noisymeasurements, the estimated model). It is read back to resume a preempted run
and is never intended for human inspection; it may contain sensitive
intermediates and must be given the same protections as the input data.
PublicSinkholds DP-safe outputs intended to be inspected or consumeddownstream. It is write-only (egress) and is never read back by the library.
LocalDirStoreandLocalDirSinkimplement the two roles on top ofFileSystem(writing underprivate/andpublic/respectively);Checkpointer.local(working_dir)wires them up. The same two roles map cleanlyonto a Trusted Execution Environment's release APIs (a private store onto the
recovery-info channel, a public sink onto the unencrypted-release channel), so
the abstraction doubles as a TEE hook.
SWIFTMechanismgains an optionalcheckpointerfield. When it has a privatestore, SWIFT persists resume-only state and resumes from the latest completed
phase after a preemption: a fully completed run (model + noisy measurements)
resumes straight to synthesis, and exact marginals are reused to skip
recomputation. Sensitive intermediates are deleted once they are no longer
needed. When the checkpointer has no stores (the default) every operation is a
no-op, so existing behavior is unchanged.