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

[ETHOSN] Apply FoldConstant before NPU partitioning #13848

Merged
merged 1 commit into from
Jan 27, 2023

Conversation

ashutosh-arm
Copy link
Contributor

Introduced FoldConstant before NPU partitioning. Added a qnn.add test where both inputs are constants. Updated the number of operators remaining in the host code for ssd_mobilenet_v1 as the FoldConstant reduces the number of operators.

cc @lhutton1

Introduced FoldConstant before NPU partitioning.
Added a qnn.add test where both inputs are constants.
Updated the number of operators remaining in the host code
for ssd_mobilenet_v1 as the FoldConstant reduces the number
of operators.

Change-Id: I618c4a1b207b398106f6842322102cf94276e524
@tvm-bot
Copy link
Collaborator

tvm-bot commented Jan 26, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@github-actions github-actions bot requested a review from lhutton1 January 26, 2023 17:41
Copy link
Contributor

@lhutton1 lhutton1 left a comment

Choose a reason for hiding this comment

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

Thanks @ashutosh-arm LGTM!

@@ -218,6 +218,6 @@ def test_ssd_mobilenet_v1():
input_dict={"normalized_input_image_tensor": (1, 300, 300, 3)},
compile_hash=_compile_hash,
output_count=4,
host_ops=26,
host_ops=14,
Copy link
Contributor

Choose a reason for hiding this comment

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

😱

else:
a = relay.var("a", shape=lhs_shape, dtype=dtype)

if rhs_is_constant:
b_data = np.array(constant_data, dtype=dtype).reshape(rhs_shape)
np.random.randint(data_min, data_max + 1, size=rhs_shape, dtype=dtype)
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing this - looks much better!

@lhutton1 lhutton1 merged commit 16b1958 into apache:main Jan 27, 2023
@lhutton1
Copy link
Contributor

Thanks @ashutosh-arm!

fzi-peccia pushed a commit to fzi-peccia/tvm that referenced this pull request Mar 27, 2023
Introduced FoldConstant before NPU partitioning.
Added a qnn.add test where both inputs are constants.
Updated the number of operators remaining in the host code
for ssd_mobilenet_v1 as the FoldConstant reduces the number
of operators.
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.

3 participants