You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "qzylalala (via GitHub)" <gi...@apache.org> on 2023/07/02 14:53:39 UTC

[GitHub] [tvm] qzylalala opened a new issue, #15206: [Bug] [Auto Scheduler] Cannot find any valid schedule

qzylalala opened a new issue, #15206:
URL: https://github.com/apache/tvm/issues/15206

   Thanks for participating in the TVM community! We use https://discuss.tvm.ai for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking.  You are always welcomed to post on the forum first :smile_cat:
   
   Issues that are inactive for a period of time may get closed. We adopt this policy so that we won't lose track of actionable issues that may fall at the bottom of the pile. Feel free to reopen a new one if you feel there is an additional problem that needs attention when an old one gets closed.
   
   ### Expected behavior
   
   I'm trying auto scheduling step by step, following this official doc https://tvm.apache.org/docs/tutorial/autotvm_matmul_x86.html#sphx-glr-download-tutorial-autotvm-matmul-x86-py
   
   It should work as showed in this tutorial.
   
   ### Actual behavior
   
   However, I got an error when it arrived at this line of code.
   ```python3
   # Run auto-tuning (search)
   task.tune(tune_option)
   # Apply the best schedule
   sch, args = task.apply_best(log_file)  # Got an error here
   ```
   I find others have the same problem, like this https://discuss.tvm.apache.org/t/solved-auto-scheduler-cannot-find-a-valid-schedule/11745/8.
   
   Unluckly, it not works for me.
   
   
   ### Environment
   
   OS: Ubuntu1804
   TVM version: newest (commit 683dfb0)
   Python: Anaconda python3.8.3
   LLVM: llvm-17
   
   ### Steps to reproduce
   
   ```python
   import numpy as np
   import tvm
   from tvm import te, auto_scheduler
   
   @auto_scheduler.register_workload  # Note the auto_scheduler decorator
   def matmul_add(N, L, M, dtype):
       A = te.placeholder((N, L), name="A", dtype=dtype)
       B = te.placeholder((L, M), name="B", dtype=dtype)
       C = te.placeholder((N, M), name="C", dtype=dtype)
   
       k = te.reduce_axis((0, L), name="k")
       matmul = te.compute(
           (N, M),
           lambda i, j: te.sum(A[i, k] * B[k, j], axis=k),
           name="matmul",
           attrs={"layout_free_placeholders": [B]},  # enable automatic layout transform for tensor B
       )
       out = te.compute((N, M), lambda i, j: matmul[i, j] + C[i, j], name="out")
   
       return [A, B, C, out]
   
   
   target = tvm.target.Target("llvm")
   N = L = M = 1024
   task = tvm.auto_scheduler.SearchTask(func=matmul_add, args=(N, L, M, "float32"), target=target)
   
   # Inspect the computational graph
   print("Computational DAG:")
   print(task.compute_dag)
   
   
   log_file = "matmul.json"
   tune_option = auto_scheduler.TuningOptions(
       num_measure_trials=10,
       measure_callbacks=[auto_scheduler.RecordToFile(log_file)],
       verbose=2,
   )
   
   ################################################################################
   # Run the search
   # --------------
   # Now we get all inputs ready. Pretty simple, isn't it?  We can kick off the
   # search and let the auto-scheduler do its magic.  After some measurement
   # trials, we can load the best schedule from the log file and apply it.
   
   # Run auto-tuning (search)
   task.tune(tune_option)
   # Apply the best schedule
   sch, args = task.apply_best(log_file)
   
   print("Lowered TIR:")
   print(tvm.lower(sch, args, simple_mode=True))
   ```
   
   ### Triage
   
   Please refer to the list of label tags [here](https://github.com/apache/tvm/wiki/Issue-Triage-Labels) to find the relevant tags and add them below in a bullet format (example below).
   
   * needs-triage
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Auto Scheduler] Cannot find any valid schedule [tvm]

Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen closed issue #15206: [Bug] [Auto Scheduler] Cannot find any valid schedule
URL: https://github.com/apache/tvm/issues/15206


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Auto Scheduler] Cannot find any valid schedule [tvm]

Posted by "vfdff (via GitHub)" <gi...@apache.org>.
vfdff commented on issue #15206:
URL: https://github.com/apache/tvm/issues/15206#issuecomment-2689665475

   do you fix the issue after  **pip install cloudpickle** ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org