Skip to content

Conversation

@szalpal
Copy link
Member

@szalpal szalpal commented Dec 16, 2025

Category:

Refactoring (Redesign of existing code that doesn't affect functionality)

Description:

This PR takes out of experimental the following operators:
experimental.audio_resample
experimental.debayer
experimental.equalize
experimental.filter
experimental.tensor_resize
nvidia.dali.plugin.numba.fn.experimental.numba_function

The experimental flavours of the operators is kept to maintain backwards compatibility.

Tests are configured to test both: experimental and regular flavours of the operators. Since the backwards compatibility is maintained, both of these operators need to be tested.

TODO:

  • Adjust documentation (hide experimental flavours)
  • Unexperimentalize decoders.video

Additional information:

Affected modules and functionalities:

Key points relevant for the review:

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


def check_numba_compatibility_gpu(if_skip=True):
import nvidia.dali.plugin.numba.experimental as ex
def check_numba_compatibility_gpu(if_skip=True, use_experimental: bool = False):

Check notice

Code scanning / CodeQL

Explicit returns mixed with implicit (fall through) returns Note test

Mixing implicit and explicit returns may indicate an error, as implicit returns always return None.
@szalpal
Copy link
Member Author

szalpal commented Dec 16, 2025

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [40306038]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [40306038]: BUILD FAILED

@szalpal szalpal force-pushed the unexperimentalize branch 3 times, most recently from e630529 to 51e599d Compare December 17, 2025 07:12
# try importing cuda.core as it can be used later to check the compatibility
# it is okay to fail as it may not be installed, the check later can handle this
import cuda.core
except ImportError:

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.
@szalpal
Copy link
Member Author

szalpal commented Dec 17, 2025

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [40349534]: BUILD STARTED

@szalpal szalpal force-pushed the unexperimentalize branch 2 times, most recently from a3c3ac6 to a424878 Compare December 17, 2025 07:41
@szalpal
Copy link
Member Author

szalpal commented Dec 17, 2025

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [40350589]: BUILD STARTED

@szalpal szalpal marked this pull request as ready for review December 17, 2025 11:06
@greptile-apps
Copy link

greptile-apps bot commented Dec 17, 2025

Greptile Summary

  • This PR moves six stable DALI operators (audio_resample, debayer, equalize, filter, tensor_resize, and numba_function) out of the experimental namespace to regular operator status while maintaining backward compatibility through deprecated aliases
  • Test coverage has been extensively updated across multiple test files to validate both experimental and regular versions of all promoted operators using parameterized testing patterns
  • The decoders.video operator was also unexperimentalized as part of this effort, completing the promotion of operators that have proven stable through testing

Important Files Changed

Filename Overview
dali/operators/image/convolution/filter.cc Moves Filter operator schema from experimental to regular namespace with proper deprecation warnings and dual registration
dali/python/nvidia/dali/plugin/numba/init.py Relocates complete NumbaFunction implementation from experimental to main module with 602 lines of moved code
dali/test/python/test_dali_variable_batch_size.py Updates comprehensive variable batch size testing to cover both experimental and regular operator versions
dali/test/python/checkpointing/test_dali_stateless_operators.py Refactors checkpointing tests to validate both operator namespaces for all affected operators
dali/operators/video/decoder/video_decoder_cpu.cc Restructures video decoder schema from experimental to regular with inherited deprecation alias

Confidence score: 4/5

  • This refactoring follows established DALI patterns for operator graduation and maintains strict backward compatibility through dual registrations
  • Score reflects the comprehensive scope of changes across many files that require careful coordination, though implementation patterns are well-established
  • Pay close attention to test files to ensure parameterized testing correctly covers both experimental and regular operator variants

Sequence Diagram

sequenceDiagram
    participant User
    participant Pipeline
    participant OperatorRegistry
    participant Schema
    participant OperatorImpl

    User->>Pipeline: "fn.debayer(image, blue_position=[0,0])"
    Pipeline->>OperatorRegistry: "Lookup 'Debayer' operator"
    OperatorRegistry->>Schema: "Get DALI_SCHEMA(Debayer)"
    Schema-->>OperatorRegistry: "Return schema with args"
    OperatorRegistry->>OperatorImpl: "Create DebayerCPU/DebayerGPU instance"
    OperatorImpl-->>Pipeline: "Return operator instance"
    Pipeline->>OperatorImpl: "SetupImpl()"
    OperatorImpl-->>Pipeline: "Return output descriptor"
    Pipeline->>OperatorImpl: "RunImpl()"
    OperatorImpl-->>Pipeline: "Return processed output"
    Pipeline-->>User: "Return debayered image"
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Additional Comments (6)

  1. dali/operators/image/color/equalize.cc, line 37 (link)

    style: The docstring reference should use :meth:nvidia.dali.fn.equalize`` for consistency with DALI's documentation standards

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

  2. dali/python/nvidia/dali/plugin/numba/__init__.pyi, line 35 (link)

    logic: Return type annotation may be incorrect - setup_fn appears to return None but the signature suggests it takes parameters and returns None

    Should the setup_fn callable return type be None or should it return something else based on the actual implementation?

  3. dali/python/nvidia/dali/plugin/numba/fn/__init__.pyi, line 36 (link)

    syntax: The setup_fn parameter type annotation appears malformed - it has None as a return type in the callable signature but should likely return something or be Optional[Callable[...]] without the trailing None

  4. dali/operators/generic/resize/tensor_resize_cpu.cc, line 49-62 (link)

    style: The deprecated schema definition duplicates parent metadata (NumInput, NumOutput, SupportVolumetric, AllowSequences) that is already inherited from "TensorResize". Since AddParent("TensorResize") inherits all properties, these redundant specifications are unnecessary.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

  5. dali/test/python/checkpointing/test_dali_stateless_operators.py, line 643-646 (link)

    logic: inconsistent with other tests - this test only uses fn.audio_resample but the decorator includes both experimental and non-experimental versions

  6. dali/python/nvidia/dali/plugin/numba/__init__.py, line 187 (link)

    logic: Incorrect variable used: should be num_ins instead of num_outs for the input shapes calculation

25 files reviewed, 6 comments

Edit Code Review Agent Settings | Greptile

@szalpal szalpal marked this pull request as draft December 17, 2025 13:13
@szalpal
Copy link
Member Author

szalpal commented Dec 17, 2025

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [40376844]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [40376844]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [40349534]: BUILD FAILED

@szalpal
Copy link
Member Author

szalpal commented Dec 17, 2025

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [40397505]: BUILD STARTED

Signed-off-by: Michał Szołucha <[email protected]>
Signed-off-by: Michał Szołucha <[email protected]>
Signed-off-by: Michał Szołucha <[email protected]>
Signed-off-by: Michał Szołucha <[email protected]>
Signed-off-by: Michał Szołucha <[email protected]>
Signed-off-by: Michał Szołucha <[email protected]>
Signed-off-by: Michał Szołucha <[email protected]>
Signed-off-by: Michał Szołucha <[email protected]>
@szalpal
Copy link
Member Author

szalpal commented Jan 13, 2026

!build

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link

greptile-apps bot commented Jan 13, 2026

Additional Comments (1)

dali/operators/image/color/debayer.cc
documentation example still references fn.experimental.debayer - should be updated to fn.debayer to demonstrate the stable API

    debayered_sequences = fn.debayer(
      bayered_sequences.gpu(), blue_position=blue_positions, algorithm='default_npp')

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [41659598]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [41659598]: BUILD FAILED

@szalpal
Copy link
Member Author

szalpal commented Jan 14, 2026

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [41717403]: BUILD STARTED

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

29 files reviewed, 15 comments

Edit Code Review Agent Settings | Greptile

Signed-off-by: Michał Szołucha <[email protected]>
Signed-off-by: Michał Szołucha <[email protected]>
Signed-off-by: Michał Szołucha <[email protected]>
@szalpal
Copy link
Member Author

szalpal commented Jan 14, 2026

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [41719186]: BUILD STARTED

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Additional Comments (1)

  1. dali/operators/image/color/debayer.cc, line 51 (link)

    style: Example in documentation still uses experimental namespace and should be updated to use fn.debayer

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

29 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

in_types: List[DALIDataType],
outs_ndim: List[int],
ins_ndim: List[int],
setup_fn: Optional[Callable[[Sequence[Sequence[Any]], Sequence[Sequence[Any]], None]]] = None,
Copy link

Choose a reason for hiding this comment

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

logic: The setup_fn type annotation has an invalid callable signature with None as the third parameter type. Callable type parameters should only specify input argument types, not return types. Should be Optional[Callable[[Sequence[Sequence[Any]], Sequence[Sequence[Any]]], None]] if it returns None, or just Optional[Callable[[Sequence[Sequence[Any]], Sequence[Sequence[Any]]], Any]].

Suggested change
setup_fn: Optional[Callable[[Sequence[Sequence[Any]], Sequence[Sequence[Any]], None]]] = None,
setup_fn: Optional[Callable[[Sequence[Sequence[Any]], Sequence[Sequence[Any]]], None]] = None,

Comment on lines +187 to +188
in_shapes_np = _get_shape_view(in_shapes_ptr, in_ndims_ptr, num_outs, num_samples)
setup_fn(out_shapes_np, in_shapes_np)
Copy link

Choose a reason for hiding this comment

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

logic: Bug in parameter usage: should be num_ins instead of num_outs for input shapes.

Suggested change
in_shapes_np = _get_shape_view(in_shapes_ptr, in_ndims_ptr, num_outs, num_samples)
setup_fn(out_shapes_np, in_shapes_np)
in_shapes_np = _get_shape_view(in_shapes_ptr, in_ndims_ptr, num_ins, num_samples)
setup_fn(out_shapes_np, in_shapes_np)

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [41717403]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [41719186]: 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.

6 participants