Add is_floating_point() test and better type support in verify_model_vm()#7134
Merged
masahi merged 7 commits intoapache:mainfrom Dec 22, 2020
Merged
Add is_floating_point() test and better type support in verify_model_vm()#7134masahi merged 7 commits intoapache:mainfrom
is_floating_point() test and better type support in verify_model_vm()#7134masahi merged 7 commits intoapache:mainfrom
Conversation
masahi
reviewed
Dec 19, 2020
| verify_model_vm(script_module, ishapes, idtype=idtype, targets=targets) | ||
| else: | ||
| verify_model_vm(script_module, ishapes, targets=targets) | ||
|
|
Member
There was a problem hiding this comment.
I don't think you need this if/else, just verify_model_vm(script_module, ishapes, idtype=idtype, targets=targets) even if idtype is None should work.
Contributor
Author
There was a problem hiding this comment.
Done. I've cleaned up verify_script_model() and changed the handling of default arguments in verify_model_vm() so that passing in None will result in a torch.float being used. Let me know if the new approach looks good.
masahi
approved these changes
Dec 22, 2020
Member
|
Thanks @TylerADavis |
masahi
pushed a commit
to masahi/tvm
that referenced
this pull request
Dec 24, 2020
…el_vm()` (apache#7134) * Add div_ and is_floating_point operators * Add handling of exprs to op, update tests * add test + supporting functions * Revert whitespace changes * Properly assign dtype to random integers * Reformat with black * Switched default dtype logic, removed extra line
tkonolige
pushed a commit
to tkonolige/incubator-tvm
that referenced
this pull request
Jan 11, 2021
…el_vm()` (apache#7134) * Add div_ and is_floating_point operators * Add handling of exprs to op, update tests * add test + supporting functions * Revert whitespace changes * Properly assign dtype to random integers * Reformat with black * Switched default dtype logic, removed extra line
TusharKanekiDey
pushed a commit
to TusharKanekiDey/tvm
that referenced
this pull request
Jan 20, 2021
…el_vm()` (apache#7134) * Add div_ and is_floating_point operators * Add handling of exprs to op, update tests * add test + supporting functions * Revert whitespace changes * Properly assign dtype to random integers * Reformat with black * Switched default dtype logic, removed extra line
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Jan 21, 2021
…el_vm()` (apache#7134) * Add div_ and is_floating_point operators * Add handling of exprs to op, update tests * add test + supporting functions * Revert whitespace changes * Properly assign dtype to random integers * Reformat with black * Switched default dtype logic, removed extra line
electriclilies
pushed a commit
to electriclilies/tvm
that referenced
this pull request
Feb 18, 2021
…el_vm()` (apache#7134) * Add div_ and is_floating_point operators * Add handling of exprs to op, update tests * add test + supporting functions * Revert whitespace changes * Properly assign dtype to random integers * Reformat with black * Switched default dtype logic, removed extra line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR builds upon #7128 , adding a test for
is_floating_point()following masahi's recommendation to look atverify_script_model().In addition to the test, this PR makes the following changes:
verify_script_model()can now pass a dtype toverify_model_vm()verify_model_vm()can now generate random inputs for bool and int dtypes.verify_model_vm()includes TVM dtype information ininput_shapes, providing additional type information to operators such asis_floating_point().These additional changes were made because
verify_model_vm()does not currently pass type information torelay.frontend.from_pytorch(), preventingis_floating_point()from working correctly. The changes to random tensor generation were required astorch.randn()does not support bool or int dtypes, and my test requires inputs with these dtypes.If it would be helpful, I can split the addition of the test and the changes to testing infrastructure out into two separate PRs.