Add InstructLab and Mini-Trainer adapters for TrainingHubCallback (RHOAIENG-77627) #141
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.59) × (1 − Review Confidence (0.65)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.59 · 1091 lines diff across 12 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.47 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
Diff Size
diff_size
0.400
Real PR Conversation Timeline
1 comments
"Review active on #141"
general
weight: 0.35
RobotSail
Sridhar1030
Summary
Extension of #128 (RHOAIENG-77626): completes unified callbacks across all Training Hub backends.
#128 added
TrainingHubCallback+TrainingHubContextand the Unsloth adapter forlora_sft(callbacks=...). This PR adds the InstructLab and Mini-Trainer bridge adapters so the same callback API works onsft()andosft()— including torchrun serialization across the subprocess boundary.Split 2 of RHOAIENG-54744. Closes RHOAIENG-77627.
What's included
| Piece | Details |
| --- | --- |
|
adapters/serialize.py| Class-source encode/decode for torchrun boundary ||
adapters/distributed.py|HubCallbackDispatcher, native →TrainingHubContextmapping ||
adapters/instructlab.py|InstructLabCallbackBridge+adapt_hub_callbacks()||
adapters/mini_trainer.py|MiniTrainerCallbackBridge+adapt_hub_callbacks()||
sft()/osft()|callbacks=param wired through algorithm + backend ||
callbacks.py| Torchrun serialization constraints documented || Tests |
tests/test_callbacks.py(+242 lines) || Examples |
callback_smoke_instructlab.py,callback_smoke_mini_trainer.py|Backend requirements
Requires native callback modules in upstream backends:
| Package | Minimum version |
| --- | --- |
|
instructlab-training| 0.16.2 ||
rhai-innovation-mini-trainer| 0.8.3 |Universal image tracking (not a merge blocker): RHOAIENG-81150
Test plan
pytest tests/test_callbacks.py(26 tests; mini bridge needs mini-trainer ≥0.8.3)sft(callbacks=...)+osft(callbacks=...)with pinned backend versionsimport instructlab.training.callbacks+import mini_trainer.callbackswith 0.16.2 / 0.8.3Smoke (GPU):
Related
callbacks=(follow-up)<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Added callback support to SFT and OSFT training workflows.
Added lifecycle event reporting across InstructLab and Mini-Trainer backends.
Added callback persistence and restoration for distributed training.
Added standalone smoke-test scripts for both training workflows.
Documentation
Expanded callback documentation with backend support, distributed usage, and examples.
Documented backend user-experience differences and configuration considerations.
Tests
Added coverage for callback dispatch, serialization, distributed execution, and backend integration.
* Added a validation script for callback tests and optional smoke checks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->