vllm.model_executor.models.transformers.fusers.attention ¶
Attention fuser: the module that dispatches to the attention interface.
Classes:
-
AttentionFuser–A module that dispatches through the Transformers attention interface.
Functions:
-
interface_call–The attention interface call in
cls.forward, if it makes exactly one.
AttentionFuser dataclass ¶
Bases: BaseFuser
A module that dispatches through the Transformers attention interface.
Methods:
-
layer_index–The layer
modulecomputes attention for, if it declares one. -
scale–The softmax scale
modulepasses to the interface, orNone. -
validate–Whether
modulewill actually dispatch to vLLM.
Attributes:
-
scale_expr(expr | None) –Source of the
scaling=the module hands the interface, if it hands one. -
source_cls(str) –Class of the HF module that dispatches (for logging).
Source code in vllm/model_executor/models/transformers/fusers/attention.py
scale_expr instance-attribute ¶
Source of the scaling= the module hands the interface, if it hands one.
source_cls instance-attribute ¶
Class of the HF module that dispatches (for logging).
layer_index(module) ¶
The layer module computes attention for, if it declares one.
Source code in vllm/model_executor/models/transformers/fusers/attention.py
scale(module) ¶
The softmax scale module passes to the interface, or None.
Source code in vllm/model_executor/models/transformers/fusers/attention.py
validate(module, vllm_config) ¶
Whether module will actually dispatch to vLLM.
Source code in vllm/model_executor/models/transformers/fusers/attention.py
_is_interface_lookup(node) ¶
Whether node reads an entry out of ALL_ATTENTION_FUNCTIONS.
Source code in vllm/model_executor/models/transformers/fusers/attention.py
_resolve(node, module) ¶
The value of node on module, for literals and self.<attr>.
Source code in vllm/model_executor/models/transformers/fusers/attention.py
interface_call(cls) cached ¶
The attention interface call in cls.forward, if it makes exactly one.