fix: stub wandb so lora_grpo survives without it in ART 0.5.18 #150
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.37) × (1 − Review Confidence (0.56)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 101 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.277
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #150"
general
weight: 0.35
coderabbitai[bot]
Maxusmusti
Problem
lora_grpowithbackend="art"hangs forever after the first training iteration when wandb is not installed, silently returning partial results.Root cause chain (reproduced deterministically 3× on H100, diagnosed via py-spy + an asyncio task dump of the training subprocess):
1. ART 0.5.18 bug:
LocalBackend.train()unconditionally callsmodel._get_wandb_run()after each training step to record W&B provenance, and_get_wandb_run()doesimport wandbbefore checking whetherWANDB_API_KEYis set. Without wandb installed, this raisesModuleNotFoundErrorright after iteration 1's train → wake → LoRA adapter load.2. The exception kills vLLM: it unwinds into
_run_training's cleanup, which shuts down the vLLM runtime — the sleep/wake log ends with an unexpected"Shutting down"immediately after the first wake +load_lora_adapter.3. The hang: due to nest_asyncio re-entrancy in the trainer task (blocked inside a nested
asyncio.runwaiting on the inputs queue), the cancellation in ART's cleanup never delivers. The exception stays trapped in the completed main task,asyncio.runcan't return, and the subprocess never exits — no error file, no traceback. The parent sits inproc.join()untilTRAINING_HUB_JOIN_TIMEOUTand returns the partial iteration-1 results.Fix
_install_wandb_stub()— same pattern as the existing megatron bridge stub for ART 0.5.18. When the real wandb is absent and noWANDB_API_KEYis configured, install a minimal no-opwandbmodule intosys.modulesbefore importing art. In that configuration_get_wandb_run()returnsNoneimmediately after the (stubbed) import, so no wandb functionality is ever exercised. If the real wandb is installed, or an API key is set but the package is missing, the stub is not installed so the genuine behavior/error surfaces.Validation
Functional, on H100 with training_hub v0.10.0, ART 0.5.18, trl 1.13.0, vLLM 0.28 runtime, torch 2.13.0+cu130 (the RHAI 3.6 EA2 lockfile stack):
| | before | after |
|---|---|---|
| iterations completed | 1/3 (hang) | 3/3 |
| mean reward per iter | 0.39 (partial) | 0.39 → 0.45 → 0.48 |
| vLLM sleep/wake cycles | 1, then
"Shutting down"| 3/3, shutdown only at end || checkpoints | 0000–0001 | 0000–0003 |
Also:
tests/test_lora_grpo_wandb_stub.py, 4 tests)Caveat: the underlying ART issue (unguarded
import wandb) is worth reporting/fixing upstream too — the stub carries a "remove when ART guards the import" note, same as the megatron stub.🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Bug Fixes
Improved training startup in environments without a W&B installation or API key. Existing W&B setups remain unaffected, and configured API keys continue to be respected. This helps avoid startup issues in setups that do not use W&B while preserving behavior when W&B is available or explicitly configured.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->