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

[TF-TRT] Argument bugfix #50015

Merged
merged 2 commits into from
Jun 9, 2021
Merged

[TF-TRT] Argument bugfix #50015

merged 2 commits into from
Jun 9, 2021

Conversation

ProtossDragoon
Copy link
Contributor

TF-TRT supports lowercase arguments.

class TrtPrecisionMode(object):
FP32 = "FP32"
FP16 = "FP16"
INT8 = "INT8"
@staticmethod
def supported_precision_modes():
precisions = [
TrtPrecisionMode.FP32, TrtPrecisionMode.FP16, TrtPrecisionMode.INT8
]
return precisions + [p.lower() for p in precisions]

From official documentation API instruction,
https://docs.nvidia.com/deeplearning/frameworks/tf-trt-user-guide/index.html#int8-quantization


precision_mode
Default value is TrtPrecisionMode.FP32. This is one of TrtPrecisionMode.supported_precision_modes(), in other words, FP32, FP16 or INT8 (lowercase is also supported).

But INT8 calibration with precision_mode='int8' didn't work before.

@google-ml-butler google-ml-butler bot added the size:S CL Change Size: Small label Jun 3, 2021
@google-cla
Copy link

google-cla bot commented Jun 3, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Jun 3, 2021
@ProtossDragoon
Copy link
Contributor Author

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.

What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot I signed it!

@google-cla google-cla bot added cla: yes and removed cla: no labels Jun 3, 2021
@rthadur rthadur requested a review from bixia1 June 3, 2021 21:15
@rthadur rthadur self-assigned this Jun 3, 2021
@rthadur rthadur added this to Assigned Reviewer in PR Queue via automation Jun 3, 2021
Copy link
Contributor

@bixia1 bixia1 left a comment

Choose a reason for hiding this comment

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

Thanks for adding this! A better fix would be to first normalize the string to upper cases and then construct the conversion_params. But I am approving this and we will clean up this later.

PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Jun 3, 2021
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Jun 3, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Jun 3, 2021
@bixia1 bixia1 added the comp:gpu:tensorrt Issues specific to TensorRT label Jun 9, 2021
@copybara-service copybara-service bot merged commit 0d67c5c into tensorflow:master Jun 9, 2021
PR Queue automation moved this from Approved by Reviewer to Merged Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes comp:gpu:tensorrt Issues specific to TensorRT ready to pull PR ready for merge process size:S CL Change Size: Small
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

4 participants