← Back to Pull requests

fix(api): do not count DRA admin access GPU claims as GPU usage #26

Open
unknown opened this pull request with 258 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 14, 2026 00:51 UTC
Author

Description

DRA claims with adminAccess: true do not consume a device: the API lets them share a device with a regular allocation, and kube-scheduler's allocated-device tracking skips them. The GPU helpers here counted them anyway. The NVIDIA GPU Operator in DRA mode keeps admin access claims on every GPU node (DRA validator, DCGM exporter), so in KAI a one-GPU node looked fully used and every GPU pod was rejected with didn't have enough resources: GPUs.

countGPUDevicesFromClaim and getGPUDeviceClassNameFromClaim now skip requests with AdminAccess set, through one isGPUConsumingRequest check. That carries through ExtractDRAGPUResourcesFromClaims and DRAGPUResourceListFromClaims, which KAI uses for the pod's GPU request and the podgroup's requested and allocated resources.

This is the dra.go half of kai-scheduler/KAI-Scheduler#2237, moved here as asked in that PR. The other half (dra_shared_device_info.go) stays in KAI and goes in with the module bump.

Related Issues

Part of kai-scheduler/KAI-Scheduler#2236

Checklist

  • Self-reviewed

  • Added/updated tests (if needed)

  • Updated documentation (if needed)

  • Added a changelog fragment via make changelog (or applied the skip-changelog label). Do not edit CHANGELOG.md directly; pending fragments are folded into it at release time.
  • Breaking Changes

    None. Claims without admin access are counted as before.

    Additional Notes

    Tests in dra_gpu_test.go: ExactCount and All admin requests count 0, a mixed claim counts only its regular request, and admin claims are left out of ExtractDRAGPUResourcesFromClaims and DRAGPUResourceListFromClaims. They fail on main and pass with the fix.

    Checked against KAI main (049d1ba6, on v0.2.0) with a replace pointing at this branch: the tests from kai-scheduler/KAI-Scheduler#2237 in node_info and pod_info pass. With the replace pointing at unpatched main, the two admin access tests in node_info fail. make validate and make test pass, and go mod tidy leaves go.mod unchanged.

    Diff: 258 lines (+193 / -65) across 3 files Reviewer: enoodle Review duration: 50719m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.46) × (1 − Review Confidence (0.41)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 258 lines diff across 3 files
    0.46
    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%
    40%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.332
    Real PR Conversation Timeline
    1 comments
    "Review active on #26"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 40.9% 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: 46.2% (MEDIUM) · Higher = larger blast radius
    46.2%
    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: 40.9% · Lower = rushed or shallow review
    40.9%
    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%