vllm_mlx.vllm_platform¶
MLX Platform implementation for vLLM.
View the complete module source at #L1-L351.
API details¶
Each callable below includes its exact signature, type annotations, inputs, defaults, return contract, documented exceptions, implementation source, and parsed docstring sections when the source provides them.
vllm_mlx.vllm_platform
¶
MLX Platform implementation for vLLM.
This module provides the MLXPlatform class that integrates Apple's MLX framework with vLLM's platform system, enabling native Apple Silicon GPU acceleration.
vllm_mlx.vllm_platform.MLXPlatform
¶
Platform implementation for Apple Silicon using MLX.
This platform uses Apple's MLX framework for GPU-accelerated inference on Apple Silicon Macs. It integrates with mlx-lm for LLM inference and mlx-vlm for vision-language models.
Key features: - Unified memory model (no CPU<->GPU transfers) - Native Metal GPU acceleration - Optimized kernels for Apple Silicon - Support for quantized models (4-bit, 8-bit)
vllm_mlx.vllm_platform.MLXPlatform.device_name
class-attribute
instance-attribute
¶
vllm_mlx.vllm_platform.MLXPlatform.device_type
class-attribute
instance-attribute
¶
vllm_mlx.vllm_platform.MLXPlatform.dispatch_key
class-attribute
instance-attribute
¶
vllm_mlx.vllm_platform.MLXPlatform.ray_device_key
class-attribute
instance-attribute
¶
vllm_mlx.vllm_platform.MLXPlatform.device_control_env_var
class-attribute
instance-attribute
¶
vllm_mlx.vllm_platform.MLXPlatform.simple_compile_backend
class-attribute
instance-attribute
¶
vllm_mlx.vllm_platform.MLXPlatform.dist_backend
class-attribute
instance-attribute
¶
vllm_mlx.vllm_platform.MLXPlatform.supported_quantization
class-attribute
instance-attribute
¶
vllm_mlx.vllm_platform.MLXPlatform.additional_env_vars
class-attribute
instance-attribute
¶
vllm_mlx.vllm_platform.MLXPlatform._global_graph_pool
class-attribute
instance-attribute
¶
vllm_mlx.vllm_platform.MLXPlatform.supported_dtypes
property
¶
Return supported dtypes for MLX.
vllm_mlx.vllm_platform.MLXPlatform.is_cuda
¶
vllm_mlx.vllm_platform.MLXPlatform.is_rocm
¶
vllm_mlx.vllm_platform.MLXPlatform.is_tpu
¶
vllm_mlx.vllm_platform.MLXPlatform.is_xpu
¶
vllm_mlx.vllm_platform.MLXPlatform.is_cpu
¶
vllm_mlx.vllm_platform.MLXPlatform.is_mlx
¶
vllm_mlx.vllm_platform.MLXPlatform.is_out_of_tree
¶
vllm_mlx.vllm_platform.MLXPlatform.is_cuda_alike
¶
vllm_mlx.vllm_platform.MLXPlatform.is_sleep_mode_available
¶
vllm_mlx.vllm_platform.MLXPlatform.get_device_name
classmethod
¶
vllm_mlx.vllm_platform.MLXPlatform.get_device_uuid
classmethod
¶
vllm_mlx.vllm_platform.MLXPlatform.get_device_total_memory
classmethod
¶
vllm_mlx.vllm_platform.MLXPlatform.inference_mode
classmethod
¶
vllm_mlx.vllm_platform.MLXPlatform.set_device
classmethod
¶
vllm_mlx.vllm_platform.MLXPlatform.seed_everything
classmethod
¶
Set random seeds for reproducibility.
Source code in vllm_mlx/vllm_platform.py
vllm_mlx.vllm_platform.MLXPlatform.import_kernels
classmethod
¶
vllm_mlx.vllm_platform.MLXPlatform.get_attn_backend_cls
classmethod
¶
get_attn_backend_cls(selected_backend, head_size: int, dtype: dtype, kv_cache_dtype, block_size: int, use_mla: bool, has_sink: bool, use_sparse: bool, attn_type: str | None = None) -> str
Return MLX attention backend class path.
Source code in vllm_mlx/vllm_platform.py
vllm_mlx.vllm_platform.MLXPlatform.check_and_update_config
classmethod
¶
Check and update vLLM configuration for MLX.
Source code in vllm_mlx/vllm_platform.py
vllm_mlx.vllm_platform.MLXPlatform.verify_model_arch
classmethod
¶
Verify model architecture is supported on MLX.
Source code in vllm_mlx/vllm_platform.py
vllm_mlx.vllm_platform.MLXPlatform.verify_quantization
classmethod
¶
Verify quantization method is supported.
Source code in vllm_mlx/vllm_platform.py
vllm_mlx.vllm_platform.MLXPlatform.is_pin_memory_available
classmethod
¶
vllm_mlx.vllm_platform.MLXPlatform.get_current_memory_usage
classmethod
¶
Get current memory usage in bytes.
Source code in vllm_mlx/vllm_platform.py
vllm_mlx.vllm_platform.MLXPlatform.supports_fp8
classmethod
¶
vllm_mlx.vllm_platform.MLXPlatform.use_custom_allreduce
classmethod
¶
vllm_mlx.vllm_platform.MLXPlatform.support_static_graph_mode
classmethod
¶
vllm_mlx.vllm_platform.MLXPlatform.get_device_communicator_cls
classmethod
¶
vllm_mlx.vllm_platform.MLXPlatform.get_punica_wrapper
classmethod
¶
vllm_mlx.vllm_platform._get_apple_chip_name
¶
Get the name of the Apple Silicon chip.
Source code in vllm_mlx/vllm_platform.py
vllm_mlx.vllm_platform._get_unified_memory_size
¶
Get the total unified memory size in bytes.
Source code in vllm_mlx/vllm_platform.py
vllm_mlx.vllm_platform._is_mlx_available
¶
Check if MLX is available and working.
Source code in vllm_mlx/vllm_platform.py
Complete contract reference¶
Expand any definition for its exact inputs, annotations, defaults, return contract, directly raised exceptions, source-grounded behavior, and immutable line link. This section includes private and nested definitions that ordinary API generators omit.
vllm_mlx.vllm_platform._get_apple_chip_name · function
Get the name of the Apple Silicon chip.
Parameters
This callable has no explicit inputs.
Returns
- Type:
str - Direct return expressions:
result.stdout.strip();'Apple Silicon'
Exceptions and behavior
Function _get_apple_chip_name calls subprocess.run, result.stdout.strip; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform._get_unified_memory_size · function
Get the total unified memory size in bytes.
Parameters
This callable has no explicit inputs.
Returns
- Type:
int - Direct return expressions:
int(result.stdout.strip());8 * 1024 * 1024 * 1024
Exceptions and behavior
Function _get_unified_memory_size calls subprocess.run, int, result.stdout.strip; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform._is_mlx_available · function
Check if MLX is available and working.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
True;False
Exceptions and behavior
Function _is_mlx_available calls mx.array, logger.debug; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform._is_apple_silicon · function
Check if running on Apple Silicon.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
sys.platform == 'darwin' and platform.machine() == 'arm64'
Exceptions and behavior
Function _is_apple_silicon calls platform.machine; returns sys.platform == 'darwin' and platform.machine() == 'arm64'.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform · class
Platform implementation for Apple Silicon using MLX.
Parameters
This callable has no explicit inputs.
Returns
- Constructs:
vllm_mlx.vllm_platform.MLXPlatform
Exceptions and behavior
Class MLXPlatform declares 30 direct member(s).
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform._enum · method
Method MLXPlatform._enum returns PlatformEnum.OOT.
Parameters
This callable has no explicit inputs.
Returns
- Type:
not annotated - Direct return expressions:
PlatformEnum.OOT
Exceptions and behavior
Method MLXPlatform._enum returns PlatformEnum.OOT.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.supported_dtypes · method
Return supported dtypes for MLX.
Parameters
This callable has no explicit inputs.
Returns
- Type:
list[torch.dtype] - Direct return expressions:
[torch.bfloat16, torch.float16, torch.float32];[torch.float16, torch.float32]
Exceptions and behavior
Method MLXPlatform.supported_dtypes calls mx.array; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.is_cuda · method
Return False because this platform does not use CUDA.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
False
Exceptions and behavior
Method MLXPlatform.is_cuda returns False.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.is_rocm · method
Return False because this platform does not use ROCm.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
False
Exceptions and behavior
Method MLXPlatform.is_rocm returns False.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.is_tpu · method
Return False because this platform is not a TPU backend.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
False
Exceptions and behavior
Method MLXPlatform.is_tpu returns False.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.is_xpu · method
Return False because this platform does not use Intel XPU.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
False
Exceptions and behavior
Method MLXPlatform.is_xpu returns False.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.is_cpu · method
Return False because MLX targets Apple GPU acceleration here.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
False
Exceptions and behavior
Method MLXPlatform.is_cpu returns False.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.is_mlx · method
Return True to identify the MLX platform plugin.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
True
Exceptions and behavior
Method MLXPlatform.is_mlx returns True.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.is_out_of_tree · method
Return True because MLX is registered as a vLLM plugin.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
True
Exceptions and behavior
Method MLXPlatform.is_out_of_tree returns True.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.is_cuda_alike · method
Return False because MLX does not implement CUDA semantics.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
False
Exceptions and behavior
Method MLXPlatform.is_cuda_alike returns False.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.is_sleep_mode_available · method
Return False because vLLM sleep mode is unavailable on MLX.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
False
Exceptions and behavior
Method MLXPlatform.is_sleep_mode_available returns False.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.get_device_name · method
Get the Apple Silicon chip name.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
device_id |
int |
no |
0 |
Optional positional or keyword input; defaults to 0. |
Returns
- Type:
str - Direct return expressions:
_get_apple_chip_name()
Exceptions and behavior
Method MLXPlatform.get_device_name calls _get_apple_chip_name; returns _get_apple_chip_name().
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.get_device_uuid · method
Get device UUID (not applicable for MLX).
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
device_id |
int |
no |
0 |
Optional positional or keyword input; defaults to 0. |
Returns
- Type:
str - Direct return expressions:
'mlx-0'
Exceptions and behavior
Method MLXPlatform.get_device_uuid returns 'mlx-0'.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.get_device_total_memory · method
Get total unified memory in bytes.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
device_id |
int |
no |
0 |
Optional positional or keyword input; defaults to 0. |
Returns
- Type:
int - Direct return expressions:
_get_unified_memory_size()
Exceptions and behavior
Method MLXPlatform.get_device_total_memory calls _get_unified_memory_size; returns _get_unified_memory_size().
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.inference_mode · method
Return inference mode context manager.
Parameters
This callable has no explicit inputs.
Returns
- Type:
not annotated - Direct return expressions:
torch.no_grad()
Exceptions and behavior
Method MLXPlatform.inference_mode calls torch.no_grad; returns torch.no_grad().
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.set_device · method
Set the device (no-op for MLX, uses default device).
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
device |
torch.device |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
None
Exceptions and behavior
Method MLXPlatform.set_device contains no state mutation, call, raise, return, await, or yield.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.seed_everything · method
Set random seeds for reproducibility.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
seed |
int \| None |
no |
None |
Optional positional or keyword input; defaults to None. |
Returns
- Type:
None
Exceptions and behavior
Method MLXPlatform.seed_everything calls random.seed, np.random.seed, torch.manual_seed, mx.random.seed.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.import_kernels · method
Import MLX kernels (no custom C kernels).
Parameters
This callable has no explicit inputs.
Returns
- Type:
None
Exceptions and behavior
Method MLXPlatform.import_kernels contains no state mutation, call, raise, return, await, or yield.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.get_attn_backend_cls · method
vllm_mlx.vllm_platform.MLXPlatform.get_attn_backend_cls(selected_backend, head_size: int, dtype: torch.dtype, kv_cache_dtype, block_size: int, use_mla: bool, has_sink: bool, use_sparse: bool, attn_type: str | None = None) -> str
Return MLX attention backend class path.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
selected_backend |
not annotated |
yes |
none |
Required positional or keyword input. |
head_size |
int |
yes |
none |
Required positional or keyword input. |
dtype |
torch.dtype |
yes |
none |
Required positional or keyword input. |
kv_cache_dtype |
not annotated |
yes |
none |
Required positional or keyword input. |
block_size |
int |
yes |
none |
Required positional or keyword input. |
use_mla |
bool |
yes |
none |
Required positional or keyword input. |
has_sink |
bool |
yes |
none |
Required positional or keyword input. |
use_sparse |
bool |
yes |
none |
Required positional or keyword input. |
attn_type |
str \| None |
no |
None |
Optional positional or keyword input; defaults to None. |
Returns
- Type:
str - Direct return expressions:
'vllm_mlx.attention.MLXAttentionBackend'
Exceptions and behavior
Method MLXPlatform.get_attn_backend_cls returns 'vllm_mlx.attention.MLXAttentionBackend'.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.check_and_update_config · method
Check and update vLLM configuration for MLX.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
vllm_config |
'VllmConfig' |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
None
Exceptions and behavior
Method MLXPlatform.check_and_update_config calls logger.info, _get_apple_chip_name, _get_unified_memory_size, hasattr.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.verify_model_arch · method
Verify model architecture is supported on MLX.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model_arch |
str |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
None
Exceptions and behavior
Method MLXPlatform.verify_model_arch calls hint.lower, model_arch.lower, logger.warning.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.verify_quantization · method
Verify quantization method is supported.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
quant |
str |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
None
Exceptions and behavior
Method MLXPlatform.verify_quantization calls ValueError; can raise ValueError.
Directly raised exceptions: ValueError.
vllm_mlx.vllm_platform.MLXPlatform.is_pin_memory_available · method
Pin memory not needed with unified memory.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
False
Exceptions and behavior
Method MLXPlatform.is_pin_memory_available returns False.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.get_current_memory_usage · method
Get current memory usage in bytes.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
device |
not annotated |
no |
None |
Optional positional or keyword input; defaults to None. |
Returns
- Type:
float - Direct return expressions:
float(process.memory_info().rss);0.0
Exceptions and behavior
Method MLXPlatform.get_current_memory_usage calls psutil.Process, float, process.memory_info; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.supports_fp8 · method
FP8 not supported on MLX.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
False
Exceptions and behavior
Method MLXPlatform.supports_fp8 returns False.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.use_custom_allreduce · method
Custom allreduce not available.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
False
Exceptions and behavior
Method MLXPlatform.use_custom_allreduce returns False.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.support_static_graph_mode · method
Static graph mode (CUDA graphs) not supported.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
False
Exceptions and behavior
Method MLXPlatform.support_static_graph_mode returns False.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.get_device_communicator_cls · method
Return the communicator class for distributed.
Parameters
This callable has no explicit inputs.
Returns
- Type:
str - Direct return expressions:
'vllm_mlx.distributed.MLXCommunicator'
Exceptions and behavior
Method MLXPlatform.get_device_communicator_cls returns 'vllm_mlx.distributed.MLXCommunicator'.
No direct raise statement appears in this definition.
vllm_mlx.vllm_platform.MLXPlatform.get_punica_wrapper · method
Return LoRA wrapper (not yet implemented for MLX).
Parameters
This callable has no explicit inputs.
Returns
- Type:
str
Exceptions and behavior
Method MLXPlatform.get_punica_wrapper calls NotImplementedError; can raise NotImplementedError.
Directly raised exceptions: NotImplementedError.
vllm_mlx.vllm_platform.MLXPlatform.__repr__ · method
Method MLXPlatform.__repr__ returns f'<MLXPlatform device={self.device_name}>'.
Parameters
This callable has no explicit inputs.
Returns
- Type:
str - Direct return expressions:
f'<MLXPlatform device={self.device_name}>'
Exceptions and behavior
Method MLXPlatform.__repr__ returns f'<MLXPlatform device={self.device_name}>'.
No direct raise statement appears in this definition.
Complete symbol map¶
This map also includes private definitions and nested helpers. The signature column exposes every explicit input even when an internal helper has no dedicated parameter prose.
| Symbol | Kind | Signature and inputs | What it does | Source |
|---|---|---|---|---|
_get_apple_chip_name |
function | _get_apple_chip_name() -> str |
Get the name of the Apple Silicon chip. | #L24-L35 |
_get_unified_memory_size |
function | _get_unified_memory_size() -> int |
Get the total unified memory size in bytes. | #L38-L50 |
_is_mlx_available |
function | _is_mlx_available() -> bool |
Check if MLX is available and working. | #L53-L63 |
_is_apple_silicon |
function | _is_apple_silicon() -> bool |
Check if running on Apple Silicon. | #L66-L68 |
MLXPlatform |
class | MLXPlatform() |
Platform implementation for Apple Silicon using MLX. | #L71-L351 |
MLXPlatform._enum |
method | MLXPlatform._enum() -> not annotated |
Method MLXPlatform._enum returns PlatformEnum.OOT. |
#L90-L93 |
MLXPlatform.supported_dtypes |
method | MLXPlatform.supported_dtypes() -> list[torch.dtype] |
Return supported dtypes for MLX. | #L122-L133 |
MLXPlatform.is_cuda |
method | MLXPlatform.is_cuda() -> bool |
Return False because this platform does not use CUDA. |
#L135-L138 |
MLXPlatform.is_rocm |
method | MLXPlatform.is_rocm() -> bool |
Return False because this platform does not use ROCm. |
#L140-L143 |
MLXPlatform.is_tpu |
method | MLXPlatform.is_tpu() -> bool |
Return False because this platform is not a TPU backend. |
#L145-L148 |
MLXPlatform.is_xpu |
method | MLXPlatform.is_xpu() -> bool |
Return False because this platform does not use Intel XPU. |
#L150-L153 |
MLXPlatform.is_cpu |
method | MLXPlatform.is_cpu() -> bool |
Return False because MLX targets Apple GPU acceleration here. |
#L155-L158 |
MLXPlatform.is_mlx |
method | MLXPlatform.is_mlx() -> bool |
Return True to identify the MLX platform plugin. |
#L160-L163 |
MLXPlatform.is_out_of_tree |
method | MLXPlatform.is_out_of_tree() -> bool |
Return True because MLX is registered as a vLLM plugin. |
#L165-L168 |
MLXPlatform.is_cuda_alike |
method | MLXPlatform.is_cuda_alike() -> bool |
Return False because MLX does not implement CUDA semantics. |
#L170-L173 |
MLXPlatform.is_sleep_mode_available |
method | MLXPlatform.is_sleep_mode_available() -> bool |
Return False because vLLM sleep mode is unavailable on MLX. |
#L175-L178 |
MLXPlatform.get_device_name |
method | MLXPlatform.get_device_name(device_id: int = 0) -> str |
Get the Apple Silicon chip name. | #L181-L183 |
MLXPlatform.get_device_uuid |
method | MLXPlatform.get_device_uuid(device_id: int = 0) -> str |
Get device UUID (not applicable for MLX). | #L186-L188 |
MLXPlatform.get_device_total_memory |
method | MLXPlatform.get_device_total_memory(device_id: int = 0) -> int |
Get total unified memory in bytes. | #L191-L193 |
MLXPlatform.inference_mode |
method | MLXPlatform.inference_mode() -> not annotated |
Return inference mode context manager. | #L196-L200 |
MLXPlatform.set_device |
method | MLXPlatform.set_device(device: torch.device) -> None |
Set the device (no-op for MLX, uses default device). | #L203-L206 |
MLXPlatform.seed_everything |
method | MLXPlatform.seed_everything(seed: int \| None = None) -> None |
Set random seeds for reproducibility. | #L209-L225 |
MLXPlatform.import_kernels |
method | MLXPlatform.import_kernels() -> None |
Import MLX kernels (no custom C kernels). | #L228-L231 |
MLXPlatform.get_attn_backend_cls |
method | MLXPlatform.get_attn_backend_cls(selected_backend, head_size: int, dtype: torch.dtype, kv_cache_dtype, block_size: int, use_mla: bool, has_sink: bool, use_sparse: bool, attn_type: str \| None = None) -> str |
Return MLX attention backend class path. | #L234-L248 |
MLXPlatform.check_and_update_config |
method | MLXPlatform.check_and_update_config(vllm_config: 'VllmConfig') -> None |
Check and update vLLM configuration for MLX. | #L251-L280 |
MLXPlatform.verify_model_arch |
method | MLXPlatform.verify_model_arch(model_arch: str) -> None |
Verify model architecture is supported on MLX. | #L283-L294 |
MLXPlatform.verify_quantization |
method | MLXPlatform.verify_quantization(quant: str) -> None |
Verify quantization method is supported. | #L297-L304 |
MLXPlatform.is_pin_memory_available |
method | MLXPlatform.is_pin_memory_available() -> bool |
Pin memory not needed with unified memory. | #L307-L309 |
MLXPlatform.get_current_memory_usage |
method | MLXPlatform.get_current_memory_usage(device = None) -> float |
Get current memory usage in bytes. | #L312-L323 |
MLXPlatform.supports_fp8 |
method | MLXPlatform.supports_fp8() -> bool |
FP8 not supported on MLX. | #L326-L328 |
MLXPlatform.use_custom_allreduce |
method | MLXPlatform.use_custom_allreduce() -> bool |
Custom allreduce not available. | #L331-L333 |
MLXPlatform.support_static_graph_mode |
method | MLXPlatform.support_static_graph_mode() -> bool |
Static graph mode (CUDA graphs) not supported. | #L336-L338 |
MLXPlatform.get_device_communicator_cls |
method | MLXPlatform.get_device_communicator_cls() -> str |
Return the communicator class for distributed. | #L341-L343 |
MLXPlatform.get_punica_wrapper |
method | MLXPlatform.get_punica_wrapper() -> str |
Return LoRA wrapper (not yet implemented for MLX). | #L346-L348 |
MLXPlatform.__repr__ |
method | MLXPlatform.__repr__() -> str |
Method MLXPlatform.__repr__ returns f'<MLXPlatform device={self.device_name}>'. |
#L350-L351 |