cuda

package
v2.0.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 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 cuda finds the processes of a tree that hold CUDA state and moves that state with NVIDIA's cuda-checkpoint: lock, checkpoint to host memory before the CRIU dump; restore onto the receiver's GPUs and unlock after.

Index

Constants

View Source
const (
	CallTimeout   = 90 * time.Second
	LockTimeoutMS = 60000
)

CallTimeout bounds one cuda-checkpoint call; LockTimeoutMS is how long a lock may wait for in-flight CUDA work.

Variables

This section is empty.

Functions

func DeviceMap

func DeviceMap(pairs []Pair) (string, error)

DeviceMap is cuda-checkpoint's --device-map: every GPU the processes saw, donor UUID to receiver UUID, in rank order.

func Owners

func Owners(pids []int) ([]int, error)

Owners are the processes among pids that hold CUDA state: they map libcuda and keep a /dev/nvidia* descriptor open. A vLLM engine at TP8 has ten: eight workers, the engine core and the API server.

Types

type Pair

type Pair struct {
	Source string `json:"source"`
	Target string `json:"target"`
}

Pair maps a donor GPU to a receiver GPU.

type Session

type Session struct {
	Helper string
	Owners []int
	// Parallel owners are restored concurrently, after the others: the
	// workers, when no collective keeps peer memory mapped between them.
	Parallel []int
	// contains filtered or unexported fields
}

Session moves the CUDA state of a set of processes with cuda-checkpoint. Each phase is a barrier: every owner finishes it before any starts the next. A failure is final; the caller removes the container.

func NewSession

func NewSession(helper string, owners []int) *Session

NewSession uses the helper binary at path.

func (*Session) Checkpoint

func (s *Session) Checkpoint(ctx context.Context) error

Checkpoint locks every owner and moves its device memory to the host.

func (*Session) Restore

func (s *Session) Restore(ctx context.Context, deviceMap string) error

Restore puts every owner's device memory back on the mapped GPUs and unlocks it.

Jump to

Keyboard shortcuts

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