Skip to content

[Contrib] Support fp16 input in cpu sort#8672

Merged
comaniac merged 5 commits intoapache:mainfrom
masahi:cpp-sort-fp16
Aug 7, 2021
Merged

[Contrib] Support fp16 input in cpu sort#8672
comaniac merged 5 commits intoapache:mainfrom
masahi:cpp-sort-fp16

Conversation

@masahi
Copy link
Copy Markdown
Member

@masahi masahi commented Aug 6, 2021

A solution for the issue discussed in #8296 (comment)

With this change, PT Faster RCNN can be converted to fp16. Converting MaskRCNN requires support for ADT (tensor array) in the mixed precision pass.

@comaniac @AndrewZhaoLuo

Comment thread src/runtime/contrib/sort/sort.cc
Copy link
Copy Markdown
Contributor

@comaniac comaniac left a comment

Choose a reason for hiding this comment

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

LGTM. Just a nit.

Comment thread src/runtime/contrib/sort/sort.cc
def test_sort():
def verify_sort(shape, axis, is_ascend, is_dyn=False):

def verify_sort(shape, axis, is_ascend, is_dyn=False, in_dtype="float32"):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We could also do a small refactoring for this file:

  • Use @pytest.mark.parametrize("in_dtype", ["float32", "float16"]) in each unit test.
  • Let pytest collect tests in the main function:
if __name__ == "__main__":
    pytest.main([__file__])

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Wouldn't that make the testing time double? This file is fairly slow to test (more than 3 min according to https://ci.tlcpack.ai/job/tvm/job/main/1384/testReport/ctypes.tests.python.relay/test_op_level6/) and I don't think fp16 tests need to run as often as fp32.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm that's a fair concern.

@comaniac comaniac merged commit d4d4e89 into apache:main Aug 7, 2021
@comaniac
Copy link
Copy Markdown
Contributor

comaniac commented Aug 7, 2021

Thanks @masahi

mehrdadh pushed a commit to mehrdadh/tvm that referenced this pull request Aug 11, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 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