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
dc0f7ccf
Unverified
Commit
dc0f7ccf
authored
Feb 16, 2025
by
wchen61
Committed by
GitHub
Feb 16, 2025
Browse files
[BugFix] Enhance test_pos_encoding to support execution on multi-devices (#13187)
Signed-off-by:
wchen61
<
wchen61@foxmail.com
>
parent
d3d547e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
tests/kernels/test_pos_encoding.py
tests/kernels/test_pos_encoding.py
+3
-3
No files found.
tests/kernels/test_pos_encoding.py
View file @
dc0f7ccf
...
...
@@ -70,7 +70,7 @@ def test_rotary_embedding(
if
rotary_dim
is
None
:
rotary_dim
=
head_size
rope
=
get_rope
(
head_size
,
rotary_dim
,
max_position
,
base
,
is_neox_style
)
rope
=
rope
.
to
(
dtype
=
dtype
)
rope
=
rope
.
to
(
dtype
=
dtype
,
device
=
torch
.
get_default_device
()
)
positions
=
torch
.
randint
(
0
,
max_position
,
(
batch_size
,
seq_len
))
query_shape
=
tensor_shape_fn
(
batch_size
,
seq_len
,
num_heads
,
head_size
)
...
...
@@ -125,7 +125,7 @@ def test_batched_rotary_embedding(
"rope_type"
:
"linear"
,
"factor"
:
(
1
,
)
})
rope
=
rope
.
to
(
dtype
=
dtype
)
rope
=
rope
.
to
(
dtype
=
dtype
,
device
=
torch
.
get_default_device
()
)
positions
=
torch
.
randint
(
0
,
max_position
,
(
batch_size
,
seq_len
))
query_shape
=
tensor_shape_fn
(
batch_size
,
seq_len
,
num_heads
,
head_size
)
...
...
@@ -184,7 +184,7 @@ def test_batched_rotary_embedding_multi_lora(
"rope_type"
:
"linear"
,
"factor"
:
tuple
(
scaling_factors
)
})
rope
=
rope
.
to
(
dtype
=
dtype
)
rope
=
rope
.
to
(
dtype
=
dtype
,
device
=
torch
.
get_default_device
()
)
positions
=
torch
.
randint
(
0
,
max_position
,
(
batch_size
,
seq_len
))
query
=
torch
.
randn
(
batch_size
,
...
...
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