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

Use true scalars + bug fixes #2318

Merged
merged 13 commits into from
Oct 4, 2020
Merged

Use true scalars + bug fixes #2318

merged 13 commits into from
Oct 4, 2020

Conversation

mzient
Copy link
Contributor

@mzient mzient commented Oct 1, 2020

Fix usage of scalars - convert from {1} tensors to {}.
Fix a bug in executor - attempting to execute subsequent ops in the same stage after a failure.
Fix a bug in CocoReader - remove erroneuous assertion.

Classification readers are left out - changing the labels from 1-element tensors to scalars has merit, but I think we might have gone a bit too far there to change it now.

Signed-off-by: Michał Zientkiewicz mzient@gmail.com

Why we need this PR?

Pick one, remove the rest

  • It fixes bugs:
    • in executor - attempting to execute subsequent ops in the same stage after a failure.
    • in CocoReader - remove erroneuous assertion.
  • Refactoring to improve handling of scalar values
    • allow 0D data as scalar argument inputs
    • random generators produce true scalars
    • arithmetic operators accept and produce true scalars
    • audio decoder produces sampling rate as a true scalar

What happened in this PR?

Fill relevant points, put NA otherwise. Replace anything inside []

  • What solution was applied:
    • Changed some tensors to 0D
    • Adjust tests
    • Changed the condition in OpSpec to accept 0D
  • Affected modules and functionalities:
    • OpSpec
    • ArithmOps
    • AudioDecoder
    • Random number generating ops (all of them)
  • Key points relevant for the review:
    • N/A
  • Validation and testing:
    • Existing tests apply
  • Documentation (including examples):
    • Updated, where applicable

JIRA TASK: N/A

@mzient mzient requested a review from a team October 1, 2020 19:49
@mzient
Copy link
Contributor Author

mzient commented Oct 1, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1670444]: BUILD STARTED

@mzient mzient changed the title Use true scalars + bug fixes [WIP] Use true scalars + bug fixes Oct 1, 2020
@mzient mzient requested a review from JanuszL October 1, 2020 22:40
@mzient
Copy link
Contributor Author

mzient commented Oct 1, 2020

!build

@mzient mzient changed the title [WIP] Use true scalars + bug fixes Use true scalars + bug fixes Oct 1, 2020
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Oct 1, 2020

This pull request introduces 1 alert when merging 96cd43bf5da7c7fb4e665bf9510e9677b6b9a9c0 into 343fa80 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1671179]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1671179]: BUILD FAILED

@JanuszL
Copy link
Contributor

JanuszL commented Oct 2, 2020

Please fix LGTM allert.

@@ -349,6 +351,7 @@ def ConstantNode(device, value, dtype, shape, layout, **kwargs):
def _type_from_value_or_list(v):
if not isinstance(v, (list, tuple)):
v = [v]
shape = []
Copy link
Contributor

Choose a reason for hiding this comment

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

Nor used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used in line 403. This was actually a necessary fix.

Copy link
Contributor

Choose a reason for hiding this comment

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

Correct me if I'm wrong, but this is the scope of _type_from_value_or_list function and you are not changing the value of the shape variable from the outer scope.

@mzient
Copy link
Contributor Author

mzient commented Oct 2, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1672075]: BUILD STARTED

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Oct 2, 2020

This pull request introduces 1 alert when merging 55f710ee75c5c54ba5c987685a5317203fb4607d into 343fa80 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

@mzient
Copy link
Contributor Author

mzient commented Oct 2, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1672109]: BUILD STARTED

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Oct 2, 2020

This pull request introduces 1 alert when merging 6cecd8bfc3761380a7dca3e6078b9e0a23f64993 into 343fa80 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

@mzient
Copy link
Contributor Author

mzient commented Oct 2, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1672239]: BUILD STARTED

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Oct 2, 2020

This pull request introduces 1 alert when merging 99a7e0d36f347e42524e52e0704a066859a4b535 into 343fa80 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

@mzient
Copy link
Contributor Author

mzient commented Oct 2, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1672299]: BUILD STARTED

@mzient
Copy link
Contributor Author

mzient commented Oct 2, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1672664]: BUILD STARTED

@mzient
Copy link
Contributor Author

mzient commented Oct 2, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1672664]: BUILD FAILED

@mzient
Copy link
Contributor Author

mzient commented Oct 2, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1673153]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1673210]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1673210]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1672299]: BUILD FAILED

mzient and others added 12 commits October 3, 2020 17:00
Fix a bug in executor - attempting to execute subsequent ops in the same stage after a failure.
Fix a bug in CocoReader - remove erroneuous assertion.

Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Allow scalars in slice boundaries.
Fix some tests.

Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Fix CopyWithStrides.
Adjust more tests.

Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Allow scalars in slice boundaries.
Fix some tests.

Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Update scalar shape in arithmetic expression tutorial.

Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
@mzient
Copy link
Contributor Author

mzient commented Oct 3, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1674628]: BUILD STARTED

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Oct 3, 2020

This pull request introduces 1 alert when merging 3ad913037b8877bace307f456e0ee7d513d91edd into ec53d42 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1674628]: BUILD PASSED

@mzient mzient merged commit f864de1 into NVIDIA:master Oct 4, 2020
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

4 participants