← Back to Pull requests

feat: expose on-demand full-state checkpointing for SFT and OSFT #64

Open
unknown opened this pull request with 283 lines diff across 3 files
View on GitHub
unknown unknown commented on Apr 28, 2026 20:45 UTC
Author

Summary

  • Expose on_demand_checkpointing parameter for both SFT and OSFT algorithms

  • Expose resume_from_full_state_checkpoint parameter for OSFT (explicit checkpoint path for resume)

  • Add comprehensive On-Demand Checkpointing Guide covering mechanism, multi-node behavior, and Kubernetes configuration

  • Update algorithm overviews and function reference docs with new parameters and examples
  • Closes #63

    Changes

    | Algorithm | New Parameters | Description |
    |-----------|---------------|-------------|
    | SFT | on_demand_checkpointing | Signal-driven checkpoint-and-exit. Resume is automatic (backend detects checkpoints in ckpt_output_dir). |
    | OSFT | on_demand_checkpointing | Signal-driven DCP sharded checkpoint saves (each rank saves its own shard). |
    | OSFT | resume_from_full_state_checkpoint | Explicit path to checkpoint directory for resume with bit-identical trajectory fidelity. |

    Parameters are threaded through all three layers: convenience function → Algorithm.train() → get_optional_params().

    Documentation

  • Added on-demand checkpointing sections to SFT and OSFT algorithm overview pages

  • Updated sft() and osft() function reference signatures and parameter tables

  • Created comprehensive [On-Demand Checkpointing Guide](/guides/on-demand-checkpointing) covering mechanism, multi-node behavior, Kubernetes configuration, and manual triggering

  • Added the guide to sidebar navigation
  • Design Decisions

  • SFT has only on_demand_checkpointing (no explicit resume path) because the instructlab-training backend auto-detects checkpoints in ckpt_output_dir

  • OSFT has both on_demand_checkpointing and resume_from_full_state_checkpoint because the mini-trainer backend requires an explicit checkpoint path for resume

  • Both parameters map directly to the backend TrainingArgs fields with no name translation needed
  • Test plan

  • Verify on_demand_checkpointing=True is forwarded correctly to the instructlab-training backend (SFT)

  • Verify on_demand_checkpointing=True and resume_from_full_state_checkpoint are forwarded correctly to the mini-trainer backend (OSFT)

  • Review documentation renders correctly in Docsify
  • Generated with Claude Code

    Diff: 283 lines (+212 / -71) across 3 files Reviewer: RobotSail Review duration: 312591m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.47) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 283 lines diff across 3 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.338
    Real PR Conversation Timeline
    1 comments
    "Review active on #64"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 46.7% (MEDIUM) · Higher = larger blast radius
    46.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 25.8% · Safe to merge
    25.8%