Skip to content

Improve call site detection in capture mode and add it to hw decoder bench - #6445

Merged
rostan-t merged 3 commits into
NVIDIA:mainfrom
rostan-t:ndd-capture-trim-stack
Aug 11, 2026
Merged

Improve call site detection in capture mode and add it to hw decoder bench#6445
rostan-t merged 3 commits into
NVIDIA:mainfrom
rostan-t:ndd-capture-trim-stack

Conversation

@rostan-t

@rostan-t rostan-t commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Category:

New feature (non-breaking change which adds functionality)

Description:

Currently, the following fails to capture properly:

for _ in range(WARMUP_EPOCHS):
    run_epoch(reader)

for _ in range(NUM_EPOCHS):
    run_epoch(reader)

Operators were first captured in the warmup loop and the full call chain is used to identify a node so operators in the second loop fail to capture and fall back to normal execution.

This PR fixes this by trimming the call chain to only the required size. It also adds capture mode to L1_decoder_perf.

Additional information:

Affected modules and functionalities:

Dynamic capture mode.

Key points relevant for the review:

Does call chain trimming introduce silent regressions that I didn't think of?

Tests:

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: N/A

Comment thread dali/python/nvidia/dali/experimental/dynamic/_capture.py Fixed
@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [61565034]: BUILD STARTED

@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR shortens dynamic-capture call chains while preserving the frames needed to identify operator sites, and enables capture mode in the hardware-decoder benchmark.

  • Tracks source-analysis proof depth and compacts captured call-site tries before replay.
  • Adds warmup and nested proof-frame capture coverage.
  • Adds an NDD capture benchmark run to decoder-performance QA.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
dali/python/nvidia/dali/experimental/dynamic/_capture.py Adds proof-preserving call-trie compaction and early terminal lookup; no eligible residual issue was established.
dali/python/nvidia/dali/experimental/dynamic/_source_analysis.py Propagates the stack depth needed to prove invariant arguments across nested classifier frames.
dali/test/python/experimental_mode/test_capture.py Adds capture coverage for repeated warmup epochs and nested proof frames.
internal_tools/hw_decoder_bench.py Adds optional capture execution to the dynamic RN50 decoder benchmark.
qa/TL1_decoder_perf/test.sh Runs capture-mode decoder performance as an additional required QA benchmark.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A["Trace dynamic operator call"] --> B["Classify arguments and required proof depth"]
    B --> C["Record full call chain in trie"]
    C --> D["Compact to shortest operator-unique prefix"]
    D --> E["Replay lookup walks runtime frames"]
    E --> F["Return captured node"]
Loading

Reviews (4): Last reviewed commit: "Update copyright year in hw_decoder_benc..." | Re-trigger Greptile

Comment thread dali/python/nvidia/dali/experimental/dynamic/_capture.py
Comment thread internal_tools/hw_decoder_bench.py
Comment thread dali/test/python/experimental_mode/test_capture.py

PERF_RESULT=$(perf_check "${LOG_RN50}" "$MIN_PERF")
PERF_RESULT_NDD=$(perf_check "${LOG_NDD}" "$MIN_PERF_NDD")
PERF_RESULT_NDD_CAPTURE=$(perf_check "${LOG_NDD_CAPTURE}" "$MIN_PERF")

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.

Do you expect perf to match pipeline mode MIN_PERF?

@rostan-t rostan-t Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

When I measure on my workstation, even when tweaking parameters capture mode is consistently slower but the difference is under 3%.
This is not the same machine as used in CI, it's an RTX 6000 PRO but the CPU only has 16 cores.

I enabled L1 tests when triggering CI so we'll see.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Results from CI:

  • Pipeline mode throughput: 21567.07 frames/sec
  • Dynamic mode throughput: 17244.40 frames/sec
  • Dynamic capture mode throughput: 21525.88 frames/sec

Looks like capture mode does match the performance of pipeline mode 🎉

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Results on SBSA:

  • Pipeline mode throughput: 30879.93 frames/sec
  • Dynamic mode throughput: 23685.68 frames/sec
  • Dynamic capture mode throughput: 30909.08 frames/sec

Comment thread internal_tools/hw_decoder_bench.py Outdated
@JanuszL JanuszL self-assigned this Aug 7, 2026
Signed-off-by: Rostan Tabet <rtabet@nvidia.com>
@rostan-t
rostan-t force-pushed the ndd-capture-trim-stack branch from d75ba62 to 67d12ba Compare August 7, 2026 14:08
Signed-off-by: Rostan Tabet <rtabet@nvidia.com>
@rostan-t
rostan-t force-pushed the ndd-capture-trim-stack branch from 67d12ba to 570a74a Compare August 7, 2026 14:10
Comment thread dali/python/nvidia/dali/experimental/dynamic/_capture.py Dismissed
@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [61575050]: BUILD STARTED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [61565034]: BUILD PASSED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [61575050]: BUILD PASSED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [61924029]: BUILD STARTED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [61924029]: BUILD PASSED

Signed-off-by: Rostan Tabet <rtabet@nvidia.com>
@rostan-t
rostan-t merged commit 3488ede into NVIDIA:main Aug 11, 2026
8 checks passed
@rostan-t
rostan-t deleted the ndd-capture-trim-stack branch August 11, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants