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
6e2da515
Unverified
Commit
6e2da515
authored
May 11, 2025
by
Lifu Huang
Committed by
GitHub
May 11, 2025
Browse files
Replace time.time() to time.perf_counter() for benchmarking. (#6178)
Signed-off-by:
Lifu Huang
<
lifu.hlf@gmail.com
>
parent
e9a47f4c
Changes
61
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
test/srt/test_w8a8_quantization.py
test/srt/test_w8a8_quantization.py
+2
-2
No files found.
test/srt/test_w8a8_quantization.py
View file @
6e2da515
...
@@ -62,9 +62,9 @@ class TestW8A8(CustomTestCase):
...
@@ -62,9 +62,9 @@ class TestW8A8(CustomTestCase):
def
test_throughput
(
self
):
def
test_throughput
(
self
):
max_tokens
=
256
max_tokens
=
256
tic
=
time
.
time
()
tic
=
time
.
perf_counter
()
res
=
self
.
run_decode
(
max_tokens
)
res
=
self
.
run_decode
(
max_tokens
)
tok
=
time
.
time
()
tok
=
time
.
perf_counter
()
print
(
res
[
"text"
])
print
(
res
[
"text"
])
throughput
=
max_tokens
/
(
tok
-
tic
)
throughput
=
max_tokens
/
(
tok
-
tic
)
print
(
f
"Throughput:
{
throughput
}
tokens/s"
)
print
(
f
"Throughput:
{
throughput
}
tokens/s"
)
...
...
Prev
1
2
3
4
Next
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