Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 36 additions & 9 deletions python/tvm/topi/arm_cpu/conv2d_gemm.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,45 @@ def compute_conv2d_gemm_without_weight_transform(
),
name="C_interleaved",
)
# Ensure the padding needed for tensorize does not get removed during tir passes
# by adding a dummy reference to the specific padded area of the result
zero = (
tvm.tir.const(1, C_interleaved.dtype)
* C_interleaved[
batches - 1,
M // tile_rows_A,
N_transformed - 1,
idxm(M, tile_rows_A) // 2,
tile_rows_B // 2 - 1,
1,
1,
]
- tvm.tir.const(1, C_interleaved.dtype)
* C_interleaved[
batches - 1,
M // tile_rows_A,
N_transformed - 1,
idxm(M, tile_rows_A) // 2,
tile_rows_B // 2 - 1,
1,
1,
]
)
# Unpack the result
C = te.compute(
(batches, M, N),
lambda b, x, y: C_interleaved[
b,
x // tile_rows_A,
y // tile_rows_B,
idxm(x, tile_rows_A) // 2,
idxm(y, tile_rows_B) // 2,
idxm(idxm(x, tile_rows_A), 2),
idxm(idxm(y, tile_rows_B), 2),
].astype(out_dtype),
lambda b, x, y: (
C_interleaved[
b,
x // tile_rows_A,
y // tile_rows_B,
idxm(x, tile_rows_A) // 2,
idxm(y, tile_rows_B) // 2,
idxm(idxm(x, tile_rows_A), 2),
idxm(idxm(y, tile_rows_B), 2),
]
+ zero
).astype(out_dtype),
name="C",
)
else:
Expand Down
11 changes: 5 additions & 6 deletions tests/python/topi/python/test_topi_conv2d_int8.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,11 @@
topi.arm_cpu.compute_conv2d_NHWC_quantized_native,
topi.arm_cpu.schedule_conv2d_NHWC_quantized_native,
),
# TODO(giuseros) We need LLVM-11 in order to compile with +i8mm extension
# (
# "llvm --device arm_cpu --mtriple aarch64-linux-gnu -mattr=+v8.2a,+i8mm",
# topi.arm_cpu.compute_conv2d_NHWC_quantized_interleaved,
# topi.arm_cpu.schedule_conv2d_NHWC_quantized_interleaved,
# ),
(
"llvm --device arm_cpu --mtriple aarch64-linux-gnu -mattr=+v8.2a,+i8mm",
topi.arm_cpu.compute_conv2d_NHWC_quantized_interleaved,
topi.arm_cpu.schedule_conv2d_NHWC_quantized_interleaved,
),
]


Expand Down