Documentation ¶
Index ¶
- Constants
- func EmptyCache() error
- func ForceKill()
- func GetComputeProcessCount() int
- func GetFreeMemory() float64
- func GetInstalledGITSHA() (string, error)
- func GetLatestGitCommitSHA() (string, error)
- func IsPetalsServerInstalled() bool
- func IsPetalsServerRunning() bool
- func LaunchPetalsServer(options *RunOptions, outchan chan []byte) (context.CancelFunc, *exec.Cmd, error)
- func PipInstallPetals(pythonPath string) (chan []byte, error)
- func UpdatePetals() error
- type GPU
- type MemoryInfo
- type Peer
- type ProcessInfo
- type RunOptions
- type SMILogs
- type Status
- type Utilization
Constants ¶
View Source
const (
HealthPage = "https://health.petals.dev/api/v1/state"
)
Variables ¶
This section is empty.
Functions ¶
func EmptyCache ¶
func EmptyCache() error
func GetComputeProcessCount ¶
func GetComputeProcessCount() int
func GetFreeMemory ¶
func GetFreeMemory() float64
func GetInstalledGITSHA ¶
func GetLatestGitCommitSHA ¶
func IsPetalsServerInstalled ¶
func IsPetalsServerInstalled() bool
func IsPetalsServerRunning ¶
func IsPetalsServerRunning() bool
IsPetalsServerRunning returns true if the Petals Server process is running.
func LaunchPetalsServer ¶
func LaunchPetalsServer(options *RunOptions, outchan chan []byte) (context.CancelFunc, *exec.Cmd, error)
func PipInstallPetals ¶
func UpdatePetals ¶
func UpdatePetals() error
Types ¶
type GPU ¶
type GPU struct { ID string `xml:"id,attr"` Utilization Utilization `xml:"utilization"` Processes []ProcessInfo `xml:"processes>process_info"` FBMemoryUsage MemoryInfo `xml:"fb_memory_usage"` }
GPU is the representeation of the GPU in the nvidia-smi -q -x (XML) command.
type MemoryInfo ¶
type Peer ¶
type Peer struct { PeerID string `json:"peer_id"` State string `json:"state"` Span struct { ServerInfo struct { PublicName string `json:"public_name"` State string `json:"state"` StartBlock int `json:"start_block"` EndBlock int `json:"end_block"` UsingRelay bool `json:"using_relay"` Version string `json:"version"` } `json:"server_info"` } `json:"span"` }
type ProcessInfo ¶
type RunOptions ¶
type RunOptions struct { PublicName string // public name to use for the server MaxDiskSize int // max disk size to use for the server NumBlocks int // number of blocks to use for the server AutoStart bool // if true, will start server automatically ModelName string // e.g. "petals-team/StableBeluga2" StopOnProcess []string // process names that will stop the server }
type SMILogs ¶
type SMILogs struct { XMLName string `xml:"nvidia_smi_log"` CUDAVersion string `xml:"cuda_version"` DriverVersion string `xml:"driver_version"` GPU []GPU `xml:"gpu"` }
SMILogs is the representeation of the logs of the nvidia-smi -q -x (XML) command.
var GPUStatus *SMILogs
type Status ¶
type Utilization ¶
Click to show internal directories.
Click to hide internal directories.