bridge.models.kimi.kimi_k3_pipeline#
Stage-boundary packing for pipeline-parallel Kimi K3.
Module Contents#
Functions#
Return the number of AttnRes snapshots present before |
|
Pack the AttnRes prefix and snapshot bank into one pipeline tensor. |
|
Unpack the prefix and snapshot bank received from a pipeline stage. |
API#
- bridge.models.kimi.kimi_k3_pipeline.bank_num_rows(layer_idx: int, block_size: int) int#
Return the number of AttnRes snapshots present before
layer_idx.
- bridge.models.kimi.kimi_k3_pipeline.pack_stage_boundary(
- prefix_sum: torch.Tensor,
- block_residual: torch.Tensor,
Pack the AttnRes prefix and snapshot bank into one pipeline tensor.
- bridge.models.kimi.kimi_k3_pipeline.unpack_stage_boundary(
- packed: torch.Tensor,
- hidden_size: int,
- num_rows: int,
Unpack the prefix and snapshot bank received from a pipeline stage.