conversion

Convert/restore/update entrypoints for TriAttention mode.

TriAttention is a calibration-only mode. Convert is a no-op on model weights. Calibration data is stored in metadata and fused into the checkpoint at save time.

Functions

convert_triattention

Apply TriAttention mode to model.

restore_triattention

Restore TriAttention mode from saved state.

update_triattention_metadata

Update metadata before saving.

convert_triattention(model, config)

Apply TriAttention mode to model.

This is a no-op on model weights. It stores the configuration in metadata so that calibration can be run subsequently.

Parameters:
Return type:

ConvertReturnType

restore_triattention(model, config, metadata)

Restore TriAttention mode from saved state.

Loads calibration data from metadata if present.

Parameters:
Return type:

nn.Module

update_triattention_metadata(model, config, metadata)

Update metadata before saving.

Ensures calibration data and config are current in metadata.

Parameters:
Return type:

None