refactor: decompose monolithic profiler functions into focused helpers - #6538
Merged
Conversation
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
tedzhouhk
reviewed
Feb 24, 2026
tedzhouhk
reviewed
Feb 24, 2026
| sla: | ||
| ttft: 2000.0 | ||
| itl: 50.0 | ||
| searchStrategy: rapid No newline at end of file |
Contributor
There was a problem hiding this comment.
test failed with
dgdr = DynamoGraphDeploymentRequestSpec(model='Qwen/Qwen3-32B', backend=<BackendType.Trtllm: 'trtllm'>, image='nvcr.io/nvidia..._metric_samples=10, load_min_observations=5), mocker=MockerSpec(enabled=True)), searchStrategy='rapid', autoApply=True)
def _extract_profiler_params(dgdr: DynamoGraphDeploymentRequestSpec) -> tuple:
"""Pull all profiler parameters from dgdr and log them."""
model = dgdr.model
backend = dgdr.backend.value.lower()
system = dgdr.hardware.gpuSku.lower()
total_gpus = dgdr.hardware.totalGpus
isl = dgdr.workload.isl
osl = dgdr.workload.osl
request_latency = dgdr.sla.e2eLatency
if request_latency is not None:
target_ttft = request_latency
target_tpot = request_latency
else:
target_ttft = dgdr.sla.ttft
target_tpot = dgdr.sla.itl
> search_strategy = SearchStrategy(dgdr.searchStrategy.value)
^^^^^^^^^^^^^^^^^^^^^^^^^
E AttributeError: 'str' object has no attribute 'value'
backend = 'trtllm'
dgdr = DynamoGraphDeploymentRequestSpec(model='Qwen/Qwen3-32B', backend=<BackendType.Trtllm: 'trtllm'>, image='nvcr.io/nvidia..._metric_samples=10, load_min_observations=5), mocker=MockerSpec(enabled=True)), searchStrategy='rapid', autoApply=True)
isl = 4000
model = 'Qwen/Qwen3-32B'
osl = 1000
request_latency = None
system = 'h200_sxm'
target_tpot = 50.0
target_ttft = 2000
total_gpus = 8
components/src/dynamo/profiler/profile_sla.py:67: AttributeError
because default needs to be SearchStrategy.Rapid
searchStrategy: SearchStrategy = Field(
default="rapid",
description='SearchStrategy controls the profiling search depth. "rapid" performs a fast sweep; "thorough" explores more configurations.',
)
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
…nahz/decompose-profiler Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
tedzhouhk
approved these changes
Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview:
Splits
run_rapid,run_thorough, andrun_profileinto helper functions (one per logical stage), making each stage independently readable and testable. Adds tests for these helper functions.Also simplifies the
enumerate_profiling_configsin thorough.py and strips default-valued fields from the profiler test configs.Details:
Where should the reviewer start?
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)