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

Update auto_mixed_precision_model_path.py #217

Merged
merged 3 commits into from
Jun 13, 2022
Merged

Conversation

xiaowuhu
Copy link
Collaborator

Signed-off-by: xiaowuhu [email protected]

Improve some logic to not let user confuse.

  1. both rtol and valudate_func could be None, then we will use default value.
  2. use atol to do validation if user pass it in.

Signed-off-by: xiaowuhu <[email protected]>

Improve some logic to not let user confuse.
1) both rtol and valudate_func could be None, then we will use default value.
2) use atol to do validation if user pass it in.
@@ -39,6 +39,9 @@ def validate(res1, res2):
1. keep_io_types=True, so the test_data can be used for both fp32 and fp16 models during the convertion.
2. about the 'provider', when you want to inference on CPU machine, you must set it to ['CPUExecutionProvider'],
when you want to do inference on GPU machine, set to ['CUDAExecutionProvider'].
3. the default value of rtol will be 1e-3 if it is None.

Choose a reason for hiding this comment

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

Just realized all these 5 notes are explaining the parameters of auto_convert_mixed_precision_model_path() function. Could we move them into the comments of this function, so users know its usage specifically? Just like another function convert_float_to_float16.

In addition, we can add comments for other parameters of this function as well.

xiaowuhu added 2 commits June 13, 2022 13:34
Signed-off-by: xiaowuhu <[email protected]>

refine the comment for this function, especially the parameters description.
Signed-off-by: xiaowuhu <[email protected]>

fix the flake8 check errors.
Copy link

@fatcat-z fatcat-z left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@xiaowuhu xiaowuhu merged commit 2ea2e31 into master Jun 13, 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.

2 participants