Skip to content

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 forward, if it makes exactly one.

AttentionFuser dataclass

Bases: BaseFuser

A module that dispatches through the Transformers attention interface.

Methods:

  • layer_index –

    The layer module computes attention for, if it declares one.

  • scale –

    The softmax scale module passes to the interface, or None.

  • sinks –

    The per-head sink tensor module passes to the interface, or None.

  • validate –

    Whether module will actually dispatch to vLLM.

Attributes:

  • s_aux_expr (expr | None) –

    Source of the s_aux= the module hands the interface, if it hands one.

  • 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).

s_aux_expr = None class-attribute instance-attribute

Source of the s_aux= the module hands the interface, if it hands one.

scale_expr = None class-attribute 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.

scale(module)

The softmax scale module passes to the interface, or None.

sinks(module)

The per-head sink tensor module passes to the interface, or None.

validate(module, vllm_config)

Whether module will actually dispatch to vLLM.

_is_interface_lookup(node)

Whether node reads an entry out of ALL_ATTENTION_FUNCTIONS.

_resolve(node, module)

The value of node on module, for literals and self.<attr>.

interface_call(forward) cached

The attention interface call in forward, if it makes exactly one.