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 support for UINT8 and INT8 outputs in CMN + scale and shift arguments #2458

Merged
merged 3 commits into from Nov 13, 2020

Conversation

mzient
Copy link
Contributor

@mzient mzient commented Nov 12, 2020

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

Why we need this PR?

Pick one, remove the rest

  • It adds new feature needed for inference in quantized networks(?)

What happened in this PR?

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

  • What solution was applied:
    • Added u8/i8 to supported type list
    • Added scale and shift arguments and preprocessing of mean and stddev.
    • Extended tests to support scale and shift arguments as well as the new types
    • Reduced the number of tested argument combinations
  • Affected modules and functionalities:
    • CropMirrorNormalize
  • Key points relevant for the review:
    • N/A
  • Validation and testing:
    • Python tests
  • Documentation (including examples):
    • For the new arguments

JIRA TASK: N/A

…ents.

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

mzient commented Nov 12, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1793821]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1793821]: BUILD PASSED

@JanuszL
Copy link
Contributor

JanuszL commented Nov 12, 2020

In test_operator_crop_mirror_normalize.py:test_cmn_vs_numpy you can provide more types than just FLOAT. The only thing left there is to add type conversion in crop_mirror_normalize_func, but should not be that difficult.

@mzient
Copy link
Contributor Author

mzient commented Nov 13, 2020

In test_operator_crop_mirror_normalize.py:test_cmn_vs_numpy you can provide more types than just FLOAT. The only thing left there is to add type conversion in crop_mirror_normalize_func, but should not be that difficult.

I'll need to cut reduce the number of tests elsewhere - it's already taking very long.

Reduce number of tests for CMN by randomly selecting paramters that don't need full combination sweep.

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

mzient commented Nov 13, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1796073]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1796073]: BUILD PASSED

@@ -58,6 +58,14 @@ If not set, the input type is used.)code", DALI_FLOAT)
.AddOptionalArg("std",
R"code(Standard deviation values for image normalization.)code",
std::vector<float>{1.0f})
.AddOptionalArg("scale", R"(The value by which the result is multiplied.

This argument is useful when using integer outputs to improve dynamic range utiliztion.)",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This argument is useful when using integer outputs to improve dynamic range utiliztion.)",
This argument is useful when using integer outputs to improve dynamic range utilization.)",

1.0f)
.AddOptionalArg("shift", R"(The value added to the (scaled) result.

This argument is useful when using unsigned integer outputs to improve dynamic range utiliztion.)",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This argument is useful when using unsigned integer outputs to improve dynamic range utiliztion.)",
This argument is useful when using unsigned integer outputs to improve dynamic range utilization.)",

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

mzient commented Nov 13, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1796429]: BUILD STARTED

@mzient mzient merged commit 037b03b into NVIDIA:master Nov 13, 2020
@mzient mzient deleted the CMN_int8 branch November 13, 2020 13:46
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