XYZboom commented on issue #20047:
URL: https://github.com/apache/tvm/issues/20047#issuecomment-5078360636
A variant:
```python
import tvm
from tvm import relax
import numpy as np
bb = relax.BlockBuilder()
# Minimal trigger: single conv2d, N=1, C_in=1, C_out=1, output spatial dims
> 1
v_input = relax.Var("input",
relax.TensorStructInfo(shape=relax.ShapeExpr([1, 1, 6, 8]), dtype="float32"))
v_weight = relax.Var("weight",
relax.TensorStructInfo(shape=relax.ShapeExpr([1, 1, 1, 3]), dtype="float32"))
with bb.function("main", [v_input, v_weight]):
v_out = bb.emit(relax.op.nn.conv2d(v_input, v_weight, strides=[1, 1],
padding=[0, 0], dilation=[1, 1], groups=1))
bb.emit_func_output(v_out)
mod = bb.get()
ex = relax.build(mod, target="cuda")
vm = relax.VirtualMachine(ex, tvm.cuda())
np_input = np.random.uniform(0.0, 1.0, size=(1, 1, 6, 8)).astype(np.float32)
np_weight = np.random.uniform(-0.1, 0.1, size=(1, 1, 1,
3)).astype(np.float32)
result = vm["main"](tvm.runtime.tensor(np_input, device=tvm.cuda()),
tvm.runtime.tensor(np_weight, device=tvm.cuda()))
print("Execution: OK")
```
Error log that has the same stack but different exception:
```txt
Target cuda missing 'max_shared_memory_per_block'; using 49152 bytes.
Traceback (most recent call last):
File "/root/autodl-tmp/data/maybeBug/tvm_gemv_assert_value/main.py", line
17, in <module>
ex = relax.build(mod, target="cuda")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/root/miniconda3/lib/python3.12/site-packages/tvm/relax/vm_build.py", line
270, in build
mod = relax_pipeline(mod)
^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/tvm/ir/transform.py",
line 171, in __call__
return _ffi_transform_api.RunPass(self, mod)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "python/tvm_ffi/cython/function.pxi", line 968, in
tvm_ffi.core.Function.__call__
File "<unknown>", line 0, in TVMFFIPyCallback(void*, TVMFFIAny const*,
int, TVMFFIAny*)
File "<unknown>", line 0, in TVMFFIPyCallManager::ForwardPyErrorToFFI()
File "<unknown>", line 0, in TVMFFICyErrorSetRaisedFromPyError(_object*)
File
"/root/miniconda3/lib/python3.12/site-packages/tvm/relax/backend/cuda/pipeline.py",
line 87, in _pipeline
mod = seq(mod)
File "/root/miniconda3/lib/python3.12/site-packages/tvm/ir/transform.py",
line 171, in __call__
return _ffi_transform_api.RunPass(self, mod)
File "python/tvm_ffi/cython/function.pxi", line 968, in
tvm_ffi.core.Function.__call__
File "<unknown>", line 0, in TVMFFIPyCallback(void*, TVMFFIAny const*,
int, TVMFFIAny*)
File "<unknown>", line 0, in TVMFFIPyCallManager::ForwardPyErrorToFFI()
File "<unknown>", line 0, in TVMFFICyErrorSetRaisedFromPyError(_object*)
File "/root/miniconda3/lib/python3.12/site-packages/tvm/ir/transform.py",
line 238, in _pass_func
return inst.transform_module(mod, ctx)
File
"/root/miniconda3/lib/python3.12/site-packages/tvm/s_tir/dlight/base/transform.py",
line 70, in transform_module
sch = _apply_rules(func, target, self.rules, tunable=False)
File
"/root/miniconda3/lib/python3.12/site-packages/tvm/s_tir/dlight/base/transform.py",
line 88, in _apply_rules
space = rule.apply(func, target, tunable)
File
"/root/miniconda3/lib/python3.12/site-packages/tvm/s_tir/dlight/gpu/gemv.py",
line 79, in apply
return self.sch_inner_reduction(sch, target, block,
vector_input_buffers, epilogue)
File
"/root/miniconda3/lib/python3.12/site-packages/tvm/s_tir/dlight/gpu/gemv.py",
line 412, in sch_inner_reduction
return apply(
File
"/root/miniconda3/lib/python3.12/site-packages/tvm/s_tir/dlight/gpu/gemv.py",
line 228, in apply
assert sch.get(ts_o).extent.value == 1
AssertionError
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]