From 93bf5816e5d6b497a862f4e82481faf664633f69 Mon Sep 17 00:00:00 2001 From: Wallas Santos Date: Mon, 5 May 2025 14:10:00 -0300 Subject: [PATCH 1/4] fix: local development for vllm==0.8.5 Signed-off-by: Wallas Santos --- vllm_spyre/platform.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vllm_spyre/platform.py b/vllm_spyre/platform.py index 9ea819ac7..4659de962 100644 --- a/vllm_spyre/platform.py +++ b/vllm_spyre/platform.py @@ -1,3 +1,13 @@ +import sys + +# If we are running this plugin in mac, so we assume it's for local development +# Therefore, there's a problem in vLLM that overrides triton module with a +# placeholder, and it may mess up things at pytorch (2.5.1). So, in this +# platform we will mostly using eager. So, we can disable triton and things +# can still work. +if sys.platform.startswith("darwin"): + del sys.modules['triton'] + import operator from typing import TYPE_CHECKING, Optional, Union From bc5d8c9b576d968991c762789934172ab5408a9d Mon Sep 17 00:00:00 2001 From: Wallas Santos Date: Mon, 5 May 2025 15:24:16 -0300 Subject: [PATCH 2/4] fix: conditional delete of sys.module['triton'] Signed-off-by: Wallas Santos --- vllm_spyre/platform.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vllm_spyre/platform.py b/vllm_spyre/platform.py index 4659de962..efaaf3507 100644 --- a/vllm_spyre/platform.py +++ b/vllm_spyre/platform.py @@ -6,7 +6,8 @@ # platform we will mostly using eager. So, we can disable triton and things # can still work. if sys.platform.startswith("darwin"): - del sys.modules['triton'] + if sys.modules.get('triton'): + del sys.modules['triton'] import operator from typing import TYPE_CHECKING, Optional, Union From c7e331773b2d3fee2729e3f43cc5b48c153bc75f Mon Sep 17 00:00:00 2001 From: Wallas Santos Date: Tue, 6 May 2025 13:17:04 -0300 Subject: [PATCH 3/4] docs: updated comment for the issue of incompatibility of mac os and triton Signed-off-by: Wallas Santos --- vllm_spyre/platform.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vllm_spyre/platform.py b/vllm_spyre/platform.py index e25ee9578..6b8708d6b 100644 --- a/vllm_spyre/platform.py +++ b/vllm_spyre/platform.py @@ -1,10 +1,11 @@ import sys -# If we are running this plugin in mac, so we assume it's for local development -# Therefore, there's a problem in vLLM that overrides triton module with a -# placeholder, and it may mess up things at pytorch (2.5.1). So, in this -# platform we will mostly using eager. So, we can disable triton and things -# can still work. +# When running this plugin on a Mac, we assume it's for local development +# purposes. However, due to a compatibility issue with vLLM, which overrides +# the Triton module with a placeholder, vLLM may fail to load on macOS. To +# mitigate this issue, we can safely remove the Triton module (if imported) +# and rely on PyTorch to handle the absence of Triton, ensuring fine execution +# in eager mode. if sys.platform.startswith("darwin"): if sys.modules.get('triton'): del sys.modules['triton'] From ffade8c0067637e5dbf813aee9f6bf07698183f0 Mon Sep 17 00:00:00 2001 From: Wallas Santos Date: Tue, 6 May 2025 13:21:46 -0300 Subject: [PATCH 4/4] fix: linting Signed-off-by: Wallas Santos --- vllm_spyre/platform.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vllm_spyre/platform.py b/vllm_spyre/platform.py index 6b8708d6b..655cd3889 100644 --- a/vllm_spyre/platform.py +++ b/vllm_spyre/platform.py @@ -1,9 +1,9 @@ import sys -# When running this plugin on a Mac, we assume it's for local development -# purposes. However, due to a compatibility issue with vLLM, which overrides -# the Triton module with a placeholder, vLLM may fail to load on macOS. To -# mitigate this issue, we can safely remove the Triton module (if imported) +# When running this plugin on a Mac, we assume it's for local development +# purposes. However, due to a compatibility issue with vLLM, which overrides +# the Triton module with a placeholder, vLLM may fail to load on macOS. To +# mitigate this issue, we can safely remove the Triton module (if imported) # and rely on PyTorch to handle the absence of Triton, ensuring fine execution # in eager mode. if sys.platform.startswith("darwin"):