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
31909ca3
Unverified
Commit
31909ca3
authored
Apr 13, 2026
by
Yan Ru Pei
Committed by
GitHub
Apr 14, 2026
Browse files
fix(replay): short-circuit .npz planner imports (#8050)
Signed-off-by:
PeaBrane
<
yanrpei@gmail.com
>
parent
4e6c3964
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
20 deletions
+28
-20
components/src/dynamo/mocker/args.py
components/src/dynamo/mocker/args.py
+3
-3
components/src/dynamo/mocker/utils/planner_profiler_perf_data_converter.py
...namo/mocker/utils/planner_profiler_perf_data_converter.py
+9
-6
lib/bindings/python/src/dynamo/replay/main.py
lib/bindings/python/src/dynamo/replay/main.py
+16
-11
No files found.
components/src/dynamo/mocker/args.py
View file @
31909ca3
...
...
@@ -55,15 +55,15 @@ def resolve_planner_profile_data(
Raises:
FileNotFoundError: If path doesn't contain valid profile data in any supported format.
"""
if
planner_profile_data
is
None
:
return
ProfileDataResult
(
npz_path
=
None
,
tmpdir
=
None
)
from
.utils.planner_profiler_perf_data_converter
import
(
convert_profile_results_to_npz
,
is_mocker_format_npz
,
is_profile_results_dir
,
)
if
planner_profile_data
is
None
:
return
ProfileDataResult
(
npz_path
=
None
,
tmpdir
=
None
)
# Case 1: Already a mocker-format NPZ file
if
is_mocker_format_npz
(
planner_profile_data
):
logger
.
info
(
f
"Using mocker-format NPZ file:
{
planner_profile_data
}
"
)
...
...
components/src/dynamo/mocker/utils/planner_profiler_perf_data_converter.py
View file @
31909ca3
...
...
@@ -32,12 +32,6 @@ from typing import Any
import
numpy
as
np
from
dynamo.planner.core.perf_model
import
DecodeRegressionModel
,
PrefillRegressionModel
from
dynamo.planner.monitoring.perf_metrics
import
(
_convert_decode_profiling
,
_convert_prefill_profiling
,
)
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -61,6 +55,15 @@ def convert_profile_results_to_npz(
Returns:
Path to the generated NPZ file.
"""
from
dynamo.planner.core.perf_model
import
(
DecodeRegressionModel
,
PrefillRegressionModel
,
)
from
dynamo.planner.monitoring.perf_metrics
import
(
_convert_decode_profiling
,
_convert_prefill_profiling
,
)
profile_results_dir
=
str
(
Path
(
profile_results_dir
).
resolve
())
output_path
=
Path
(
output_path
)
...
...
lib/bindings/python/src/dynamo/replay/main.py
View file @
31909ca3
...
...
@@ -27,15 +27,17 @@ class PlannerProfileDataResult(Protocol):
def
resolve_planner_profile_data
(
planner_profile_data
:
Path
|
None
,
)
->
PlannerProfileDataResult
:
if
planner_profile_data
is
None
:
return
SimpleNamespace
(
npz_path
=
None
)
if
planner_profile_data
.
suffix
==
".npz"
:
return
SimpleNamespace
(
npz_path
=
planner_profile_data
)
try
:
module
=
importlib
.
import_module
(
"dynamo.mocker.args"
)
except
ImportError
:
if
planner_profile_data
is
None
:
return
SimpleNamespace
(
npz_path
=
None
)
return
SimpleNamespace
(
npz_path
=
planner_profile_data
if
planner_profile_data
.
suffix
==
".npz"
else
None
npz_path
=
None
,
)
return
module
.
resolve_planner_profile_data
(
planner_profile_data
)
...
...
@@ -62,6 +64,9 @@ def _load_engine_args(raw_args: str | None):
"worker_type must be one of 'aggregated', 'prefill', or 'decode'"
)
if
"planner_profile_data"
in
raw
:
if
raw
[
"planner_profile_data"
]
is
None
:
del
raw
[
"planner_profile_data"
]
else
:
profile_data_result
=
resolve_planner_profile_data
(
Path
(
raw
[
"planner_profile_data"
])
)
...
...
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