Skip to content

Conversation

@xhmelon
Copy link
Contributor

@xhmelon xhmelon commented Sep 18, 2024

This PR adds a check for If nodes for ONNX frontend of Relay to skip the broadcast if the predicate is constant.
Sometimes PyTorch to ONNX inserts silly if nodes that produce dynamic ranks, and ONNX frontend of TVM would broadcast the lower dimensions between branches, which is irrational for some cases, e.g. 5×5×3×4 to 5×5×3×4×1. The predicate of silly if might be constant and reasonable to skip to avoid the broadcast problem.
This issue was captured in #16898 and #17050.

xhmelon and others added 10 commits April 18, 2023 16:40
VTA FSIM could not be built on macOS, for it leverages malloc.h and
memalign, yet both have been deprecated and are not provided by
macOS. This issue was captured in apache#13173.

This commit stops including malloc.h in VTA Runtime as stdlib.h has
provided functions we need.

This commit uses posix_memalign instead of memalign. It is a portable standard function.
This commit adds a check for If nodes for ONNX frontend of Relay
to skip the broadcast if the predicate is constant.
Sometimes PyTorch to ONNX inserts silly if nodes that produce dynamic
ranks, and ONNX frontend of TVM would broadcast the lower dimensions
between branches, which is irrational for some cases, e.g. 5×5×3×4 to
5×5×3×4×1. The predicate of silly if might be constant and reasonable
to skip to avoid the broadcast problem.
This issue was captured in apache#16898.
@shaoyuyoung
Copy link

cc @Hzfengsy

@Hzfengsy
Copy link
Member

Thanks @xhmelon for the contribution. As we are moving towards the Unity strategy with Relax, we may deprecate Relay in the future (ref). We encourage the community to move to Relax stack.

Meanwhile, this PR is self-contained, we can get this in

@Hzfengsy Hzfengsy merged commit 72d542e into apache:main Sep 22, 2024
@xhmelon xhmelon deleted the fix-onnx-if branch September 23, 2024 03:11
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