Skip to content

[ansor] Does it reasonable to use the axis multiple times ? #17729

@vfdff

Description

@vfdff

Expected behavior

I expect each axis will be used only one time when it generate sketch design

Actual behavior

I try to print the sketch design in function SketchPolicyNode::SearchOneRound, we can see some axises will be used multiple times, such as i.0/j.0 in the following dump (tvm 0.19) ?

Image

turning:
Placeholder: A, B, C
for i.0 (None)
  for j.0 (None)
    for i.0 (None)
      for j.0 (None)
        for i.1 (None)
          for j.1 (None)
            for k.0 (None)
              for i.2 (None)
                for j.2 (None)
                  for k.1 (None)
                    for i.3 (None)
                      for j.3 (None)
                        matmul = ...
    for i.1 (None)
      for j.1 (None)
        out = ...

Environment (172)

Any environment details, such as: Operating System, TVM version

(/py311-tts) root@998ee80b761b:/home/zhongyunde/source/test/ansor# python -c "import tvm; print(tvm.version)"
0.19.dev0
(/py311-tts) root@998ee80b761b:/home/zhongyunde/source/test/ansor# cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.1 LTS"

Steps to reproduce

The script is get from https://tvm.hyper.ai/docs/tutorial/ops_AutoScheduling
then repeatedly run: python matmul_ansor.py

(mlir_venv) (base) root@998ee80b761b: ansor# python matmul_ansor.py
matmul_ansor.py.txt

Triage

Please refer to the list of label tags here to find the relevant tags and add them below in a bullet format (example below).

  • needs-triage

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triagePRs or issues that need to be investigated by maintainers to find the right assignees to address ittype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions