← Back to Pull requests

DRA: publish topology-aware devices #820

Closed
unknown closed this pull request without merging on Oct 07, 2026 09:00 UTC
View on GitHub
unknown unknown commented on Sep 28, 2026 19:38 UTC
Author

DRA topology-aware devices

NUMA nodes as DRA devices

Fifth PR of the DRA series. Two commits: the topology-aware policy publishes its NUMA nodes as DRA devices, then an e2e test that the devices publish correctly.

One device per NUMA node

Each node with CPUs we may hand out becomes a device named cpudevnuma<NNN> after the node ID, with allowMultipleAllocations and a dra.cpu/cpu capacity (KEP-5075) equal to the node's share of the CPUs an exclusive grant can draw from: the root pool's static supply, isolated plus sharable, which already leaves out the reserved CPUs. A node with none of those, all reserved or with no CPUs at all, is left out.

The request policy is Default: 1 with ValidRange{Min: 1, Step: 1}, so a claim naming no amount takes one CPU rather than the whole node, and requests are whole CPUs. nodeAllocatableResources maps the capacity to cpu with multiplier 1 (KEP-5517), which lets the scheduler count claimed CPUs into the node's capacity; an API server without that gate drops the field silently.

Attributes: the standard resource.kubernetes.io/numaNode as a scalar int, plus dra.cpu/socketID from the node's package and dra.cpu/smtEnabled.

Devices are published from Start and from Reconfigure. The policy keeps no copy to compare against: the resourceslice controller already leaves a slice alone when its devices did not change, so republishing the same devices
costs no API write. A publish failure fails Start. In Reconfigure it is logged instead, since the new configuration is in effect by then and past startup publishing only hands the devices to the controller.

What is not here

AllocateClaim and ReleaseClaim are still the ErrNoDRAClaims stubs, so the scheduler can allocate a claim on these devices but preparing it fails. The allocator, the accounting and the DeviceClass follow in the next PRs. Until
then the devices are observable but not usable, which is the cost of keeping the device model and the allocator in separate reviews.

Verification

  • go test ./... passes, and golangci-lint finds no issues.

  • The policy tests run on the recorded server sysfs, a two-package, four-node machine with SMT, two memory-only nodes and kernel-isolated CPUs: one device per node with the right CPUs counted, a node left out when it has no CPUs we may use, reserved CPUs subtracted, one whole device asserted field by field, and Reconfigure republishing a reserved-CPU change.

  • Added an e2e test, test42-dra-devices (n4c16): launches the policy with DRA on and CPU 15 reserved, waits for the ResourceSlice, and checks one device per NUMA node, the numaNode, socketID and smtEnabled attributes, the dra.cpu/cpu capacity of exactly 4, 4, 4 and 3 and its request policy, allowMultipleAllocations, and nodeAllocatableResources when the API server keeps it. The slice is fetched once and each device is looked up by

  • name, so a node left out cannot shift the others. A slice with no devices fails the test rather than passing for one without the gate. No claim or pod: AllocateClaim/ReleaseClaim still fail, so nothing can be claimed against these devices yet. Ran on gated VM (PASS) and on an ungated VM (clean SKIP, DRAConsumableCapacity off). This e2e test does not run in CI.

    Diff: 415 lines (+311 / -104) across 5 files Reviewer: bart0sh Review duration: 12322m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 415 lines diff across 5 files
    0.45
    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.361
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #820"
    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: 44.9% (MEDIUM) · Higher = larger blast radius
    44.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: 17.8% · Safe to merge
    17.8%