vllm.v1.attention.backends.mla.prefill.selector
¶
Selector for MLA prefill backends.
This module provides functions for selecting the appropriate MLA prefill backend based on device capabilities and configuration.
Classes:
-
MLAPrefillSelectorConfig–Hashable configuration for MLA prefill backend selection.
Functions:
-
get_mla_prefill_backend–Select the MLA prefill backend based on configuration and device.
MLAPrefillSelectorConfig
¶
Bases: NamedTuple
Hashable configuration for MLA prefill backend selection.
This is analogous to AttentionSelectorConfig and contains model-specific configuration needed to select an MLA prefill backend, extracted from VllmConfig into a hashable form for caching.
Source code in vllm/v1/attention/backends/mla/prefill/selector.py
_auto_select_mla_prefill_backend(device_capability, selector_config)
cached
¶
Auto-select the best available MLA prefill backend.
Parameters:
-
(device_capability¶DeviceCapability) –The device's compute capability.
-
(selector_config¶MLAPrefillSelectorConfig) –Hashable configuration for backend selection.
Returns:
-
type[MLAPrefillBackend]–The selected prefill backend class.
Source code in vllm/v1/attention/backends/mla/prefill/selector.py
_get_mla_prefill_backend_priorities(device_capability, mla_dimensions)
¶
Get MLA prefill backend priorities based on device capability.
Parameters:
-
(device_capability¶DeviceCapability) –The device's compute capability.
-
(mla_dimensions¶MLADimensions) –The model's MLA head dimensions.
Returns:
-
list[MLAPrefillBackendEnum]–List of backends in priority order (highest priority first).
Source code in vllm/v1/attention/backends/mla/prefill/selector.py
get_mla_prefill_backend(vllm_config)
¶
Select the MLA prefill backend based on configuration and device.
This function first checks for explicit user preferences via mla_prefill_backend in AttentionConfig, then falls back to automatic priority-based selection.
Parameters:
-
(vllm_config¶VllmConfig) –The vLLM configuration.
Returns:
-
type[MLAPrefillBackend]–The selected prefill backend class.
Source code in vllm/v1/attention/backends/mla/prefill/selector.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |