Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
5265631d
Unverified
Commit
5265631d
authored
Jan 26, 2024
by
Vladimir
Committed by
GitHub
Jan 25, 2024
Browse files
use a correct device when creating OptionalCUDAGuard (#2583)
parent
2832e7b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
csrc/cache_kernels.cu
csrc/cache_kernels.cu
+1
-1
No files found.
csrc/cache_kernels.cu
View file @
5265631d
...
...
@@ -34,7 +34,7 @@ void swap_blocks(
char
*
dst_ptr
=
static_cast
<
char
*>
(
dst
.
data_ptr
());
const
int64_t
block_size_in_bytes
=
src
.
element_size
()
*
src
[
0
].
numel
();
const
at
::
cuda
::
OptionalCUDAGuard
device_guard
(
src_device
);
const
at
::
cuda
::
OptionalCUDAGuard
device_guard
(
src_device
.
is_cuda
()
?
src_device
:
dst_device
);
const
cudaStream_t
stream
=
at
::
cuda
::
getCurrentCUDAStream
();
// NOTE(woosuk): This can be slow if the number of blocks is large.
for
(
const
auto
&
pair
:
block_mapping
)
{
...
...
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