-
Notifications
You must be signed in to change notification settings - Fork 655
Generate dynamic mode documentation #6085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Greptile OverviewGreptile SummaryThis PR adds comprehensive documentation for DALI Dynamic Mode, including API references, operator listings, and data reader documentation. The implementation properly extends the existing documentation generation infrastructure to support the dynamic API alongside the traditional fn API. Key changes:
The documentation organization is logical and consistent with existing DALI docs. All links use proper Sphinx cross-references. The code properly handles the distinction between function-based operators (using Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Sphinx as Sphinx Build
participant conf.py as conf.py
participant ops_table as operations_table.py
participant autodoc as autodoc_submodules.py
participant fs as File System
Sphinx->>conf.py: Initialize documentation build
conf.py->>fs: Create docs/dali_dynamic/operations/ directory
conf.py->>ops_table: operations_table(dynamic_table, module="nvidia.dali.experimental.dynamic")
ops_table->>ops_table: Detect api_name="dynamic" from module
ops_table->>ops_table: Generate table for dynamic operators
ops_table->>fs: Write dynamic_table
conf.py->>ops_table: dynamic_readers_table(dynamic_readers_table)
ops_table->>ops_table: Filter readers from dynamic ops
ops_table->>ops_table: Generate readers table
ops_table->>fs: Write dynamic_readers_table
conf.py->>autodoc: dynamic_autodoc(dynamic_autodoc, paths, references)
autodoc->>autodoc: get_modules(dynamic_modules)
autodoc->>autodoc: Filter functions with schema attribute
autodoc->>autodoc: write_module_file() for each module
autodoc->>autodoc: write_function_files(single_fun_file) for operators
autodoc->>fs: Write dynamic_autodoc and operator RST files
conf.py->>autodoc: dynamic_readers_autodoc(dynamic_readers_autodoc, paths, references)
autodoc->>autodoc: Filter modules with "readers"
autodoc->>autodoc: Filter classes subclassing Reader
autodoc->>autodoc: write_module_file() for each module
autodoc->>autodoc: write_function_files(single_class_op_file) for readers
autodoc->>fs: Write dynamic_readers_autodoc and reader RST files
Sphinx->>fs: Read generated RST files
Sphinx->>Sphinx: Render documentation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, 1 comment
Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format
| DALI Dynamic does not replace the graph-based execution model. Instead, it provides | ||
| an alternative interface for a seamless Python experience. Prototyping and development | ||
| can be performed in DALI Dynamic using exactly the same operators as a pipeline mode | ||
| and transition between the two modes is straightforward. No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: missing newline at end of file
|
Nitpick: This would be nice occurrences of |
| not submodule_path | ||
| or (submodule_path[0] not in ["ops"] and "readers" not in submodule_path) | ||
| ) | ||
| ): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
):
The if condition is pretty big, and ideas on how to make it a tad more readable? Should we just split it to more conditions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split, hope it's still equivalent :P
| Key features include: | ||
|
|
||
| - **Imperative programming with lazy execution** | ||
| In the original DALI execution model, operators were defined and executed within a static | ||
| pipeline graph. This often resulted in a steep learning curve, complex debugging, and | ||
| limited error visibility. DALI Dynamic introduces imperative programming with lazy operator | ||
| execution, aligning DALI more closely with standard Python workflows. | ||
|
|
||
| - **Minimal performance overhead** | ||
| DALI Dynamic is designed to deliver performance that is close to graph-based pipelines, incurring | ||
| only marginal overhead. | ||
|
|
||
| - **Batch processing support** | ||
| Batch processing remains a core concept in DALI. DALI Dynamic preserves this functionality and | ||
| introduces a dedicated API for batch-oriented workflows. | ||
|
|
||
| - **Framework interoperability** | ||
| DALI Dynamic provides type conversion support for major deep learning frameworks, including | ||
| PyTorch, CuPy, JAX, and Numba. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should maybe make the intro contain the code sample, rather than the key features? Or maybe just keep all of the introduction at the top page without repeat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced with sample, good point
| elif hasattr(obj, "schema"): | ||
| return obj.schema.Name() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yet another way of accessing the schema?
Sidenote, if ndd operators have a public schema member, maybe they shouldn't.
| return result | ||
|
|
||
|
|
||
| def single_class_op_file(full_name, references): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we plan to have any other classes than readers? If yes, I'm starting to spin the crank on our ski jumping hero.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Random ops, I guess
docs/autodoc_submodules.py
Outdated
| f.write(all_modules_str) | ||
|
|
||
|
|
||
| def dynamic_autodoc(out_filename, generated_path, references): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is almost a copy of fn_autodoc. Same for dynamic_readers_autodoc. Can we generalize.
Maybe we can take out the filtering of what to document to the higher scope or make it a function, and the rest is the same - loop over filtered members -> generate doc -> write to a file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored. Thanks!
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
16 files reviewed, 1 comment
| DALI Dynamic does not replace the graph-based execution model. Instead, it provides | ||
| an alternative interface for a seamless Python experience. Prototyping and development | ||
| can be performed in DALI Dynamic using exactly the same operators as a pipeline mode | ||
| and transition between the two modes is straightforward. No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: missing newline at end of file
| and transition between the two modes is straightforward. | |
| and transition between the two modes is straightforward. | |
Signed-off-by: Szymon Karpiński <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
16 files reviewed, no comments
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
Signed-off-by: Szymon Karpiński <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
15 files reviewed, no comments
|
!build |
|
CI MESSAGE: [39073360]: BUILD STARTED |
|
CI MESSAGE: [39073360]: BUILD PASSED |
Generate documentation section for the Dynamic Mode. Signed-off-by: Szymon Karpiński <[email protected]>
Category:
Other (e.g. Documentation, Tests, Configuration)
Description:
New content
Batch,Tensor,EvalContextand related functions.Internal changes
autodoc_submodules.pyhas been extended withdynamic_autodocanddynamic_readers_autodoc, generating autodoc stubs for dynamic mode operators.operations_table.pyhas been generalized, to be able to generate tables for dynamic ops & readers. Some functions now get additionalapi_nameargument instead of hardcoding"fn".Other changes
Additional information:
Affected modules and functionalities:
Key points relevant for the review:
fndocs still look good? (the code is shared)Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: DALI-4446