config#
Saved execution policy for GDN training-time numerical emulation.
Classes
GDN/KDA chunk-64 policy; unsupported numerical modes fail config validation. |
|
Explicit suffix recurrence; workload supplies per-sequence prefix lengths. |
|
Round an accumulator after each left-to-right reduction block. |
|
Assign a complete policy to supported modules matching |
|
Anchor refresh and encoded rank-one update policy. |
|
Exact solve; inverse approximation is a later delivery. |
- class LinearAttentionConfig#
Bases:
ModeloptBaseConfigGDN/KDA chunk-64 policy; unsupported numerical modes fail config validation.
state.block_vdefines 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’sint8_hadamard32codec instead fixes scales to one key channel and 32 values;state.block_vremains 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:
ModeloptBaseConfigExplicit 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:
ModeloptBaseConfigRound 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:
ModeloptBaseConfigAssign 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.
- 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:
ModeloptBaseConfigAnchor 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:
ModeloptBaseConfigExact 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].