← Back to Pull requests

ci/gpu: run only GPU-marked Python tests in test-vxpu-gpu #975

Open
unknown opened this pull request with 532 lines diff across 6 files
View on GitHub
unknown unknown commented on Nov 29, 2026 23:27 UTC
Author

vxpu/testutil: add GPU test markers and runner filtering

Add explicit GPU test decorators in vxpu/python/vxpu/testutil.py and
filtering and skip-enforcement flags in dev/ci/test_runner.py so GPU CI
can run only GPU-exercising Python tests without maintaining a separate
test list that drifts.

  • Add @requires_cuda, @requires_cuda_triton, and @gpu_test in

  • vxpu/python/vxpu/testutil.py. @requires_cuda and
    @requires_cuda_triton mark a TestCase class or method with
    _vxpu_gpu_test = True and skip on CPU when CUDA or Triton is
    unavailable. @gpu_test marks dual-mode tests that execute a CPU path
    on CPU and a CUDA path when CUDA is available.
  • Mark all 16 CUDA/Triton tests and 4 dual-mode CPU/CUDA tests (3 in

  • compile_package_test.py and 1 in kernels_test.py) across 12 test
    files.
  • Add --gpu-only, --fail-on-skip, and --require-skipped-gpu to

  • dev/ci/test_runner.py. --gpu-only filters the discovered
    TestSuite down to GPU-marked tests while retaining
    unittest.loader._FailedTest import errors and failing if 0 tests are
    selected. --fail-on-skip fails if any executed test skips.
    --require-skipped-gpu fails on CPU if any test skips with a CUDA,
    GPU, or Triton reason without carrying a GPU test marker.
  • Add unit tests in vxpu/python/vxpu/testutil_test.py covering

  • class/method marking, suite filtering with load failures, and CLI flag
    enforcement.

    ci/gpu: run only GPU-marked Python tests in test-vxpu-gpu

    Wire the GPU test filter and skip enforcement into the CI scripts so
    test-vxpu-gpu stops re-running the 205 CPU-only Python tests that
    test-vxpu-python already gates on every PR.

  • Update dev/ci/gpu/test-vxpu-gpu to invoke

  • python -u dev/ci/test_runner.py --gpu-only --fail-on-skip, and remove
    the duplicate standalone SpeculationEngineCUDATest invocation since
    test_runner.py now runs it with fatal skip checking. All Go GPU
    acceptance tests remain unchanged.
  • Update dev/ci/presubmits/test-vxpu-python to invoke

  • python -u dev/ci/test_runner.py --require-skipped-gpu and typecheck
    dev/ci/test_runner.py with pyright==1.1.414. Any new test that
    skips on CPU for CUDA, GPU, or Triton without a GPU decorator now fails
    CPU CI immediately, preventing silent coverage gaps.

    Coverage verification (225 discovered Python tests):

  • test-vxpu-python (CPU, --require-skipped-gpu): 208 executed and

  • passed, 16 GPU tests skipped (all 16 verified GPU-marked), 1 optional
    local tokenizer test skipped (VXPU_TOKENIZER_PATH unset).
  • test-vxpu-gpu (L4, --gpu-only --fail-on-skip): 20 executed and

  • passed, 0 skipped (all 16 CUDA/Triton tests skipped on CPU plus 4
    dual-mode CPU/CUDA tests).
  • Union: 100% of CI-runnable Python tests execute and pass (224/224),

  • with 0 GPU tests skipped or dropped.

    Measured speedup on NVIDIA L4 (driver 580.178.04, torch 2.14.1+cu130,
    same pod with warm venv/HF mirror and fresh VXPU_TEST_AOTI_CACHE_DIR
    before each run):

  • Before (HEAD 1121061):

  • - test_runner.py full discovery: 222 tests (221 passed, 1 skipped)
    in 1316.256s unittest / 1336s wall clock (22m 16s)
    - Duplicate standalone SpeculationEngineCUDATest: 1 test (1 passed)
    in 137.091s unittest / 140s wall clock (2m 20s)
    - Total Python phase before: 223 test executions in 1476s (24m 36s)
  • After (this PR):

  • - test_runner.py --gpu-only --fail-on-skip: 20 GPU tests selected
    out of 225 discovered (205 CPU-only excluded), 20 passed, 0 skipped
    in 620.788s unittest / 640s wall clock (10m 40s)
  • Speedup:

  • - Python discovery phase: 1336s -> 640s (2.09x faster, -696s / -52.1%)
    - Total Python phase: 1476s -> 640s (2.31x faster, -836s / -56.6%)

    Also verified full ./dev/ci/gpu/test-vxpu-gpu end-to-end on NVIDIA L4
    (hero journey, 20/20 GPU Python tests with 0 skips, all Go GPU acceptance
    tests including TestCompilerClient_ThroughRealAgentAndService,
    TestCmdPlanPackages_BuildThroughService,
    TestMultiShardInt4PlanAndExecute, TestVerifyPlanEquivalence_GPU_*,
    TestSeparateDraftSpeculationOverGRPC, and vxpu.kernel_tools.check),
    pyright==1.1.414 (0 errors on vxpu/python, dev/ci/hf_mirror.py, and
    dev/ci/test_runner.py), ap generate //..., and ap lint.

    Fixes #968

    Diff: 532 lines (+399 / -133) across 6 files Reviewer: justinsb Review duration: 1147m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.48) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 532 lines diff across 6 files
    0.48
    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%
    42%
    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.376
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #975"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% 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: 47.9% (MEDIUM) · Higher = larger blast radius
    47.9%
    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: 43.0% · Lower = rushed or shallow review
    43.0%
    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: 27.3% · Safe to merge
    27.3%