feat: add support for Tecorigin GPU #3369
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3369"
general
weight: 0.35
DSFans2014
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds a Tecorigin GPU backend to the HAMi scheduler extender
(
pkg/device/tecorigin, registered asTecorigin). Tecorigin cards expose a small number ofcores each (3–4); the backend lets a pod request an arbitrary number of cores through the new
resource
tecorigin.com/gpucoreand places it on the fewest cards that can satisfy the request.Device model
DeviceInfoper physical card, keyed by the card serial number reported by the vendorlibrary (the string
teco-smiprints); the same id is what a pod pins throughtecorigin.com/use-gpuuuid.DeviceUsage.Usedcores:AccumulateCoresORs masks andCountAllocatedCorespopcounts them, so the framework never adds masks numerically.Usedcoresfield of HAMi's per-containerallocation annotation (
<uuid>,<type>,<usedmem>,<usedcores>); the plugin expands it into theglobal core indexes of
TECO_VISIBLE_DEVICES.tecorigin.com/gpucoreis a core count, not a card count. The node advertises the sum ofall cards' cores (8 cards × 4 cores = 32), and a request of
NreservesNcores.Scheduling
Fitnever spreads a request that fits on one card.GenerateResourceRequestsalways returnsNums=1withTotalCoresreq=N, sofitInDevices'Nums > len(typeDevices)check nevercompares a core count against a card count; the real card count is derived inside
Fit.Fitpicks the one that consumes the least freecapacity, so already partly-used cards get filled first and whole cards stay whole. The choice
is exact and independent of node size (cards are bucketed by free-core count, no greedy
cut-off at some card count).
served by spreading — is rejected with
CardInsufficientCoreinstead of being spread.allocation takes the lowest free bits rather than requiring a contiguous run.
CardNotHealth,CardTimeSlicingExhausted,CardUUIDMismatch,CardInsufficientCore.tecorigin.com/use-gpuuuid/tecorigin.com/nouse-gpuuuidpin or excludecards, matched exactly against the card id via
device.CheckUUID.Registration and health
hami.io/node-tecorigin-registercarries HAMi's 9-field node-deviceCSV (
id,count,memory,devcore,type,numa,health,index,mode), one segment per card, the samelayout Hygon and Iluvatar publish. All nine fields are required:
indexis the card's physicalposition and HAMi's scoring breaks ties on it, so the 7-field form (where every card lands at
index 0) is rejected.
1 TiBbound so avalue that only makes sense in bytes is rejected), derives the core mask from the core count,
forces
Type/DeviceVendortoTecorigin, and defaultsModetohami-core.hami.io/node-tecorigin-coresannotation ({"<uuid>":[global core ids]}) iscopied into
CustomInfo["coreIDs"]and logged atV(4); scheduling never reads it — it onlyhelps trace a
TECO_VISIBLE_DEVICESentry back to a card by hand.CheckHealthkeeps a node registered only whiletecorigin.com/gpucoreis allocatable and atleast one card is healthy, and fingerprints the resource, the healthy card count and both
annotations so any change triggers a re-read. It asks for an update on first sight and on
change; an unchanged node is not re-added. Without the first-sight update,
register()nevercalls
addNodeand every pod asking for teco cores fails with "node unregistered" — coveredby the new scheduler regression test.
hami.io/node-handshake-tecoriginis removed on sight andscheduled for deletion by
NodeCleanUp, following the HAMi convention.Integration
pkg/scheduler/config: newtecorigin:config key (resourceCountName), backend registeredin
InitDevicesWithConfig, accounted for inanyDeviceConfigured, and covered by the configtests.
devices.tecorigin.{resourceCountName,enabled,customresources}invalues.yaml,the extender resource list in
_helpers.tpl,tecorigin.resourceCountNamein the generatedscheduler device-config, and the regenerated values table in
charts/hami/README.md.Tests
pkg/device/tecorigin/device_test.go: annotation parsing (valid, invalid, whitespace, missingtrailing separator, normalization), mask helpers, the core-id annotation, node device
extraction, health/registration, request parsing (limits vs requests, zero, fractional), the
placement matrix (single/multi-card, fragmentation, tight packing on small and large nodes,
pin/unpin, every rejection reason), annotation patching, and bitmask accounting.
Which issue(s) this PR fixes:
Fixes #<!-- TODO: link the tracking issue; none found, open one if required by CONTRIBUTING -->
Special notes for your reviewer:
advertises
tecorigin.com/gpucoreon the node, and must be installed separately (the chartdocuments
devices.tecorigin.enabled: falseas "keep the device configuration but do not addthe resource to the extender").
maxCoresPerCardis 4 by design, because the current 3–4-core cards are the only ones served;a future card with more cores needs that bound (and the
int64mask) revisited.MemPercentagereqis101, HAMi's "no memory requirement" sentinel: cores are the onlyscheduling dimension and the backend advertises no memory resource.
ScoreNodereturns0; placement is entirely card selection insideFit, so node-levelscoring is left to the policy and other plugins.
model, driver /
teco-smiversion, and what was verified (single-card fit, multi-card fit,mask expansion in
TECO_VISIBLE_DEVICES, shared card).go test ./pkg/scheduler/... -shortpasses,golangci-lintreports0 issues on the touched packages,
hack/verify-license.sh,hack/verify-import-aliases.shand
hack/verify-rbac.shpass.go test ./pkg/device/tecorigin/currently fails inTestFitNilPodbecauseFitcallspod.GetAnnotations()on a nil pod; this must be fixed orthe test dropped before merge.
Does this PR introduce a user-facing change?:
Yes — a new
tecorigin.com/gpucoreresource, newdevices.tecorigin.Helm values, a new Podexample, and updated supported-device documentation. No existing behavior changes: the backend
only registers nodes that advertise the teco resource.
AI assistance disclosure:
Per CONTRIBUTING.md, AI assistance must be disclosed in the PR. This description was drafted
with an AI assistant from the branch diff; the code itself was authored by the contributor.
Hardware Validation
Test Cases:
1. Device plugin successfully registers and advertises
tecorigin.com/gpucoreresource on node.2. Pod with resource
tecorigin.com/gpucore: 1can be scheduled and run normally.3. Multiple pods requesting gpucore resources can be allocated correctly.
Test Evidence:
<img width="1487" height="855" alt="image" src="https://github.com/user-attachments/assets/7977501c-8460-4b41-b7c4-f561bf0ea749" />
<img width="1488" height="833" alt="image" src="https://github.com/user-attachments/assets/d75f9b51-4d1a-49dd-b794-7a2886ff6ae2" />
<img width="774" height="76" alt="image" src="https://github.com/user-attachments/assets/fa51fc79-5a81-45b2-ac50-2b8478cbfe70" />
<img width="1399" height="879" alt="image" src="https://github.com/user-attachments/assets/bd686318-6cdb-4d1c-8ba4-dc564726ae90" />
<img width="1431" height="878" alt="image" src="https://github.com/user-attachments/assets/ccc6f0c6-deef-4545-894a-9e193c980205" />
<img width="1433" height="882" alt="image" src="https://github.com/user-attachments/assets/d6357751-87ac-4ad5-a28a-f81396bb027d" />
<!-- TODO: state the extent of AI use for the code (e.g. "code written primarily by ...", "AI used for docs only") and remove this placeholder. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Added Tecorigin GPU scheduling support, including GPU-core requests, device health checks, and allocation across available cards.
Added configurable GPU-core resource names and optional extender-managed resources. Tecorigin scheduling is enabled by default.
Added a sample Pod manifest requesting one Tecorigin GPU core.
Documentation
* Documented the Tecorigin chart settings, defaults, and resource configuration options.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->