Skip to content

vllm.model_executor.models.transformers

Wrapper around transformers models.

Modules:

  • base –

    Transformers modeling backend base class.

  • causal –

    Transformers modeling backend mixin for causal language models.

  • fuser –

    Fuser detection for the Transformers modeling backend.

  • fusers –

    Concrete fusers for the Transformers modeling backend.

  • fx_utils –

    fx tracing and forward-source rewriting for the Transformers backend fusers.

  • layers –

    Layer resolution for the Transformers modeling backend.

  • legacy –

    Transformers modeling backend mixin for legacy models.

  • moe –

    Transformers modeling backend mixin for Mixture of Experts (MoE) models.

  • mtp –

    Transformers modeling backend mixin for multi-token prediction draft models.

  • multimodal –

    Transformers modeling backend mixin for multi-modal models.

  • pooling –

    Transformers modeling backend mixins for pooling models.

  • transcription –

    Transformers modeling backend mixin for the transcription API.

  • utils –

    Transformers modeling backend utilities.

Functions:

  • __getattr__ –

    Handle imports of non-existent classes with a helpful error message.

  • check_sinks –

    Fail loudly if the model applies a sink the attention layer will not.

__getattr__(name)

Handle imports of non-existent classes with a helpful error message.

check_sinks(module, self_attn, s_aux)

Fail loudly if the model applies a sink the attention layer will not.

Only the attention impl can fold a sink into the softmax denominator, so a sink that never reached Attention is dropped and every softmax is subtly wrong.