Skip to content
This repository was archived by the owner on Apr 1, 2021. It is now read-only.

Use tensorization for avx2 as well. #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion torch_tvm/custom_tvm_ops/topi/quantized_linear_int8.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from topi.util import get_const_int
from topi.generic import nn
from topi import tag
from topi.x86.tensor_intrin import dot_16x1x16_int8_int8_int32
from topi.x86.tensor_intrin import dot_16x1x16_int8_int8_int32, \
dot_1x4x16_int8_int8_int32_avx2

from enum import Enum
AVXType = Enum('AVXType', 'AVX2 AVX512 None')
Expand Down Expand Up @@ -146,6 +147,9 @@ def _schedule_quantized_mm(cfg, s, QGEMM):
if avx_type == AVXType.AVX512:
pc = dot_16x1x16_int8_int8_int32()
s[QGEMM].tensorize(xi, pc)
if avx_type == AVXType.AVX2:
pc = dot_1x4x16_int8_int8_int32_avx2()
s[QGEMM].tensorize(xi, pc)
else:
s[QGEMM].reorder(xo, y, xi)
s[QGEMM].unroll(y)
Expand Down