Skip to content
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

Add per-frame operator #3723

Merged
merged 4 commits into from
Apr 8, 2022
Merged

Add per-frame operator #3723

merged 4 commits into from
Apr 8, 2022

Conversation

stiepan
Copy link
Member

@stiepan stiepan commented Mar 7, 2022

Category:

New feature (non-breaking change which adds functionality)

Description:

  • Adds new operator: per-frame that sets the input tensor a sequence-like layout. It is meant to be used with sequence processing operators to handle per-frame arguments.
  • The operators description presents brief example on specifying per-frame argument.
  • Modifies docs generation, so that the documentation of per-frame supporting arguments links to the per_frame operator.

Additional information:

Affected modules and functionalities:

Key points relevant for the review:

The operator is CPU only for the same reason the fn.transofrms are - it is supposed to be used only on arguments to other operators.

Checklist

Tests

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

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: PERFR.01-PERFR.05

JIRA TASK: DALI-2566

@stiepan
Copy link
Member Author

stiepan commented Mar 7, 2022

!build

@stiepan stiepan marked this pull request as ready for review March 7, 2022 20:45
@jantonguirao jantonguirao self-assigned this Mar 8, 2022
Comment on lines 297 to 300
DLL_PUBLIC inline OpSchema& SupportPerFrameArgs() {
support_per_frame_ = true;
return *this;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think what we might need fine grain control of which exact argument makes sense to be provided per frame.

Copy link
Contributor

Choose a reason for hiding this comment

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

This should be inferred from argument descriptions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Interesting idea; but is such info needed at all if we decided to mark arguments and mention per-frame support in their descriptions?

@stiepan stiepan marked this pull request as draft March 10, 2022 14:07
@stiepan stiepan marked this pull request as ready for review March 10, 2022 19:21
@@ -130,6 +130,8 @@ def _get_kwargs(schema):
default_value = ast.literal_eval(default_value_string)
type_name += ", default = `{}`".format(_default_converter(dtype, default_value))
doc += schema.GetArgumentDox(arg)
if schema.ArgSupportsPerFrameInput(arg):
Copy link
Contributor

Choose a reason for hiding this comment

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

This requires the other PR to work, doesn't it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it needs to be rebased.

Copy link
Member Author

Choose a reason for hiding this comment

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

Just wanted to have it ready here so that it could be read, reviewed and discussed if needed.

@klecki
Copy link
Contributor

klecki commented Mar 30, 2022

Unless something significantly changes, I can review this instead of @prak-nv, but for now it is already approved. Add me if you need me.

@klecki klecki removed their assignment Mar 30, 2022
@JanuszL JanuszL mentioned this pull request Mar 30, 2022
Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
… sequneces need to have matching shapes

Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
@stiepan
Copy link
Member Author

stiepan commented Apr 7, 2022

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [4455657]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [4455657]: BUILD PASSED

Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
@stiepan
Copy link
Member Author

stiepan commented Apr 8, 2022

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [4462185]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [4462185]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [4462185]: BUILD PASSED

@stiepan stiepan merged commit ed93d0a into NVIDIA:main Apr 8, 2022
cyyever pushed a commit to cyyever/DALI that referenced this pull request May 13, 2022
* Add per-frame operator
* Use per-frame operator in sequence operator tests
* Link to per-frame operator docs from arguments supporting per-frame input

Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jun 7, 2022
* Add per-frame operator
* Use per-frame operator in sequence operator tests
* Link to per-frame operator docs from arguments supporting per-frame input

Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
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