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

Enhance error messages in case of not supported data types in operators #2211

Merged
merged 8 commits into from
Aug 27, 2020

Conversation

jantonguirao
Copy link
Contributor

Why we need this PR?

Pick one, remove the rest

  • It improves error message in type switch

What happened in this PR?

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

  • What solution was applied:
    Added DALIDataType string conversion
    Adjusted every TYPE_SWITCH instance that was not printing the invalid type
  • Affected modules and functionalities:
    Several ops
  • Key points relevant for the review:
    Changes in the way we handle type names
  • Validation and testing:
    N/A
  • Documentation (including examples):
    N/A

JIRA TASK: [Use DALI-XXXX or NA]

Comment on lines 74 to 75
), DALI_FAIL(make_string("Unsupported output type: ", input.type().id()))) // NOLINT
), DALI_FAIL(make_string("Unsupported input type: ", output_type_))) // NOLINT
Copy link
Contributor

Choose a reason for hiding this comment

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

The error messages are reversed wrt to the value shown.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch

Copy link
Contributor

@klecki klecki left a comment

Choose a reason for hiding this comment

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

What is your opinion on unifying the "Invalid ... type " and "Unsupported .... type " in error messages?

@@ -223,7 +223,7 @@ void Reshape<Backend>::ShapeFromInput(const TensorListLike &tl, bool relative) {
(int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t),
(this->ShapeFromInput(view<const type>(tl));),
(DALI_FAIL(make_string(OpName(), ": shape input must have integral type; got: ",
tl.type().name(), " (id = ", static_cast<int>(tl.type().id()), ")"));)
tl.type().name(), " type: ", tl.type().id()));)
Copy link
Contributor

@mzient mzient Aug 25, 2020

Choose a reason for hiding this comment

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

I think that typeid is readily converted to a string, so this would print the name twice.

Suggested change
tl.type().name(), " type: ", tl.type().id()));)
tl.type().id()));)

@mzient
Copy link
Contributor

mzient commented Aug 25, 2020

What is your opinion on unifying the "Invalid ... type " and "Unsupported .... type " in error messages?

I think these are distinct concepts. E.g. using a floating point number for an index is invalid, whereas resizing uint32_t image is unsupported.

@jantonguirao
Copy link
Contributor Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1573075]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1573075]: BUILD FAILED

klecki
klecki previously approved these changes Aug 26, 2020
@klecki klecki dismissed their stale review August 26, 2020 12:13

Some more changes needed: remove internal id from known types, differentiate better between no type set, invalid type and valid run-time registered type.

Signed-off-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Joaquin Anton <janton@nvidia.com>
@jantonguirao
Copy link
Contributor Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1574232]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1574232]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1574232]: BUILD PASSED

@jantonguirao jantonguirao merged commit 79e73da into NVIDIA:master Aug 27, 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.

5 participants