Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
ae3524c6
Commit
ae3524c6
authored
Sep 05, 2024
by
zhuwenwen
Browse files
update benchmark_throughput.py
parent
163b243a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
22 deletions
+18
-22
benchmarks/benchmark_throughput.py
benchmarks/benchmark_throughput.py
+9
-11
vllm/benchmark_throughput.py
vllm/benchmark_throughput.py
+8
-10
vllm/model_executor/layers/quantization/awq.py
vllm/model_executor/layers/quantization/awq.py
+1
-1
No files found.
benchmarks/benchmark_throughput.py
View file @
ae3524c6
...
@@ -287,17 +287,15 @@ def main(args: argparse.Namespace):
...
@@ -287,17 +287,15 @@ def main(args: argparse.Namespace):
raise
ValueError
(
f
"Unknown backend:
{
args
.
backend
}
"
)
raise
ValueError
(
f
"Unknown backend:
{
args
.
backend
}
"
)
total_num_tokens
=
sum
(
prompt_len
+
output_len
total_num_tokens
=
sum
(
prompt_len
+
output_len
for
_
,
prompt_len
,
output_len
in
requests
)
for
_
,
prompt_len
,
output_len
in
requests
)
print
(
f
"Throughput:
{
len
(
requests
)
/
elapsed_time
:.
2
f
}
requests/s, "
f
"
{
total_num_tokens
/
elapsed_time
:.
2
f
}
tokens/s"
)
#
if args.dataset is None:
if
args
.
dataset
is
None
:
#
total_out_tokens = args.output_len * args.num_prompts
total_out_tokens
=
args
.
output_len
*
args
.
num_prompts
#
else:
else
:
#
total_out_tokens = sum(output_len for _, _, output_len in requests)
total_out_tokens
=
sum
(
output_len
for
_
,
_
,
output_len
in
requests
)
#
print(f"Latency: {elapsed_time:.2f} s")
print
(
f
"Latency:
{
elapsed_time
:.
2
f
}
s"
)
#
print(f"All Throughput: {len(requests) / elapsed_time:.2f} requests/s, "
print
(
f
"All Throughput:
{
len
(
requests
)
/
elapsed_time
:.
2
f
}
requests/s, "
#
f"{total_num_tokens / elapsed_time:.2f} tokens/s")
f
"
{
total_num_tokens
/
elapsed_time
:.
2
f
}
tokens/s"
)
#
print(f"Generate Throughput: {total_out_tokens / elapsed_time:.2f} tokens/s")
print
(
f
"Generate Throughput:
{
total_out_tokens
/
elapsed_time
:.
2
f
}
tokens/s"
)
# Output JSON results if specified
# Output JSON results if specified
...
...
vllm/benchmark_throughput.py
View file @
ae3524c6
...
@@ -287,17 +287,15 @@ def main(args: argparse.Namespace):
...
@@ -287,17 +287,15 @@ def main(args: argparse.Namespace):
raise
ValueError
(
f
"Unknown backend:
{
args
.
backend
}
"
)
raise
ValueError
(
f
"Unknown backend:
{
args
.
backend
}
"
)
total_num_tokens
=
sum
(
prompt_len
+
output_len
total_num_tokens
=
sum
(
prompt_len
+
output_len
for
_
,
prompt_len
,
output_len
in
requests
)
for
_
,
prompt_len
,
output_len
in
requests
)
print
(
f
"Throughput:
{
len
(
requests
)
/
elapsed_time
:.
2
f
}
requests/s, "
f
"
{
total_num_tokens
/
elapsed_time
:.
2
f
}
tokens/s"
)
#
if args.dataset is None:
if
args
.
dataset
is
None
:
#
total_out_tokens = args.output_len * args.num_prompts
total_out_tokens
=
args
.
output_len
*
args
.
num_prompts
#
else:
else
:
#
total_out_tokens = sum(output_len for _, _, output_len in requests)
total_out_tokens
=
sum
(
output_len
for
_
,
_
,
output_len
in
requests
)
#
print(f"Latency: {elapsed_time:.2f} s")
print
(
f
"Latency:
{
elapsed_time
:.
2
f
}
s"
)
#
print(f"All Throughput: {len(requests) / elapsed_time:.2f} requests/s, "
print
(
f
"All Throughput:
{
len
(
requests
)
/
elapsed_time
:.
2
f
}
requests/s, "
#
f"{total_num_tokens / elapsed_time:.2f} tokens/s")
f
"
{
total_num_tokens
/
elapsed_time
:.
2
f
}
tokens/s"
)
#
print(f"Generate Throughput: {total_out_tokens / elapsed_time:.2f} tokens/s")
print
(
f
"Generate Throughput:
{
total_out_tokens
/
elapsed_time
:.
2
f
}
tokens/s"
)
# Output JSON results if specified
# Output JSON results if specified
...
...
vllm/model_executor/layers/quantization/awq.py
View file @
ae3524c6
...
@@ -195,7 +195,7 @@ class AWQLinearMethod(LinearMethodBase):
...
@@ -195,7 +195,7 @@ class AWQLinearMethod(LinearMethodBase):
else
:
else
:
padding_group
=
0
padding_group
=
0
if
m
<
4096
:
if
m
<
20000
:
out
=
ops
.
awq_gemm
(
reshaped_x
,
out
=
ops
.
awq_gemm
(
reshaped_x
,
qweight
,
qweight
,
zeros_and_scales
,
zeros_and_scales
,
...
...
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