IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Python class

EplbStatsMetadata

EplbStatsMetadata​

class max.pipelines.lib.eplb_stats.EplbStatsMetadata(num_layers, num_moe_layers, moe_layer_indices, num_logical_experts, num_experts_per_token)

source

Bases: object

Static metadata describing the shape and semantics of a snapshot.

Parameters:

  • num_layers (int)
  • num_moe_layers (int)
  • moe_layer_indices (tuple[int, ...])
  • num_logical_experts (int)
  • num_experts_per_token (int)

from_dict()​

classmethod from_dict(data)

source

Constructs an instance from a dict produced by to_dict.

Tolerates legacy snapshots that only had num_moe_layers (which then meant the row count): those map to num_layers with every row treated as MoE.

Parameters:

data (dict[str, Any])

Return type:

EplbStatsMetadata

moe_layer_indices​

moe_layer_indices: tuple[int, ...]

source

Histogram row indices that correspond to MoE layers (row i == layer i).

num_experts_per_token​

num_experts_per_token: int

source

Top-k experts selected per token.

num_layers​

num_layers: int

source

Total transformer layers profiled. Equals the histogram row count.

num_logical_experts​

num_logical_experts: int

source

Number of logical experts per layer.

num_moe_layers​

num_moe_layers: int

source

Count of true MoE (routing) layers. Dense layers are all-zero rows.

to_dict()​

to_dict()

source

Returns a JSON-safe dict representation.

Return type:

dict[str, Any]