← Back to Pull requests

feat(consumable-shares): implements system-mediated sharing #1257

Closed
unknown closed this pull request without merging on Jul 30, 2026 16:24 UTC
View on GitHub
unknown unknown commented on Jul 17, 2026 06:22 UTC
Author

<!-- Thanks for sending a pull request! See CONTRIBUTING.md for guidelines. -->

What type of PR is this?


/kind feature

What this PR does / why we need it:


This PR adds support for Consumable Shares, allowing multiple ResourceClaim objects to share the same physical GPU or MIG device when configured via --consumable-shares.
It also explicitly disallows using MPS when using consumable shares due to multi-claim MPS daemon limitations, while preserving standard per-claim MPS daemons when consumable shares is not used.

Which issue(s) this PR is related to:


fixes of #659
<!--
Use "Fixes #<issue number>" to auto-close the issue on merge.
Write "N/A" if there is no associated issue.
-->

Special notes for your reviewer:


  • Feature Gate & Flag: Added ConsumableShares feature gate and --consumable-shares CLI flag (disabled, memory, unlimited, or share count integer).

  • Advertisement & Overlap: Updates ResourceSlice objects with AllowMultipleAllocations: true and permits overlapping claims with matching configs.

  • Reference Counting: Unprepare uses reference counting so shared GPUs/dynamic MIGs are only torn down when no active claims remain on the physical device.

  • MPS Disallowance: Prepare rejects MPS claims when consumable shares is used on the node ("MPS sharing is not supported when consumable shares is enabled").
  • Does this PR introduce a user-facing change?


    <!--
    Write "NONE" if there is no user-facing change.
    Otherwise, describe the change for driver users / cluster admins. Examples:
  • new or changed CLI flags on the kubelet-plugin / controller

  • changes to DeviceClass, ResourceClaim, or CRD shapes

  • behavior changes for MIG, time-slicing, IMEX, or sharing modes

  • deployment/Helm chart changes (values, defaults, RBAC)

  • Include "action required" if users must change configs or manifests when upgrading.
    -->
    ``release-note
    Added ConsumableShares feature gate and --consumable-shares flag to enable multi-claim GPU/MIG sharing. MPS sharing is explicitly disallowed when consumable shares is used.
    
    #### Additional documentation (design docs, usage docs, etc.):
    
    <!--
    Link any supporting docs, e.g.:
    - updates under site/content/ (design, MIG, IMEX, sharing, etc.)
    - README or demo/ updates
    - related KEPs in kubernetes/enhancements
    Use permalinks (commit SHA) rather than branch links so references stay stable.
    -->
    
    docs
    demo/specs/consumable-shares
    `

    Checklist

    <!-- Tick what applies; leave others unchecked. CI re-runs some of these, but catching them locally shortens the review loop. -->

  • make check test passes locally

  • make check-generate passes if api/ changed (CRDs, deepcopy, informers, listers, clientset)

  • make check-modules passes if go.mod / go.sum changed

  • Tests added or updated for the change

  • Helm chart (deployments/helm`) updated if flags, RBAC, or defaults changed
  • Diff: 374 lines (+280 / -94) across 4 files Reviewer: johnbelamaric Review duration: 19322m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 374 lines diff across 4 files
    0.43
    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.355
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1257"
    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: 42.9% (MEDIUM) · Higher = larger blast radius
    42.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: 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: 16.9% · Safe to merge
    16.9%