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
change
sglang
Commits
193fbb0b
Unverified
Commit
193fbb0b
authored
Nov 04, 2025
by
fzyzcjy
Committed by
GitHub
Nov 04, 2025
Browse files
Super tiny add UT for copy_to_gpu_no_ce (#12270)
parent
e607850f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
sgl-kernel/python/sgl_kernel/elementwise.py
sgl-kernel/python/sgl_kernel/elementwise.py
+1
-1
sgl-kernel/tests/test_copy.py
sgl-kernel/tests/test_copy.py
+16
-0
No files found.
sgl-kernel/python/sgl_kernel/elementwise.py
View file @
193fbb0b
...
@@ -369,7 +369,7 @@ def downcast_fp8(
...
@@ -369,7 +369,7 @@ def downcast_fp8(
)
)
def
copy_to_gpu_no_ce
(
input
:
List
[
int
]
,
output
:
torch
.
Tensor
):
def
copy_to_gpu_no_ce
(
input
:
torch
.
Tensor
,
output
:
torch
.
Tensor
):
torch
.
ops
.
sgl_kernel
.
copy_to_gpu_no_ce
(
input
,
output
)
torch
.
ops
.
sgl_kernel
.
copy_to_gpu_no_ce
(
input
,
output
)
...
...
sgl-kernel/tests/test_copy.py
0 → 100644
View file @
193fbb0b
import
pytest
import
sgl_kernel
import
torch
from
sgl_kernel.elementwise
import
copy_to_gpu_no_ce
@
pytest
.
mark
.
parametrize
(
"size"
,
[
64
,
72
])
def
test_copy_to_gpu_no_ce
(
size
):
tensor_cpu
=
torch
.
randint
(
0
,
1000000
,
(
size
,),
dtype
=
torch
.
int32
,
device
=
"cpu"
)
tensor_gpu
=
torch
.
empty_like
(
tensor_cpu
,
device
=
"cuda"
)
copy_to_gpu_no_ce
(
tensor_cpu
,
tensor_gpu
)
assert
torch
.
all
(
tensor_cpu
.
cuda
()
==
tensor_gpu
)
if
__name__
==
"__main__"
:
pytest
.
main
([
__file__
])
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