Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
ba1fcd84
Unverified
Commit
ba1fcd84
authored
Nov 26, 2025
by
Johnny Yang
Committed by
GitHub
Nov 26, 2025
Browse files
[TPU] add tpu_inference (#27277)
Signed-off-by:
Johnny Yang
<
johnnyyang@google.com
>
parent
56539cdd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
13 deletions
+5
-13
requirements/tpu.txt
requirements/tpu.txt
+1
-3
vllm/distributed/device_communicators/tpu_communicator.py
vllm/distributed/device_communicators/tpu_communicator.py
+0
-8
vllm/platforms/tpu.py
vllm/platforms/tpu.py
+3
-1
vllm/v1/worker/tpu_worker.py
vllm/v1/worker/tpu_worker.py
+1
-1
No files found.
requirements/tpu.txt
View file @
ba1fcd84
...
@@ -12,6 +12,4 @@ ray[data]
...
@@ -12,6 +12,4 @@ ray[data]
setuptools==78.1.0
setuptools==78.1.0
nixl==0.3.0
nixl==0.3.0
tpu_info==0.4.0
tpu_info==0.4.0
tpu-inference==0.11.1
# Install torch_xla
torch_xla[tpu, pallas]==2.8.0
\ No newline at end of file
vllm/distributed/device_communicators/tpu_communicator.py
View file @
ba1fcd84
...
@@ -97,11 +97,3 @@ class TpuCommunicator(DeviceCommunicatorBase):
...
@@ -97,11 +97,3 @@ class TpuCommunicator(DeviceCommunicatorBase):
def
all_gather
(
self
,
input_
:
torch
.
Tensor
,
dim
:
int
=
-
1
)
->
torch
.
Tensor
:
def
all_gather
(
self
,
input_
:
torch
.
Tensor
,
dim
:
int
=
-
1
)
->
torch
.
Tensor
:
assert
dim
==
-
1
,
"TPUs only support dim=-1 for all-gather."
assert
dim
==
-
1
,
"TPUs only support dim=-1 for all-gather."
return
xm
.
all_gather
(
input_
,
dim
=
dim
)
return
xm
.
all_gather
(
input_
,
dim
=
dim
)
if
USE_TPU_INFERENCE
:
from
tpu_inference.distributed.device_communicators
import
(
TpuCommunicator
as
TpuInferenceCommunicator
,
)
TpuCommunicator
=
TpuInferenceCommunicator
# type: ignore
vllm/platforms/tpu.py
View file @
ba1fcd84
...
@@ -267,7 +267,9 @@ class TpuPlatform(Platform):
...
@@ -267,7 +267,9 @@ class TpuPlatform(Platform):
try
:
try
:
from
tpu_inference.platforms
import
TpuPlatform
as
TpuInferencePlatform
from
tpu_inference.platforms.tpu_platforms
import
(
TpuPlatform
as
TpuInferencePlatform
,
)
TpuPlatform
=
TpuInferencePlatform
# type: ignore
TpuPlatform
=
TpuInferencePlatform
# type: ignore
USE_TPU_INFERENCE
=
True
USE_TPU_INFERENCE
=
True
...
...
vllm/v1/worker/tpu_worker.py
View file @
ba1fcd84
...
@@ -346,6 +346,6 @@ class TPUWorker:
...
@@ -346,6 +346,6 @@ class TPUWorker:
if
USE_TPU_INFERENCE
:
if
USE_TPU_INFERENCE
:
from
tpu_inference.worker
import
TPUWorker
as
TpuInferenceWorker
from
tpu_inference.worker
.tpu_worker
import
TPUWorker
as
TpuInferenceWorker
TPUWorker
=
TpuInferenceWorker
# type: ignore
TPUWorker
=
TpuInferenceWorker
# type: ignore
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment