Skip to content

Update third-party dependencies#6418

Open
JanuszL wants to merge 5 commits into
NVIDIA:mainfrom
JanuszL:update-third-party-dependencies
Open

Update third-party dependencies#6418
JanuszL wants to merge 5 commits into
NVIDIA:mainfrom
JanuszL:update-third-party-dependencies

Conversation

@JanuszL

@JanuszL JanuszL commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Category:

Other (Configuration)

Description:

Updates the CUTLASS submodule from v4.5.0 to the upstream v4.5.2 release and
updates Black from 26.1.0 to 26.5.1 in the build images and lint workflow.
Updates the Conda protobuf packages to 7.35.1 and pins the DALI_deps build to
the matching protobuf 35.1 revision from NVIDIA/DALI_deps#165. The third-party
dependency table is updated for both dependencies.

Adds OpenCV 5 to DALI's CMake package lookup, while retaining the OpenCV 4 and
3 fallbacks. Updates the Mat-to-Tensor test helper with separate OpenCV 4 and
OpenCV 5 paths: OpenCV 5 uses the public cv::Mat::dims API, while OpenCV 4
retains the existing MatSize representation handling.

Pins Conda LMDB below 1.0. LMDB 1.0 cannot open the existing 0.9-format
DALI_extra LMDB test databases, and those datasets must not be regenerated.

Additional information:

Affected modules and functionalities:

  • third_party/cutlass submodule pin
  • third_party/README.rst dependency version/link
  • Black installation pins in the x86_64 and aarch64 build images
  • Black installation pins in the GitHub lint workflow
  • Conda protobuf and libprotobuf package pins
  • DALI_deps revision used by Docker builds
  • Conda LMDB host and runtime constraints for native DALI libraries
  • OpenCV discovery in the common CMake dependency configuration
  • OpenCV-backed Mat-to-Tensor test helpers

Key points relevant for the review:

The new CUTLASS submodule commit is the upstream v4.5.2 release tag.
Black 26.5.1 passes the existing lint workflow's formatter commands.
This PR depends on NVIDIA/DALI_deps#165 until its revision is merged into main.

OpenCV 5 requires an explicit find_package(OpenCV 5.0 ...) request: its
package config rejects the existing OpenCV 4 and 3 requests as incompatible
major versions. The lookup order is now OpenCV 5, then 4, then 3.

OpenCV 5 also bounds-checks MatSize indexing. The test helper therefore
uses mat.dims and reads only the spatial dimensions in its OpenCV 5 branch;
the OpenCV 4 branch preserves the prior behavior.

LMDB 1.0 changes the on-disk format and is mutually incompatible with LMDB
0.9 databases. Pinning the Conda package to <1.0 preserves compatibility
with the existing DALI_extra reader datasets.

Tests:

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

