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
54644572
Unverified
Commit
54644572
authored
Oct 16, 2025
by
Fan Yin
Committed by
GitHub
Oct 15, 2025
Browse files
[sgl-kernel] Optimize gguf test (#11667)
parent
6c01844f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
docs/requirements.txt
docs/requirements.txt
+1
-1
sgl-kernel/tests/test_gguf.py
sgl-kernel/tests/test_gguf.py
+7
-1
No files found.
docs/requirements.txt
View file @
54644572
...
@@ -16,5 +16,5 @@ sphinx-tabs
...
@@ -16,5 +16,5 @@ sphinx-tabs
nbstripout
nbstripout
sphinxcontrib-mermaid
sphinxcontrib-mermaid
urllib3<2.0.0
urllib3<2.0.0
gguf>=0.1
0.0
gguf>=0.1
7.1
sphinx-autobuild
sphinx-autobuild
sgl-kernel/tests/test_gguf.py
View file @
54644572
...
@@ -107,7 +107,13 @@ def test_mmvq(hidden_size: int, dtype: torch.dtype, quant_type: GGMLQuantization
...
@@ -107,7 +107,13 @@ def test_mmvq(hidden_size: int, dtype: torch.dtype, quant_type: GGMLQuantization
qweight
=
torch
.
tensor
(
tensor
.
data
,
device
=
"cuda"
)
qweight
=
torch
.
tensor
(
tensor
.
data
,
device
=
"cuda"
)
output
=
ggml_mul_mat_vec_a8
(
qweight
,
x
,
quant_type
,
qweight
.
shape
[
0
]).
to
(
dtype
)
output
=
ggml_mul_mat_vec_a8
(
qweight
,
x
,
quant_type
,
qweight
.
shape
[
0
]).
to
(
dtype
)
torch
.
testing
.
assert_close
(
output
,
ref_output
,
atol
=
1
,
rtol
=
1e-1
)
# NOTE(FlamingoPg): There can be occasional errors, Loosen the granularity of gguf bf16 verification.
atols
=
{
torch
.
half
:
1
,
torch
.
bfloat16
:
1.5
,
torch
.
float
:
1
}
rtols
=
{
torch
.
half
:
1e-1
,
torch
.
bfloat16
:
3e1
,
torch
.
float
:
1e-1
}
torch
.
testing
.
assert_close
(
output
,
ref_output
,
atol
=
atols
[
dtype
],
rtol
=
rtols
[
dtype
]
)
@
pytest
.
mark
.
parametrize
(
"num_tokens"
,
NUM_TOKENS
)
@
pytest
.
mark
.
parametrize
(
"num_tokens"
,
NUM_TOKENS
)
...
...
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