← Back to Pull requests

Use the accelerator device in TestZero3SynchronizedEarlyStop #9058

Closed
unknown closed this pull request without merging on Nov 12, 2026 13:43 UTC
View on GitHub
unknown unknown commented on Nov 11, 2026 18:33 UTC
Author

what

TestZero3SynchronizedEarlyStop (added in #8390) builds its tensors on torch.device(f"cuda:{rank}"). on the cpu multi-rank nightly (cpu-torch-multi-latest, LOCAL_SIZE=4) the test is admitted by the world-size gate, and the first torch.tensor(..., device=device) raises AssertionError: Torch not compiled with CUDA enabled. that is the 2026-11-11 recurrence in #9033 (run 42957495892).

this takes the device from get_accelerator().current_device_name(), which is cpu on the cpu accelerator and cuda:<local rank> on cuda, so the gpu path is unchanged.

why this is not a duplicate

no open pr touches this test; #9009 and #9037 edit the same file but not this class.

tests

on cpu (8 vcpu x86_64, torch 2.15.0+cpu, python 3.12), with LOCAL_SIZE=4:

  • before: pytest unit/runtime/rollout/test_hybrid_engine_rollout.py::TestZero3SynchronizedEarlyStop fails with Torch not compiled with CUDA enabled, same traceback as the nightly

  • after: 1 passed

  • pytest unit/runtime/rollout/: 94 passed, 2 skipped; TestZero3SubgroupGeneration failed locally only because accelerate is not installed in my env

  • flake8 and yapf clean on the changed file
  • not run on gpu; the cuda device string is the same as before apart from using the local rank instead of the global rank.

    fixes #9033 (the hybrid engine rollout part; the earlier test_tp_compile.py failure looked flaky per the thread)

    Diff: 177 lines (+132 / -45) across 2 files Reviewer: delock Review duration: 1149m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.35 · 177 lines diff across 2 files
    0.35
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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
    Diff Size diff_size
    0.310
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #9058"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 35.4% (MEDIUM) · Higher = larger blast radius
    35.4%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 14% · Safe to merge
    14%