policy

API Reference: v1/policy.proto

Policy specifies the power policies for devices. Policies are defined within a topology with unique names describing the power min-max values.

Table of Contents

Messages

GPUPolicies

GPUPolicies is a list of GPUPolicy objects. Each policy in the list should address a unique GPU.

Field Type Description
policies repeated GPUPolicy The GPU policies. Each policy should address a distinct GPU

GPUPolicy

GPUPolicy specifies the power policy for a single GPU in a node.

Field Type Description
gpu_id uint32 The GPU ID
oneof _power_limit.power_limit optional PowerLimit The power limit. Null value means the GPU does not have a set policy. Use null to remove GPU-specific policy assignment

PolicyApplyStatus

Policy application status including applied policy details

Field Type Description
policy PolicyObject Properties of policy to be created
status Status Operation status

PolicyCreateRequest

PolicyCreateRequest is used by the TopologyManagementService.PolicyCreate.

Field Type Description
object PolicyObject Properties of policy to be created

PolicyCreateResponse

PolicyCreateResponse is returned if policy creation was successful.

Field Type Description
status Status Operation status

PolicyLimit

PolicyLimit specifies a power limit for a specific entity type.

Field Type Description
element_type PolicyElementType The entity type to which the power limit applies
power_limit PowerLimit The power limit value

PolicyObject

PolicyObject specifies a topology or resource group entity power policy.

Field Type Description
name string Name of the policy. The name must be unique within a topology.
limits repeated PolicyLimit Limits for the policy
properties google.protobuf.Struct Properties for the policy

PowerLimit

PowerLimit specifies a power limit for a specific entity

Field Type Description
oneof power_limit.watts double none
oneof power_limit.percentage double none

Enums

PolicyElementType

PolicyElementType specifies the type of entity to which the power limit applies

Name Number Description
POLICY_ELEMENT_TYPE_NODE 0 none
POLICY_ELEMENT_TYPE_GPU 1 none
POLICY_ELEMENT_TYPE_CPU 2 none
POLICY_ELEMENT_TYPE_MEMORY 3 none

Scalar Value Types

.proto Type Notes C++ Type Java Type Python Type

double
double double float

float
float float float

int32
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int

int64
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long

uint32
Uses variable-length encoding. uint32 int int/long

uint64
Uses variable-length encoding. uint64 long int/long

sint32
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int

sint64
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long

fixed32
Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int

fixed64
Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long

sfixed32
Always four bytes. int32 int int

sfixed64
Always eight bytes. int64 long int/long

bool
bool boolean boolean

string
A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode

bytes
May contain any arbitrary sequence of bytes. string ByteString str