Skip to main content
This API is part of the sdkruntimepybind module documented in the SdkRuntime API Reference.

Imports

The classes and enums documented on this page live in cerebras.sdk.runtime.sdkruntimepybind. The canonical import block for an SdkLayout-based host program is:
from cerebras.sdk.runtime.sdkruntimepybind import (
    SdkLayout,
    SdkTarget,
    Color,
    Route,
    Edge,
    RoutingPosition,
)
For host programs that mix SdkLayout with SdkRuntime (the typical case), import SdkRuntime and SdkCompileArtifacts from the same module:
from cerebras.sdk.runtime.sdkruntimepybind import (
    SdkRuntime,
    SdkCompileArtifacts,
)

CodeRegion

class cerebras.sdk.runtime.sdkruntimepybind.CodeRegion
Bases: object
Specifies a code region.

Color

class cerebras.sdk.runtime.sdkruntimepybind.Color(name: str, value: Optional[int] = None)
Bases: object
Represents a color with an optional user-specified physical value. Objects of this class can be used for routing and can also be used to set microcode parameter values. If a physical value is not provided, then a physical value will be allocated automatically by the compiler.

Edge

class cerebras.sdk.runtime.sdkruntimepybind.Edge
Bases: Enum
Represents edge positions along the boundary of a code region.
Values:
  • TOP
  • BOTTOM
  • LEFT
  • RIGHT

EdgeRouteInfo

class cerebras.sdk.runtime.sdkruntimepybind.EdgeRouteInfo
Bases: object
For a given code region, represents the routing positions in one of the region’s four edges.

FP16TYPE

class cerebras.sdk.runtime.sdkruntimepybind.FP16TYPE
Bases: Enum
Specifies the 16-bit floating point format for compilation.
Values:
  • F16: IEEE 754 half-precision (f16)
  • BF16: Brain floating point (bf16)
  • CB16: Cerebras 16-bit floating point (cb16)

SdkLayout

class cerebras.sdk.runtime.sdkruntimepybind.SdkLayout(platform: SdkExecutionPlatform, **kwargs)
Bases: object
Specifies a program layout. This API allows the user to define rectangular code regions, define color routing and switching, automatically allocate colors, and automatically route between code regions.

PortHandle

class cerebras.sdk.runtime.sdkruntimepybind.PortHandle
Bases: object
Handle to a program input or output data port.

Route

class cerebras.sdk.runtime.sdkruntimepybind.Route
Bases: Enum
Represents route directions.
Values:
  • RAMP
  • EAST
  • WEST
  • NORTH
  • SOUTH

RoutingPosition

class cerebras.sdk.runtime.sdkruntimepybind.RoutingPosition
Bases: object
Represents a single routing position, which can consist of one or more route values for input and one or more route values for output.

get_edge_routing

cerebras.sdk.runtime.sdkruntimepybind.get_edge_routing(edge: Edge, routes: List[RoutingPosition]) → EdgeRouteInfo
Construct an edge routing info object from a given edge and routing positions.
  • Returns: Object containing edge routing info.
  • Return type: EdgeRouteInfo

Geometry

IntRectangle

class cerebras.geometry.geometry.IntRectangle(origin: IntVector, dims: IntVector)
Bases: object
Defines a rectangle of values.

IntVector

class cerebras.geometry.geometry.IntVector(x: int, y: int)
Bases: object
Wraps a tuple of two integer values, often used to specify coordinates or offsets.