Validation:

  • git diff --check HEAD
  • cmake --build compile --target dali_test dali_kernel_test dali_python -j"$(nproc)"
  • Mat2Tensor.* (3 passed)
  • LinearTransformationCpuTest/*.*:ResamplingTest.* (186 passed; 1 expected disabled)
  • test_crop_mirror_normalize.test_cmn_vs_numpy:24 (passed on GPU)

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: DALI-4806

@greptile-apps

greptile-apps Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR bundles several independent third-party dependency updates: CUTLASS v4.5.0 → v4.5.2, Black 26.1.0 → 26.5.1 (Docker images, Conda recipes, and the lint workflow), Conda protobuf 6.33.5 → 7.35.1, and an lmdb <1.0 Conda pin to guard against the breaking on-disk format change in LMDB 1.0. It also extends CMake's OpenCV discovery to try v5 before falling back to v4 and v3, and updates dali/test/mat2tensor.h to use the public cv::Mat::dims API for OpenCV 5 compatibility.

  • CMake OpenCV discovery now tries find_package(OpenCV 5.0 QUIET) first, then 4.0 QUIET, then 3.0 REQUIRED — the Conda recipes retain libopencv >=4.13,<5 so Conda builds naturally fall through to OpenCV 4, while non-Conda system builds can pick up OpenCV 5.
  • mat2tensor.h adds a CV_VERSION_MAJOR >= 5 preprocessor guard: the mat.dims public API replaces the internal mat.size[-1] convention (which OpenCV 5 bounds-checks), and the fill loop is bounded by mat_dims rather than shape.size() to avoid the out-of-bounds read that was present in the OpenCV 4 path.
  • Conda LMDB pin (<1.0) is correctly applied in both host and run sections of dali_native_libs; the explanatory comment is included inline.

Confidence Score: 5/5

All code changes are correct and consistent; the only open item is the placeholder in DALI_DEPS_VERSION, which is already tracked and acknowledged by the author.

The CMake OpenCV cascade is correctly structured (5 QUIET → 4 QUIET → 3 REQUIRED). The mat2tensor.h preprocessor guard is logically sound: mat.dims gives the same value as the private mat.size[-1] on OpenCV 4 and is the public API on OpenCV 5, and the OpenCV 5 fill loop correctly bounds iteration to mat_dims to avoid the pre-existing out-of-bounds read. All three protobuf pin sites across the two Conda recipes are consistent with each other. The lmdb <1.0 pin is applied in both host and run sections of dali_native_libs. Black is updated uniformly across both Docker images, both Conda recipes, and the lint workflow.

DALI_DEPS_VERSION contains a placeholder that must be replaced with the real commit SHA once NVIDIA/DALI_deps#165 merges before this PR ships.

Important Files Changed

Filename Overview
.github/workflows/lint.yml Black version pin bumped from 26.1.0 to 26.5.1; no logic changes.
DALI_DEPS_VERSION Placeholder "FixMe" intentionally set pending merge of NVIDIA/DALI_deps#165; already tracked in a previous review thread.
cmake/Dependencies.common.cmake OpenCV 5 QUIET discovery added before the existing 4.0 QUIET and 3.0 REQUIRED fallbacks; cascade logic is correct and the status message correctly reflects the resolved version.
conda/dali_native_libs/recipe/meta.yaml Protobuf bumped to 7.35.1 in host and run sections; lmdb pinned to <1.0 in both host and run sections with an explanatory comment; all three pin sites are consistent.
conda/dali_python_bindings/recipe/meta.yaml Black and black-jupyter bumped to 26.5.1; libprotobuf-static bumped to 7.35.1 in host and run sections consistently.
dali/test/mat2tensor.h OpenCV 5 guard added: mat.dims replaces mat.size[-1] for dimension count, and the fill loop is correctly bounded by mat_dims (not shape.size()) to avoid the pre-existing out-of-bounds read in the OpenCV 4 path when channels > 1.
docker/Dockerfile Black bumped from 26.1.0 to 26.5.1 in the x86_64 build image pip install line.
docker/Dockerfile.build.aarch64-linux Black bumped from 26.1.0 to 26.5.1 in the aarch64 build image pip install line; consistent with the x86_64 Dockerfile.
third_party/README.rst CUTLASS entry updated from 4.5.0 to 4.5.2 and Black entry updated from 26.1.0 to 26.5.1; RST table formatting is intact.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A{BUILD_OPENCV?} -->|Yes| B[find_package OpenCV 5.0 QUIET]
    A -->|No| Z[Skip OpenCV]
    B -->|Found| E[Use OpenCV 5]
    B -->|Not Found| C[find_package OpenCV 4.0 QUIET]
    C -->|Found| F[Use OpenCV 4]
    C -->|Not Found| D[find_package OpenCV 3.0 REQUIRED]
    D -->|Found| G[Use OpenCV 3]
    D -->|Not Found| H[CMake Fatal Error]
    E --> I[Production libs: opencv_core + opencv_imgproc]
    F --> I
    G --> I
    I --> J{BUILD_TEST?}
    J -->|Yes| K[Test libs: + opencv_imgcodecs]
    J -->|No| L[Unset DALI_OPENCV_TEST_EXTRA_LIBS cache]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A{BUILD_OPENCV?} -->|Yes| B[find_package OpenCV 5.0 QUIET]
    A -->|No| Z[Skip OpenCV]
    B -->|Found| E[Use OpenCV 5]
    B -->|Not Found| C[find_package OpenCV 4.0 QUIET]
    C -->|Found| F[Use OpenCV 4]
    C -->|Not Found| D[find_package OpenCV 3.0 REQUIRED]
    D -->|Found| G[Use OpenCV 3]
    D -->|Not Found| H[CMake Fatal Error]
    E --> I[Production libs: opencv_core + opencv_imgproc]
    F --> I
    G --> I
    I --> J{BUILD_TEST?}
    J -->|Yes| K[Test libs: + opencv_imgcodecs]
    J -->|No| L[Unset DALI_OPENCV_TEST_EXTRA_LIBS cache]
Loading

Reviews (7): Last reviewed commit: "Handle Mat2Tensor shapes with OpenCV 5" | Re-trigger Greptile

@JanuszL JanuszL force-pushed the update-third-party-dependencies branch from 95f284e to 188a959 Compare July 3, 2026 11:14
@JanuszL JanuszL changed the title Update CUTLASS to v4.5.2 Update third-party dependencies Jul 3, 2026
@JanuszL JanuszL force-pushed the update-third-party-dependencies branch from 188a959 to 588dfb3 Compare July 3, 2026 11:15
@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [56721308]: BUILD STARTED

Comment thread DALI_DEPS_VERSION
@JanuszL JanuszL force-pushed the update-third-party-dependencies branch from 588dfb3 to 941b5ef Compare July 3, 2026 13:14
@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [56721308]: BUILD FAILED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [56729132]: BUILD STARTED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [56729132]: BUILD FAILED

JanuszL added 3 commits July 4, 2026 18:17
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL JanuszL force-pushed the update-third-party-dependencies branch from d4eff1a to 4f7c581 Compare July 4, 2026 16:17
@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [56813258]: BUILD STARTED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [56813258]: BUILD FAILED

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [57014003]: BUILD STARTED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [57014003]: BUILD FAILED

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [57084828]: BUILD STARTED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [57084828]: BUILD FAILED

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.

4 participants