Skip to content

refactor: decompose monolithic profiler functions into focused helpers - #6538

Merged
hhzhang16 merged 7 commits into
hzhou/new-dgdrfrom
hannahz/decompose-profiler
Feb 25, 2026
Merged

refactor: decompose monolithic profiler functions into focused helpers #6538
hhzhang16 merged 7 commits into
hzhou/new-dgdrfrom
hannahz/decompose-profiler

Conversation

@hhzhang16

Copy link
Copy Markdown
Contributor

Overview:

Splits run_rapid, run_thorough, and run_profile into helper functions (one per logical stage), making each stage independently readable and testable. Adds tests for these helper functions.

Also simplifies the enumerate_profiling_configs in 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)

  • closes GitHub issue: #xxx

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>
Comment thread components/src/dynamo/profiler/profile_sla.py Outdated
sla:
ttft: 2000.0
itl: 50.0
searchStrategy: rapid No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@hhzhang16
hhzhang16 merged commit d1bf7fd into hzhou/new-dgdr Feb 25, 2026
38 checks passed
@hhzhang16
hhzhang16 deleted the hannahz/decompose-profiler branch February 25, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants