Configuration for attention mechanisms in vLLM.
Summary
Functions
Set field from env var if set, with deprecation warning.
Provide a hash that uniquely identifies all the configs
Constructs AttentionConfig.
Enable parsing of the backend enum type from string.
Types
Functions
@spec _set_from_env_if_set(SnakeBridge.Ref.t(), String.t(), String.t(), keyword()) :: {:ok, nil} | {:error, Snakepit.Error.t()}
Set field from env var if set, with deprecation warning.
Parameters
field_name(String.t())env_var_name(String.t())
Returns
nil
@spec backend(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec compute_hash( SnakeBridge.Ref.t(), keyword() ) :: {:ok, String.t()} | {:error, Snakepit.Error.t()}
Provide a hash that uniquely identifies all the configs
that affect the structure of the computation graph from input ids/embeddings to the final hidden states, excluding anything before input ids/embeddings and after the final hidden states.
Returns
String.t()
@spec disable_flashinfer_prefill(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec disable_flashinfer_q_quantization(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec flash_attn_max_num_splits_for_cuda_graph(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec flash_attn_version(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec new(term(), term(), term(), keyword()) :: {:ok, SnakeBridge.Ref.t()} | {:error, Snakepit.Error.t()}
Constructs AttentionConfig.
Parameters
dataclass_self__(term())args(term())kwargs(term())
@spec use_cudnn_prefill(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec use_prefill_decode_attention(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec use_trtllm_attention(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec use_trtllm_ragged_deepseek_prefill(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec validate_backend_before(SnakeBridge.Ref.t(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Enable parsing of the backend enum type from string.
Parameters
value(term())
Returns
term()