gpu

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MajorityArchitecture

func MajorityArchitecture(nodes []corev1.Node) string

MajorityArchitecture returns the GPU architecture reported by the most nodes, parsed from each node's nvidia.com/gpu.product label via ParseProduct. It is the single source of truth for architecture detection: the controllers and every CLI path (render, cluster info, workloadrun) derive gpusPerNode, MNNVL, and override matching from its result, so a mixed-architecture target resolves to the same architecture everywhere (issue #248).

Only labeled nodes vote. A node without the label (or with an empty value) never outvotes labeled nodes, so a fleet where the GPU feature-discovery labeler has not reached every node still detects the architecture the labeled nodes report. The function returns "" only when no node is labeled (including an empty input); callers map that to their own "unknown" sentinel or fallback.

The winner is derived by walking the slice in order with a strictly-greater count comparison (the counts map is only indexed, never iterated), so the result is deterministic for a given node order and ties resolve to the architecture whose earliest node appears first. Callers pass name-sorted nodes, which makes the result stable for a given cluster. This is the exact tie-break the Workflow and Certification controllers adopted for issue #77.

func ParseProduct

func ParseProduct(product string) string

ParseProduct extracts the GPU architecture from an nvidia.com/gpu.product label value. It strips the "NVIDIA-" prefix, takes the first segment before any hyphen, and lowercases it. Examples: "NVIDIA-H100-80GB-HBM3" → "h100", "NVIDIA-GB200-NVL72" → "gb200". Returns "" if the input is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL