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
fc86b18b
Unverified
Commit
fc86b18b
authored
Oct 24, 2025
by
Glen Liu
Committed by
GitHub
Oct 24, 2025
Browse files
adjust dynamic vs static outputs comparison in test_lora_update.py (#11884)
parent
0bfa394a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
test/srt/lora/test_lora_update.py
test/srt/lora/test_lora_update.py
+12
-6
No files found.
test/srt/lora/test_lora_update.py
View file @
fc86b18b
...
@@ -28,6 +28,7 @@ from sglang.test.test_utils import (
...
@@ -28,6 +28,7 @@ from sglang.test.test_utils import (
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH
,
DEFAULT_URL_FOR_TEST
,
DEFAULT_URL_FOR_TEST
,
CustomTestCase
,
CustomTestCase
,
calculate_rouge_l
,
is_in_ci
,
is_in_ci
,
popen_launch_server
,
popen_launch_server
,
)
)
...
@@ -1278,6 +1279,8 @@ class TestLoRADynamicUpdate(CustomTestCase):
...
@@ -1278,6 +1279,8 @@ class TestLoRADynamicUpdate(CustomTestCase):
max_new_tokens
=
test_case
.
max_new_tokens
,
max_new_tokens
=
test_case
.
max_new_tokens
,
)
)
ROUGE_L_TOL
=
0.9
print
(
f
"Dynamic output:
{
dynamic_output
}
"
)
print
(
f
"Dynamic output:
{
dynamic_output
}
"
)
print
(
f
"Static output:
{
static_output
}
"
)
print
(
f
"Static output:
{
static_output
}
"
)
print
(
"="
*
100
)
print
(
"="
*
100
)
...
@@ -1295,12 +1298,15 @@ class TestLoRADynamicUpdate(CustomTestCase):
...
@@ -1295,12 +1298,15 @@ class TestLoRADynamicUpdate(CustomTestCase):
f
"Output length mismatch at batch
{
i
}
:
\n
- Dynamic=
{
len
(
dynamic
)
}
\n
- Static=
{
len
(
static
)
}
"
,
f
"Output length mismatch at batch
{
i
}
:
\n
- Dynamic=
{
len
(
dynamic
)
}
\n
- Static=
{
len
(
static
)
}
"
,
)
)
for
j
,
(
d_out
,
s_out
)
in
enumerate
(
zip
(
dynamic
,
static
),
start
=
1
):
for
j
,
(
d_out
,
s_out
)
in
enumerate
(
zip
(
dynamic
,
static
),
start
=
1
):
d_out
=
d_out
.
strip
()
d_out_str
=
d_out
.
strip
()
s_out
=
s_out
.
strip
()
s_out_str
=
s_out
.
strip
()
self
.
assertEqual
(
rouge_score
=
calculate_rouge_l
([
d_out_str
],
[
s_out_str
])[
0
]
d_out
,
s_out
,
self
.
assertGreaterEqual
(
f
"Output mismatch at batch
{
i
}
, prompt
{
j
}
:
\n
- Dynamic: '
{
d_out
}
'
\n
- Static: '
{
s_out
}
'"
,
rouge_score
,
ROUGE_L_TOL
,
f
"ROUGE-L score
{
rouge_score
}
of outputs is below tolerance of
{
ROUGE_L_TOL
}
"
f
"at batch
{
i
}
, prompt
{
j
}
:
\n
- Dynamic: '
{
d_out
}
'
\n
- Static: '
{
s_out
}
'"
,
)
)
def
test_dynamic_lora_update_engine
(
self
):
def
test_dynamic_lora_update_engine
(
self
):
...
...
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