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
ce143353
Unverified
Commit
ce143353
authored
Aug 17, 2024
by
Woosuk Kwon
Committed by
GitHub
Aug 17, 2024
Browse files
[TPU] Skip creating empty tensor (#7630)
parent
bbf55c48
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
vllm/worker/tpu_worker.py
vllm/worker/tpu_worker.py
+4
-1
No files found.
vllm/worker/tpu_worker.py
View file @
ce143353
...
...
@@ -271,7 +271,10 @@ def _make_src_to_dst(
mapping
:
List
[
Tuple
[
int
,
int
]],
src_device
:
Union
[
torch
.
device
,
str
],
dst_device
:
Union
[
torch
.
device
,
str
],
)
->
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
]:
)
->
Optional
[
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
]]:
if
not
mapping
:
return
None
src_indices
=
[
i
for
i
,
_
in
mapping
]
dst_indices
=
[
i
for
_
,
i
in
mapping
]
src_indices
=
torch
.
tensor
(
src_indices
,
...
...
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