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

[Topi][Hexagon] Implement Cast F32ToF16 and F16ToF32 Slice Op #11561

Merged
merged 23 commits into from
Jul 12, 2022

Conversation

arangasa
Copy link
Contributor

@arangasa arangasa commented Jun 3, 2022

Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.

cc @mehrdadh

@arangasa
Copy link
Contributor Author

arangasa commented Jun 3, 2022

cc @mehrdadh
Thank you

@github-actions github-actions bot requested a review from mehrdadh June 15, 2022 11:43


if __name__ == "__main__":
sys.exit(pytest.main(sys.argv))
Copy link
Member

Choose a reason for hiding this comment

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

don't need to send a commit for this, but if you have updated the PR please change this to tvm.testing.main()

@mehrdadh
Copy link
Member

mehrdadh commented Jun 17, 2022

cc @Lunderberg @cconvey @csullivan for review

Copy link
Contributor

@Lunderberg Lunderberg left a comment

Choose a reason for hiding this comment

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

One small change that should be made before merging, and a question on future use of get_layout_transform_fn, but otherwise LGTM

@@ -49,4 +64,10 @@ def get_layout_transform_fn(layout):
return n11c_1024c_2d
if layout == "n11c-1024c-1d":
return n11c_1024c_1d
if layout == "nhwc-4h2w32c2w-2d":
Copy link
Contributor

Choose a reason for hiding this comment

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

In the future, is this function intended to remain a mapping from string to layout function, or will it have more dynamic behavior? If the former, then it may be useful to define a dictionary instead, since that would allow tests to be parametrized over each layout.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Eric @Lunderberg , Thank you for your time and helpful inputs. I think for now we are sticking to pre-defined layouts. But we don't want the tests to be parameterized over each layout since the tests wouldn't support each one of them.



if __name__ == "__main__":
sys.exit(tvm.testing.main(sys.argv))
Copy link
Contributor

Choose a reason for hiding this comment

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

tvm.testing.main takes no arguments and internally calls sys.exit, so this like should instead be tvm.testing.main()

@@ -194,4 +194,4 @@ def test_cast_fp32_fp16_slice(


if __name__ == "__main__":
sys.exit(tvm.testing.main(sys.argv))
sys.exit(tvm.testing.main())
Copy link
Contributor

@Lunderberg Lunderberg Jun 27, 2022

Choose a reason for hiding this comment

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

Small nitpick, the sys.exit can be removed as well.

if __name__ == "__main__":
    tvm.testing.main()

@driazati
Copy link
Member

@tvm-bot rerun

import tvm.topi.hexagon.slice_ops as sl
from ..infrastructure import allocate_hexagon_array, transform_numpy

# pylint: disable=invalid-name
Copy link
Member

@mehrdadh mehrdadh Jun 27, 2022

Choose a reason for hiding this comment

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

I think you don't need this here. Please remove it and fix if any lint issue exists
.

from tvm import tir
from ..utils import get_layout_transform_fn

# pylint: disable=invalid-name
Copy link
Member

Choose a reason for hiding this comment

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

same here.

@arangasa
Copy link
Contributor Author

arangasa commented Jul 6, 2022

Hi @mehrdadh @Lunderberg , could you please check if the changes are OK? Thank you.

@arangasa
Copy link
Contributor Author

Hi @mehrdadh @Lunderberg could you please check if the changes are OK? Thank you.

@mehrdadh
Copy link
Member

LGTM! I'll wait for @Lunderberg to approve and merge it.

@csullivan csullivan merged commit 6536def into apache:main Jul 12, 2022
@csullivan
Copy link
Contributor

Many thanks @arangasa @mehrdadh @Lunderberg!

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.

5 participants