Skip to content

Commit 31fe7eb

Browse files
committed
pylint
1 parent 7876754 commit 31fe7eb

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

python/tvm/tir/tensor_intrin/arm_cpu.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,24 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17+
# pylint: disable=invalid-name
18+
"""Intrinsics for x86 tensorization."""
1719
from .. import TensorIntrin
1820
from tvm.script import tir as T
1921

2022

23+
# TODO(masahi): Parametrize the TVMScript description of dot product by
24+
# shape and dtype, and share the common description with x86.
25+
2126
@T.prim_func
2227
def dot_product_4x4_i8i8i32_desc(
2328
A: T.Buffer((4,), "int8", offset_factor=1),
2429
B: T.Buffer((4, 4), "int8", offset_factor=1),
2530
C: T.Buffer((4,), "int32", offset_factor=1),
2631
) -> None:
32+
"""
33+
A description for 4x4 dot product.
34+
"""
2735
with T.block("root"):
2836
T.reads(C[0:4], A[0:4], B[0:4, 0:4])
2937
T.writes(C[0:4])
@@ -42,6 +50,9 @@ def dot_product_4x4_i8i8i32_neon(
4250
B: T.Buffer((4, 4), "int8", offset_factor=1),
4351
C: T.Buffer((4,), "int32", offset_factor=1),
4452
) -> None:
53+
"""
54+
A implementation for 4x4 dot product, applicable for any ARM CPUs supporting NEON.
55+
"""
4556
with T.block("root"):
4657
T.reads(C[0:4], A[0:4], B[0:4, 0:4])
4758
T.writes(C[0:4])
@@ -103,6 +114,9 @@ def dot_product_4x4_i8i8i32_sdot(
103114
B: T.Buffer((4, 4), "int8", offset_factor=1),
104115
C: T.Buffer((4,), "int32", offset_factor=1),
105116
) -> None:
117+
"""
118+
A implementation for 4x4 dot product, applicable for ARM CPUs supporting sdot.
119+
"""
106120
with T.block("root"):
107121
T.reads(C[0:4], A[0:4], B[0:4, 0:4])
108122
T.writes(C[0:4])

python/tvm/tir/tensor_intrin/x86.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
from .. import TensorIntrin
17+
# pylint: disable=invalid-name
18+
"""Intrinsics for x86 tensorization."""
1819
from tvm.script import tir as T
20+
from .. import TensorIntrin
1921

2022

2123
# Tensorized intrinsic description and VNNI-specific implementation.
@@ -28,6 +30,9 @@ def dot_product_16x4_u8i8i32_desc(
2830
B: T.Buffer((16, 4), "int8", offset_factor=1),
2931
C: T.Buffer((16,), "int32", offset_factor=1),
3032
) -> None:
33+
"""
34+
A description for 16x4 dot product.
35+
"""
3136
with T.block("root"):
3237
T.reads(C[0:16], A[0:4], B[0:16, 0:4])
3338
T.writes(C[0:16])
@@ -46,6 +51,9 @@ def dot_product_16x4_u8i8i32_vnni(
4651
B: T.Buffer((16, 4), "int8", offset_factor=1),
4752
C: T.Buffer((16,), "int32", offset_factor=1),
4853
) -> None:
54+
"""
55+
A VNNI-specific implmementation for 16x4 dot product.
56+
"""
4957
with T.block("root"):
5058
T.reads(C[0:16], A[0:4], B[0:16, 0:4])
5159
T.writes(C[0:16])

0 commit comments

Comments
 (0)