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

Change the default order of data storage objects #4276

Merged
merged 9 commits into from
Oct 12, 2022

Conversation

mzient
Copy link
Contributor

@mzient mzient commented Sep 22, 2022

Signed-off-by: Michal Zientkiewicz michalz@nvidia.com

Category: Refactoring, Bug fix?

Description:

Change the default order for data storage objects to host - regardless if they contain any data or not.

Additional information:

Affected modules and functionalities:

Key points relevant for the review:

Tests:

  • Existing tests apply
    The performance in RN50 and retina was validated.
  • 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: N/A

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [5983215]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [5983215]: BUILD PASSED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6011132]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6012006]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6012006]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6012651]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6011132]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6012651]: BUILD FAILED

mzient and others added 7 commits October 5, 2022 17:28
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
@klecki
Copy link
Contributor

klecki commented Oct 5, 2022

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6097411]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6097411]: BUILD PASSED

@klecki klecki marked this pull request as ready for review October 6, 2022 09:22
@klecki klecki changed the title [Experiment] Change the default order for non-empty tensors. Change the default order for non-empty tensors. Oct 6, 2022
@mzient mzient changed the title Change the default order for non-empty tensors. Change the default order of data storage objects. Oct 6, 2022
@@ -463,6 +463,8 @@ const TensorListShape<> &TensorList<Backend>::shape() const & {

template <typename Backend>
void TensorList<Backend>::set_order(AccessOrder order, bool synchronize) {
if (!order)
Copy link
Member

Choose a reason for hiding this comment

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

So you cannot nullify the order of the tensor list?

Copy link
Contributor

Choose a reason for hiding this comment

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

I also have my reservations about it, but maybe it's similar to setting DALI_NO_TYPE for a type. Another thing is, we do an explicit error there, and silently do nothing here.

Copy link
Member

Choose a reason for hiding this comment

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

And.. what do we need AccessOrder::null_stream() for?

Copy link
Member

Choose a reason for hiding this comment

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

And.. should the warp.h use context.gpu.stream = ws.has_stream() ? ws.stream() : AccessOrder::null_stream(); or rather host_stream?

Copy link
Member

@stiepan stiepan Oct 6, 2022

Choose a reason for hiding this comment

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

Hm, okay, {} results in a nullstream too, so there are more places like that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I added a restriction that disallows setting the empty order to TensorList and Buffer, and allowed it to mean no-op in the APIs where it was used that way (so it can be an optional argument). For the null_stream, I think it is invalid, and if used I guess we will get an error?

Add a bit of docstring and a CPU-only test used for debugging

Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
@klecki
Copy link
Contributor

klecki commented Oct 12, 2022

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6157450]: BUILD STARTED

@klecki
Copy link
Contributor

klecki commented Oct 12, 2022

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6157782]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6157782]: BUILD FAILED

Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
@klecki
Copy link
Contributor

klecki commented Oct 12, 2022

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6158427]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6158427]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6158427]: BUILD PASSED

@klecki klecki changed the title Change the default order of data storage objects. Change the default order of data storage objects Oct 12, 2022
@klecki klecki merged commit ba1c87a into NVIDIA:main Oct 12, 2022
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.

None yet

5 participants