Skip to content

Conversation

@lhutton1
Copy link
Contributor

This commit:

  • Adds specialized arm_cpu pooling schedules for both fixed width and salable vectors.
  • Enables topi testing of new arm_cpu schedules.

cc @neildhickey @ekalda @FranklandJack

@tvm-bot
Copy link
Collaborator

tvm-bot commented Jul 13, 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.

  • No users to tag found in teams: topi See #10317 for details

Generated by tvm-bot

@github-actions github-actions bot requested a review from ekalda July 13, 2023 09:02
@lhutton1 lhutton1 marked this pull request as ready for review July 14, 2023 08:31
@lhutton1
Copy link
Contributor Author

This is the same commit as in #14855 (credit to @FranklandJack). It was reverted by #15286, although, after efforts to reproduce the failure mentioned in the PR, I've not been successful. In addition, the patch is rebased and passing CI. Happy to try to correct the import issue if there is a reproducer (cc @junrushao)

Copy link
Contributor

@leandron leandron left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @lhutton1!

Leaving this open so that others have opportunity to comment.

This commit:
* Adds specialized `arm_cpu` pooling schedules for both fixed width and
  salable vectors.
* Enables topi testing of new `arm_cpu` schedules.

Co-authored-by: Jack Frankland <[email protected]>
Change-Id: Ib07fb438ba9ee8ab92fc5bfc438479959411e7db
@lhutton1 lhutton1 force-pushed the pool-2d-sched branch 3 times, most recently from 2554420 to 776648e Compare July 18, 2023 21:16
Change-Id: I7e4af0fd7aa8c09fb44248efd3761963730057e8
@junrushao junrushao merged commit 0a3ad64 into apache:main Jul 20, 2023
@kparzysz-quic
Copy link
Contributor

We're still seeing a circular import:

Traceback (most recent call last):
  File "/.../lib/python3.8/site-packages/_pytest/config/__init__.py", line 774, in import_plugin
    __import__(importspec)
  File "/local/path/python/tvm/testing/__init__.py", line 21, in <module>
    from . import auto_scheduler, autotvm
  File "/local/path/python/tvm/testing/auto_scheduler.py", line 20, in <module>
    from tvm import auto_scheduler, te, topi
  File "/local/path/python/tvm/topi/__init__.py", line 51, in <module>
    from . import nn
  File "/local/path/python/tvm/topi/nn/__init__.py", line 35, in <module>
    from .conv3d_transpose import *
  File "/local/path/python/tvm/topi/nn/conv3d_transpose.py", line 21, in <module>
    from tvm import relay
  File "/local/path/python/tvm/relay/__init__.py", line 29, in <module>
    from . import prelude
  File "/local/path/python/tvm/relay/prelude.py", line 21, in <module>
    from tvm.relay.transform import ToANormalFormExpr
  File "/local/path/python/tvm/relay/transform/__init__.py", line 22, in <module>
    from . import fake_quantization_to_integer, mixed_precision
  File "/local/path/python/tvm/relay/transform/fake_quantization_to_integer.py", line 25, in <module>
    from tvm.relay.qnn.op import canonicalizations
  File "/local/path/python/tvm/relay/qnn/__init__.py", line 20, in <module>
    from . import op
  File "/local/path/python/tvm/relay/qnn/op/__init__.py", line 21, in <module>
    from .qnn import *
  File "/local/path/python/tvm/relay/qnn/op/qnn.py", line 26, in <module>
    from tvm.relay.op.nn.utils import get_pad_tuple2d
  File "/local/path/python/tvm/relay/op/__init__.py", line 35, in <module>
    from . import strategy
  File "/local/path/python/tvm/relay/op/strategy/__init__.py", line 24, in <module>
    from . import arm_cpu
  File "/local/path/python/tvm/relay/op/strategy/arm_cpu.py", line 29, in <module>
    from ....topi.arm_cpu.mprofile import dsp
  File "/local/path/python/tvm/topi/arm_cpu/__init__.py", line 33, in <module>
    from . import qnn_alter_op
  File "/local/path/python/tvm/topi/arm_cpu/qnn_alter_op.py", line 25, in <module>
    from ..nn import qnn_conv2d_alter_layout, add_alter_layout, qnn_requantize_alter_layout
ImportError: cannot import name 'qnn_conv2d_alter_layout' from partially initialized module 'tvm.topi.nn' (most likely due to a circular import) (/local/path/python/tvm/topi/nn/__init__.py)

lhutton1 added a commit to lhutton1/tvm that referenced this pull request Jul 20, 2023
This is an attempt to fix the circular import referenced in
apache#15311 (comment).
The stack trace reports an import that was introduced as part of
this change: from ....topi.arm_cpu.mprofile import dsp`. The fix is
make the import absolute rather than relative.

Change-Id: I2fc2923bfe547359a1216b106fff217b6add7374
junrushao added a commit that referenced this pull request Jul 20, 2023
@lhutton1
Copy link
Contributor Author

Thanks for reporting @kparzysz-quic, do you have a reproducer so I can take a look?

@kparzysz-quic
Copy link
Contributor

It came up in our automated tests, but I'll try to get you something.

MasterJH5574 pushed a commit that referenced this pull request Jul 21, 2023
Revert "[topi] Add `arm_cpu` specific pooling schedules (#15311)"

This reverts commit 0a3ad64,
due to cyclic importing issue reported in #15311.
@Hzfengsy
Copy link
Member

The same error. Can reproduce it by

pytest tests/python/unittest

PS: my python version is Py 3.9.

@lhutton1
Copy link
Contributor Author

Thanks @Hzfengsy, I'll take a look

@lhutton1 lhutton1 deleted the pool-2d-sched branch July 21, 2023 14:54
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.

7 participants