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
dynamo
Commits
8c8922b0
Unverified
Commit
8c8922b0
authored
Oct 27, 2025
by
Yan Ru Pei
Committed by
GitHub
Oct 27, 2025
Browse files
fix: pipe AI perf streaming output to terminal in rotuer benchmarking (#3905)
Signed-off-by:
PeaBrane
<
yanrpei@gmail.com
>
parent
07cf0744
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
benchmarks/router/prefix_ratio_benchmark.py
benchmarks/router/prefix_ratio_benchmark.py
+7
-15
No files found.
benchmarks/router/prefix_ratio_benchmark.py
View file @
8c8922b0
...
@@ -140,19 +140,16 @@ def run_benchmark_single_url(
...
@@ -140,19 +140,16 @@ def run_benchmark_single_url(
logger
.
info
(
f
"Running command for URL
{
url
}
:
{
' '
.
join
(
aiperf_cmd
)
}
"
)
logger
.
info
(
f
"Running command for URL
{
url
}
:
{
' '
.
join
(
aiperf_cmd
)
}
"
)
try
:
try
:
aiperf_process
=
subprocess
.
run
(
# Run aiperf and let it output directly to terminal
aiperf_cmd
,
capture_output
=
True
,
text
=
True
,
check
=
True
subprocess
.
run
(
aiperf_cmd
,
check
=
True
)
)
logger
.
info
(
f
"AIPerf profiling completed successfully for URL
{
url
}
"
)
logger
.
info
(
f
"AIPerf profiling completed successfully for URL
{
url
}
"
)
logger
.
info
(
aiperf_process
.
stdout
)
aiperf_result
=
get_aiperf_result
(
artifact_dir
)
aiperf_result
=
get_aiperf_result
(
artifact_dir
)
return
aiperf_result
return
aiperf_result
except
subprocess
.
CalledProcessError
as
e
:
except
subprocess
.
CalledProcessError
as
e
:
logger
.
error
(
f
"AIPerf failed for URL
{
url
}
with error code:
{
e
.
returncode
}
"
)
logger
.
error
(
f
"AIPerf failed for URL
{
url
}
with error code:
{
e
.
returncode
}
"
)
logger
.
error
(
f
"stderr:
{
e
.
stderr
}
"
)
return
None
return
None
...
@@ -255,19 +252,17 @@ def run_benchmark(
...
@@ -255,19 +252,17 @@ def run_benchmark(
logger
.
info
(
f
"Launching process for URL
{
url
}
:
{
' '
.
join
(
aiperf_cmd
)
}
"
)
logger
.
info
(
f
"Launching process for URL
{
url
}
:
{
' '
.
join
(
aiperf_cmd
)
}
"
)
process
=
subprocess
.
Popen
(
# Run process without capturing output - let it stream to terminal
aiperf_cmd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
text
=
True
process
=
subprocess
.
Popen
(
aiperf_cmd
)
)
processes
.
append
((
process
,
url
,
artifact_dir
))
processes
.
append
((
process
,
url
,
artifact_dir
))
# Wait for all processes to complete and collect results
# Wait for all processes to complete and collect results
results
:
List
[
Optional
[
Dict
]]
=
[]
results
:
List
[
Optional
[
Dict
]]
=
[]
for
process
,
url
,
artifact_dir
in
processes
:
for
process
,
url
,
artifact_dir
in
processes
:
stdout
,
stderr
=
process
.
communicate
()
return_code
=
process
.
wait
()
if
process
.
returncode
==
0
:
if
return
_
code
==
0
:
logger
.
info
(
f
"AIPerf completed successfully for URL
{
url
}
"
)
logger
.
info
(
f
"AIPerf completed successfully for URL
{
url
}
"
)
logger
.
info
(
stdout
)
try
:
try
:
aiperf_result
=
get_aiperf_result
(
artifact_dir
)
aiperf_result
=
get_aiperf_result
(
artifact_dir
)
...
@@ -276,10 +271,7 @@ def run_benchmark(
...
@@ -276,10 +271,7 @@ def run_benchmark(
logger
.
error
(
f
"Failed to get results for URL
{
url
}
:
{
e
}
"
)
logger
.
error
(
f
"Failed to get results for URL
{
url
}
:
{
e
}
"
)
results
.
append
(
None
)
results
.
append
(
None
)
else
:
else
:
logger
.
error
(
logger
.
error
(
f
"AIPerf failed for URL
{
url
}
with error code:
{
return_code
}
"
)
f
"AIPerf failed for URL
{
url
}
with error code:
{
process
.
returncode
}
"
)
logger
.
error
(
f
"stderr:
{
stderr
}
"
)
results
.
append
(
None
)
results
.
append
(
None
)
# Aggregate results
# Aggregate results
...
...
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