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
2101d93b
"vscode:/vscode.git/clone" did not exist on "02fe316d7c395b027b2a4913e33a92b0b2af26d0"
Unverified
Commit
2101d93b
authored
Sep 22, 2025
by
Lifu Huang
Committed by
GitHub
Sep 22, 2025
Browse files
Fix CI TestChunkedSGMV (#10737)
parent
70e4b218
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
python/sglang/utils.py
python/sglang/utils.py
+6
-0
test/srt/lora/test_chunked_sgmv_backend.py
test/srt/lora/test_chunked_sgmv_backend.py
+11
-0
No files found.
python/sglang/utils.py
View file @
2101d93b
...
@@ -621,6 +621,12 @@ class CachedKernel:
...
@@ -621,6 +621,12 @@ class CachedKernel:
return
complete_args
return
complete_args
def
_clear_cache
(
self
):
"""
Clear the kernel cache for testing purposes.
"""
self
.
kernel_cache
.
clear
()
def
cached_triton_kernel
(
key_fn
=
None
):
def
cached_triton_kernel
(
key_fn
=
None
):
"""
"""
...
...
test/srt/lora/test_chunked_sgmv_backend.py
View file @
2101d93b
...
@@ -10,11 +10,18 @@ from sglang.srt.lora.triton_ops import (
...
@@ -10,11 +10,18 @@ from sglang.srt.lora.triton_ops import (
chunked_sgmv_lora_expand_forward
,
chunked_sgmv_lora_expand_forward
,
chunked_sgmv_lora_shrink_forward
,
chunked_sgmv_lora_shrink_forward
,
)
)
from
sglang.srt.lora.triton_ops.chunked_sgmv_expand
import
_chunked_lora_expand_kernel
from
sglang.srt.lora.triton_ops.chunked_sgmv_shrink
import
_chunked_lora_shrink_kernel
from
sglang.srt.lora.utils
import
LoRABatchInfo
from
sglang.srt.lora.utils
import
LoRABatchInfo
CHUNK_SIZE
=
16
CHUNK_SIZE
=
16
def
reset_kernel_cache
():
_chunked_lora_shrink_kernel
.
_clear_cache
()
_chunked_lora_expand_kernel
.
_clear_cache
()
def
safe_matmul
(
a
:
torch
.
Tensor
,
b
:
torch
.
Tensor
)
->
torch
.
Tensor
:
def
safe_matmul
(
a
:
torch
.
Tensor
,
b
:
torch
.
Tensor
)
->
torch
.
Tensor
:
"""Matrix multiplication with mixed precision handling for float16"""
"""Matrix multiplication with mixed precision handling for float16"""
result
=
torch
.
matmul
(
a
.
float
(),
b
.
float
())
result
=
torch
.
matmul
(
a
.
float
(),
b
.
float
())
...
@@ -436,6 +443,10 @@ class TestChunkedSGMV(unittest.TestCase):
...
@@ -436,6 +443,10 @@ class TestChunkedSGMV(unittest.TestCase):
List
[
str
],
List
[
str
],
]:
]:
"""Create test batch with specified composition and mode"""
"""Create test batch with specified composition and mode"""
# Reset kernel cache to avoid cross-test contamination
reset_kernel_cache
()
seq_lengths
=
self
.
generate_sequence_lengths
(
seq_lengths
=
self
.
generate_sequence_lengths
(
batch_size
,
batch_mode
,
1
,
self
.
max_seq_len
batch_size
,
batch_mode
,
1
,
self
.
max_seq_len
)
)
...
...
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