config#

Saved execution policy for GDN training-time numerical emulation.

Classes

LinearAttentionConfig

GDN/KDA chunk-64 policy; unsupported numerical modes fail config validation.

LinearAttentionDecodeConfig

Explicit suffix recurrence; workload supplies per-sequence prefix lengths.

LinearAttentionMatmulConfig

Round an accumulator after each left-to-right reduction block.

LinearAttentionPolicyEntry

Assign a complete policy to supported modules matching module_name.

LinearAttentionReplayConfig

Anchor refresh and encoded rank-one update policy.

LinearAttentionSolveConfig

Exact solve; inverse approximation is a later delivery.

class LinearAttentionConfig#

Bases: ModeloptBaseConfig

GDN/KDA chunk-64 policy; unsupported numerical modes fail config validation.

state.block_v defines one dynamic scale per [Dk, block_v] tile of each sequence/head. The initial state and every chunk’s final state are rounded when the module’s state quantizer is enabled. Outputs use the incoming rounded state. Decode’s int8_hadamard32 codec instead fixes scales to one key channel and 32 values; state.block_v remains the execution tile width.

backend: Literal['fla', 'matmul']#
chunk_size: Literal[64]#
decode: LinearAttentionDecodeConfig | None#
elementwise: dict[Literal['gate_prefix', 'gate_exp', 'value_residual', 'state_decay', 'state_add', 'output_add'], Literal['float32', 'float16', 'bfloat16']]#
matmul: dict[Literal['key_interaction', 'wy_value', 'wy_key', 'state_read', 'state_update', 'output_state', 'output_score', 'output_value'], LinearAttentionMatmulConfig]#
model_config = {'extra': 'forbid', 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

schema_version: Literal[1]#
solve: LinearAttentionSolveConfig#
state: _StateConfig#
class LinearAttentionDecodeConfig#

Bases: ModeloptBaseConfig

Explicit suffix recurrence; workload supplies per-sequence prefix lengths.

decay_log_step: float | None#
implementation: Literal['torch', 'triton']#
mode: Literal['token', 'replay']#
model_config = {'extra': 'forbid', 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

prefill_state_qdq: bool#
quantize_initial: bool#
readout: Literal['working', 'stored']#
replay: LinearAttentionReplayConfig | None#
state_codec: Literal['tile', 'int8_hadamard32']#
class LinearAttentionMatmulConfig#

Bases: ModeloptBaseConfig

Round an accumulator after each left-to-right reduction block.

Partial products use the baseline working dtype. This specifies an emulation schedule, not the internal accumulation order of a hardware MMA instruction.

accumulator_dtype: Literal['float32', 'float16', 'bfloat16'] | None#
model_config = {'extra': 'forbid', 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

reduction_block: int | None#
class LinearAttentionPolicyEntry#

Bases: ModeloptBaseConfig

Assign a complete policy to supported modules matching module_name.

Rules apply in order: the last match wins, without merging nested fields. A rule must match at least one supported linear-attention module.

cfg: LinearAttentionConfig#
model_config = {'extra': 'forbid', 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

module_name: str#
class LinearAttentionReplayConfig#

Bases: ModeloptBaseConfig

Anchor refresh and encoded rank-one update policy.

encoding: Literal['once', 'reencode']#
factor_qdq: bool#
model_config = {'extra': 'forbid', 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

window: int#
class LinearAttentionSolveConfig#

Bases: ModeloptBaseConfig

Exact solve; inverse approximation is a later delivery.

method: Literal['exact']#
model_config = {'extra': 'forbid', 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].