feat: Add lora_grpo implementation to training hub algorithms #111
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 414 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.361
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #111"
general
weight: 0.35
briangallagher
RHOAIENG-62928
<!-- Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, check our contributor guidelines: https://www.kubeflow.org/docs/about/contributing
2. To know more about Kubeflow SDK, check the developer guide:
https://github.com/kubeflow/sdk/blob/main/CONTRIBUTING.md
3. If you want faster PR reviews, check how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
-->
What this PR does / why we need it:
Add LORA_GRPO algorithm for RLVR/GRPO training
Adds support for Group Relative Policy Optimization (GRPO) via the ART backend as a new Training Hub algorithm.
Changes
Algorithm registration (algorithms.py)
- Register lora_grpo in the algorithm registry with DEFAULT_COMMAND entrypoint (not torchrun — ART is single-GPU and manages its own vLLM subprocess; torchrun env vars leak into it and cause NCCL timeouts)
- Metrics file pattern: training_metrics.jsonl (shared with lora_sft)
RHAI Training Hub integration (rhai/traininghub.py)
- Add LORA_GRPO to TrainingHubAlgorithms enum
- Add _read_lora_grpo_metrics() — reads ART's two-phase JSONL format (rollout + train lines per iteration), merges them into a single dict
- Add _transform_lora_grpo() — maps GRPO metrics to controller schema (progressPercentage, currentStep, loss, mean_reward, full_match_rate, entropy)
- Wrap instrumentation activation in if __name__ == '__main__': guard to prevent [Errno 98] Address already in use when ART's multiprocessing.spawn re-executes the script in child processes
Tests
- Algorithm registry: spec lookup, known algorithms set, shared metrics pattern allowlist, pod metadata, python entrypoint assertion
- RHAI: enum value, entrypoint validation, wrapper script __main__ guard, two-phase metrics reader, empty file handling, metrics transformer (with and without max_steps), cleanup on startup
Dependencies
- Training Hub 0.8.1 release
Which issue(s) this PR fixes _(optional, in
Fixes #<issue number>, #<issue number>, ...format, will close the issue(s) when PR gets merged)_:Fixes #
Verification steps _(required; provide valid, reproducible steps for reviewers to verify your changes, e.g. setup, commands, expected outcome, notebooks)_:
_Example: 1. Check out this branch. 2. Run
make test-python. 3. Confirm that …_Checklist:
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Added LoRA GRPO training algorithm with integrated metrics reading and merging, mapping to controller-friendly training metrics (includes progress percentage and remaining-time estimates).
Generated runtime wrappers now include a main-entry guard and use a Python entrypoint for improved runtime compatibility and stability.
Tests
* Extended test coverage for LoRA GRPO: metrics instrumentation, two-phase merged metrics handling, stale/empty metrics behavior, progress/remaining-time calculations, and runtime-wrapper behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->