bridge.models.conversion.gtp#
Translate between stored GTP shards and the TP-local tensors used by mappings.
Module Contents#
Functions#
Return the logical TP-local shape, excluding GTP padding and sharding. |
|
Let TE update native FP8 storage while preserving the GTP parameter subclass. |
|
Take the stored GTP row shard after the mapping has applied TP splitting. |
|
Gather only the GTP axis, leaving TP/EP/PP handling to the mapping. |
API#
- bridge.models.conversion.gtp._is_gtp_param(param: torch.Tensor | None) bool#
- bridge.models.conversion.gtp._get_mapping_shape(param: torch.Tensor) torch.Size#
Return the logical TP-local shape, excluding GTP padding and sharding.
- bridge.models.conversion.gtp._gtp_weight_load_context(
- param: torch.Tensor,
- module: torch.nn.Module,
Let TE update native FP8 storage while preserving the GTP parameter subclass.
- bridge.models.conversion.gtp._slice_gtp_weight(
- weight: torch.Tensor,
- param: torch.Tensor,
Take the stored GTP row shard after the mapping has applied TP splitting.
- bridge.models.conversion.gtp._gather_gtp_weight(param: torch.Tensor | None) torch.Tensor | None#
Gather only the GTP axis, leaving TP/EP/PP handling to the mapping.