gpu

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gpu is the launcher's view of GPU health (go/launch spec 0001 D9). It holds no NVML: the reader lives in gpu/nvml, behind a build tag, so the default build stays free of cgo.

Index

Constants

View Source
const (
	CounterECC          = "ECC errors"
	CounterRemappedRows = "remapped rows"
)

The counters Faults reads, as named in Device.Unsupported.

Variables

View Source
var ErrUnavailable = errors.New("gpu: health reading unavailable")

ErrUnavailable is returned by a Reader that cannot reach its library or devices.

Functions

func Unsure

func Unsure(start, end []Device) []string

Unsure says what stops a comparison ruling out a fault: a counter that went backwards was reset during the run, a GPU with no start reading has only its absolute count, and an unsupported counter shows nothing.

Types

type Device

type Device struct {
	UUID string
	// UncorrectedECC is the volatile count of uncorrected ECC errors.
	UncorrectedECC uint64
	RemapPending   bool
	RemapFailure   bool
	RetiredPending bool
	Throttle       uint64
	TemperatureC   int
	// Unsupported names the counters this GPU or its driver can't give, whose fields above are zero
	// because they are unknown.
	Unsupported []string
}

Device is one visible GPU's counters at a moment.

type Fault

type Fault struct {
	GPU string
	Xid []int
	// At is the event's time when an Xid in the fault set showed it, and zero when only the
	// end-of-run counters did (D8).
	At time.Time
	// Reason names what showed the fault, for the document's evidence.
	Reason string
}

Fault is what a run's readings say about one GPU.

func Faults

func Faults(start, end []Device, xids []Xid) []Fault

Faults compares a run's start and end readings and its Xid events.

func Lost

func Lost(start, end []Device) []Fault

Lost is the GPUs in the start reading that the end reading no longer has. Only an end reading that succeeded can say so.

type Reader

type Reader interface {
	// Snapshot reads every visible GPU's counters.
	Snapshot(ctx context.Context) ([]Device, error)
	// Watch sends Xid events until ctx ends, then closes the channel.
	Watch(ctx context.Context) (<-chan Xid, error)
	// Close releases the library.
	Close() error
}

Reader reads a node's GPUs.

type Xid

type Xid struct {
	GPU string
	Xid int
	At  time.Time
}

Xid is one critical error event, dated when the reader saw it, so a fault can be placed before the NCCL errors it causes (D8). NVML's events carry no time of their own.

Jump to

Keyboard shortcuts

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