feat(workflow): add cohort-based record retry#830
Draft
nabinchha wants to merge 3 commits into
Draft
Conversation
Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
Contributor
|
Fern preview: https://nvidia-preview-pr-830.docs.buildwithfern.com/nemo/datadesigner
|
- isolate durable state and stateless retry operations from the runner - derive redundant paths and warnings instead of persisting them - skip seedless base generation and add direct utility coverage Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
Decompose retry execution into focused builder, attempt, publication, and state responsibilities. Use Pydantic for validated policy and durable wire models, and rename the feature consistently from cohort retry to record retry.
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.
📋 Summary
This PR implements the cohort-based workflow retry design as an explicit alternative to the engine-native record-selection implementation in #817. It keeps a stable logical cohort, reruns only rejected slots, and publishes one ordinary durable stage artifact after the retry bounds are satisfied or exhausted.
The intent is comparison, not replacement: #817 should remain open while we evaluate the complexity and behavior of both approaches.
🔗 Related Issue
Related to #790. Alternative design to #817; this PR intentionally does not close either one.
🔄 Changes
✨ Added
plans/790/cohort-based-record-retry.md, including prior design attempts, architecture diagrams, artifact layout, crash boundaries, limitations, and validation cases.RetryUntiltoCompositeWorkflow.add_stage()with:max_attemptsand/ormax_candidate_recordsbounds;sampler_retry_mode="preserve"by default, with an explicit"resample"option;on_exhausted="raise"or"return_partial"behavior.ALWAYSversus restartableIF_POSSIBLEresume behavior.🔧 Changed
DataDesigner.create()lifecycle from a private workflow seam so hidden base/attempt runs can skip profiling and the final accepted artifact can run the original processors/profilers exactly once.CohortRetryRunnerfocused on orchestration (447 lines, down from 1,363). Durable Pydantic state and deterministic paths live incohort_retry_state.py; classification, coalescing, media, usage, metadata, and resume checks are public stateless functions incohort_retry_utils.pyso they can be tested directly.N-row stable-slot frame when no seed or preserved sampler needs materialization, avoiding a synthetic UUID column and an unnecessary base generation run.actual_num_recordsas the fallback for unprofiled artifacts such as a zero-row retry result.⚖️ Comparison notes
This keeps retry policy out of the engine scheduler and builds on ordinary workflow stages and
DataDesigner.create()runs.Library LOC below counts files under
packages/*/src/**and excludes Markdown, tests, plans, documentation, notebooks, and generated artifacts:The workflow implementation is therefore 239 net library LOC larger (+12.5%) than feat: add engine-native record selection #817: 204 more additions and 35 fewer deletions. Its structural distinction is concentration in the workflow/interface layer, an orchestration-only runner, and no selection-specific engine scheduler behavior—not a reduction in total library code.
The current v1 materializes cohort and coalescing frames in pandas, retains attempt artifacts for auditability, and serializes attempts because each attempt depends on the prior acceptance result.
Terminal processors must preserve row count. Generic plugin/external-media transactions remain outside the defined contract.
🧪 Testing
✅ Checklist