You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "Cookiee235 (via GitHub)" <gi...@apache.org> on 2025/10/21 14:37:58 UTC

[I] [Bug] Crash when multiple PrimFunc objects are present in IRModule [tvm]

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

   
   
   ### Actual behavior
   
   ```
   Traceback (most recent call last):
     File "test.py", line 36, in <module>
       sch = ms.tir_integration.compile_tir(database, tir_mod, 'llvm --num-cores=16')
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/software/tvm-latest/python/tvm/meta_schedule/tir_integration.py", line 268, in compile_tir
       mod = _normalize_mod(mod)
             ^^^^^^^^^^^^^^^^^^^
     File "python/tvm_ffi/cython/function.pxi", line 758, in core.Function.__call__
     File "python/tvm_ffi/cython/function.pxi", line 914, in core.tvm_ffi_callback
     File "/software/tvm-latest/python/tvm/meta_schedule/tune_context.py", line 56, in _normalize_mod
       (func_name,) = func_names
   
   ValueError: too many values to unpack (expected 1)
   
   ```
   
   ### Environment
   
   tvm-latest(today)
   
   ### Steps to reproduce
   
   ```
   import tvm
   from tvm import meta_schedule as ms
   
   tir_str = """# from tvm.script import ir as I
   # from tvm.script import tir as T
   
   @I.ir_module
   class Module:
       @T.prim_func
       def private_add(lhs: T.Buffer((32, 64), "float32"), rhs: T.Buffer((32, 64), "float32"), T_add: T.Buffer((32, 64), "float32")):
           T.func_attr({"tir.noalias": True})
           for ax0, ax1 in T.grid(32, 64):
               with T.block("T_add"):
                   v_ax0, v_ax1 = T.axis.remap("SS", [ax0, ax1])
                   T.reads(lhs[v_ax0, v_ax1], rhs[v_ax0, v_ax1])
                   T.writes(T_add[v_ax0, v_ax1])
                   T_add[v_ax0, v_ax1] = lhs[v_ax0, v_ax1] + rhs[v_ax0, v_ax1]
   
       @T.prim_func
       def main(lhs: T.Buffer((32, 64), "float32"), rhs: T.Buffer((32, 64), "float32"), T_add: T.Buffer((32, 64), "float32")):
           T.func_attr({"target": T.target({"keys": ["cpu"], "kind": "llvm", "mtriple": "x86_64-unknown-linux-gnu", "tag": ""}), "tir.noalias": True})
           # with T.block("root"):
           for ax0, ax1 in T.grid(32, 64):
               with T.block("T_add"):
                   v_ax0, v_ax1 = T.axis.remap("SS", [ax0, ax1])
                   T.reads(lhs[v_ax0, v_ax1], rhs[v_ax0, v_ax1])
                   T.writes(T_add[v_ax0, v_ax1])
                   T_add[v_ax0, v_ax1] = lhs[v_ax0, v_ax1] + rhs[v_ax0, v_ax1]
   """
   
   
   tir_mod = tvm.script.from_source(tir_str)
   tir_mod.show()
   
   database = ms.tir_integration.tune_tir(mod=tir_mod, target='llvm --num-cores=16', work_dir='./tune_tmp', max_trials_global=1, num_trials_per_iter=1)
   sch = ms.tir_integration.compile_tir(database, tir_mod, 'llvm --num-cores=16')
   ```
   
   ### Triage
   
   * needs-triage
   * meta-tuning
   


-- 
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] Crash when multiple PrimFunc objects are present in IRModule [tvm]

Posted by "cbalint13 (via GitHub)" <gi...@apache.org>.
cbalint13 closed issue #18383: [Bug] Crash when multiple PrimFunc objects are present in IRModule
URL: https://github.com/apache/tvm/issues/18383


-- 
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