Skip to content

Var update error in the convolution example #1472

@Chris-Chow

Description

@Chris-Chow

When I run the example of conv2d https://github.com/tile-ai/tilelang/blob/main/examples/convolution/example_convolution.py, this line

in_bound = (access_h >= 0) and (access_w >= 0) and (access_h < H) and (access_w < W)

seems to raise the error of:

tvm.error.InternalError: Check failed: (ExprDeepEqual()(it->second, info)) is false: Trying to update var 'in_bound' with a different value: original=1 <= (by % 784 * 64 + i_j_fused // 32) // 224 + i_j_fused % 32 // 9 and 1 <= i_j_fused % 32 % 9 // 3 + (by * 64 + i_j_fused // 32) % 224 and (by % 784 * 64 + i_j_fused // 32) // 224 + i_j_fused % 32 // 9 < 225 and i_j_fused % 32 % 9 // 3 + (by * 64 + i_j_fused // 32) % 224 < 225, new=1 <= (by % 784 * 64 + (i * 4 + tx // 32)) // 224 + tx % 32 // 9 and 1 <= tx % 32 % 9 // 3 + (by * 64 + (i * 4 + tx // 32)) % 224 and (by % 784 * 64 + (i * 4 + tx // 32)) // 224 + tx % 32 // 9 < 225 and tx % 32 % 9 // 3 + (by * 64 + (i * 4 + tx // 32)) % 224 < 225

. However, if I comment out this line and replace the variable in_bound with its evaluated value, the error disappears.
This makes me wonder whether this is a bug in the compilation or codegen process, or if there is a mistake in the Python code.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions