DALI icon indicating copy to clipboard operation
DALI copied to clipboard

Add dynamic mode RN50 pipeline to hw decoder bench

Open JanuszL opened this issue 3 weeks ago • 3 comments

  • Adds NDDRN50Pipeline class using nvidia.dali.experimental.dynamic API
  • Adds 'ndd_rn50' pipeline option to benchmark script
  • Supports NDD decoders module selection (experimental vs standard)

Category:

New feature (non-breaking change which adds functionality)

Description:

  • Adds NDDRN50Pipeline class using nvidia.dali.experimental.dynamic API
  • Adds 'ndd_rn50' pipeline option to benchmark script
  • Supports NDD decoders module selection (experimental vs standard)

Additional information:

Affected modules and functionalities:

  • hw_decoder_bench.py
  • TL1_decoder_perf
  • TL1_decoder_perf_release

Key points relevant for the review:

  • NA

Tests:

  • [ ] Existing tests apply
  • [x] New tests added
    • [x] Python tests
      • TL1_decoder_perf
      • TL1_decoder_perf_release
    • [ ] GTests
    • [ ] Benchmark
    • [ ] Other
  • [ ] N/A

Checklist

Documentation

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

DALI team only

Requirements

  • [ ] Implements new requirements
  • [ ] Affects existing requirements
  • [x] N/A

REQ IDs: N/A

JIRA TASK: DALI-4514

JanuszL avatar Dec 07 '25 11:12 JanuszL

Greptile Overview

Greptile Summary

This PR adds support for benchmarking the NVIDIA DALI experimental dynamic API (nvidia.dali.experimental.dynamic) through a new NDDRN50Pipeline class in the hardware decoder benchmark tool.

  • Adds NDDRN50Pipeline class that implements the RN50 pipeline using the new dynamic API with proper EvalContext management and reader iteration patterns
  • Introduces ndd_rn50 as a new pipeline option in the benchmark script
  • Supports both standard (ndd.decoders) and experimental (ndd.experimental.decoders) decoder modules
  • Adds corresponding performance tests in test.sh with separate minimum performance thresholds for the NDD pipeline
  • Refactors perf_check function for reusability across test configurations
  • Fixes a minor typo in a comment ("pointof" → "point of")

The implementation follows established patterns from existing test code (test_rn50_pipeline.py) and correctly handles the dynamic API's context management requirements.

Confidence Score: 4/5

  • This PR is safe to merge - it adds new benchmarking functionality without modifying existing pipeline behavior.
  • The changes are additive, following established patterns from the codebase's existing dynamic API tests. The new NDDRN50Pipeline class correctly uses EvalContext and reader iteration. The test script changes are well-structured with appropriate performance thresholds.
  • No files require special attention - the changes are straightforward additions to benchmarking infrastructure.

Important Files Changed

File Analysis

Filename Score Overview
internal_tools/hw_decoder_bench.py 4/5 Adds NDDRN50Pipeline class using nvidia.dali.experimental.dynamic API with proper EvalContext usage and reader iteration pattern; includes typo fix in comment.
qa/TL1_decoder_perf/test.sh 4/5 Adds NDD pipeline performance tests with refactored perf_check function; intentionally skips experimental decoder checks for dynamic mode; missing trailing newline.

Sequence Diagram

sequenceDiagram
    participant Main as hw_decoder_bench.py
    participant NDD as NDDRN50Pipeline
    participant Ctx as EvalContext
    participant Reader as ndd.readers.File
    participant Dec as decoders_module
    participant Ops as ndd operations

    Main->>NDD: __init__(minibatch_size, batch_size, ...)
    NDD->>Reader: Create File reader
    NDD->>Ctx: Create EvalContext(num_threads, device_id)
    
    Main->>NDD: build()
    Note over NDD: No-op for NDD pipeline

    loop Benchmark iterations
        Main->>NDD: schedule_run()
        Note over NDD: No-op for NDD pipeline
        
        Main->>NDD: share_outputs()
        NDD->>Ctx: Enter context
        NDD->>Reader: next_epoch(batch_size)
        Reader-->>NDD: jpegs, labels iterator
        NDD->>Dec: image_random_crop(jpegs, device=mixed)
        Dec-->>NDD: decoded images
        NDD->>Ops: resize(images, 224x224)
        Ops-->>NDD: resized images
        NDD->>Ops: crop_mirror_normalize(images)
        Ops-->>NDD: normalized output
        NDD-->>Main: output.evaluate()
        
        Main->>NDD: release_outputs()
        Note over NDD: No-op for NDD pipeline
    end

greptile-apps[bot] avatar Dec 07 '25 11:12 greptile-apps[bot]

!build

JanuszL avatar Dec 10 '25 09:12 JanuszL

CI MESSAGE: [39945244]: BUILD STARTED

dali-automaton avatar Dec 10 '25 09:12 dali-automaton

CI MESSAGE: [39945244]: BUILD PASSED

dali-automaton avatar Dec 11 '25 17:12 dali-automaton

CI MESSAGE: [40087882]: BUILD STARTED

dali-automaton avatar Dec 12 '25 08:12 dali-automaton

CI MESSAGE: [40087882]: BUILD PASSED

dali-automaton avatar Dec 12 '25 10:12 dali-automaton

CI MESSAGE: [40110600]: BUILD STARTED

dali-automaton avatar Dec 12 '25 18:12 dali-automaton

CI MESSAGE: [40110600]: BUILD FAILED

dali-automaton avatar Dec 12 '25 21:12 dali-automaton

CI MESSAGE: [40211560]: BUILD STARTED

dali-automaton avatar Dec 15 '25 06:12 dali-automaton

CI MESSAGE: [40211560]: BUILD FAILED

dali-automaton avatar Dec 15 '25 08:12 dali-automaton

CI MESSAGE: [40211560]: BUILD PASSED

dali-automaton avatar Dec 15 '25 11:12 dali-automaton