[llvm] 4f33331 - [NVPTX] split long-running wmma.py test into smaller chunks. (#72331)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 15 09:55:51 PST 2023
Author: Artem Belevich
Date: 2023-11-15T09:55:47-08:00
New Revision: 4f33331317d1f14b24f0f5544d8adb85e5d54616
URL: https://github.com/llvm/llvm-project/commit/4f33331317d1f14b24f0f5544d8adb85e5d54616
DIFF: https://github.com/llvm/llvm-project/commit/4f33331317d1f14b24f0f5544d8adb85e5d54616.diff
LOG: [NVPTX] split long-running wmma.py test into smaller chunks. (#72331)
Added:
llvm/test/CodeGen/NVPTX/wmma-ptx60-sm70.py
llvm/test/CodeGen/NVPTX/wmma-ptx61-sm70.py
llvm/test/CodeGen/NVPTX/wmma-ptx63-sm72.py
llvm/test/CodeGen/NVPTX/wmma-ptx63-sm75.py
llvm/test/CodeGen/NVPTX/wmma-ptx64-sm70.py
llvm/test/CodeGen/NVPTX/wmma-ptx65-sm75.py
llvm/test/CodeGen/NVPTX/wmma-ptx71-sm80.py
Modified:
llvm/test/CodeGen/NVPTX/wmma.py
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/NVPTX/wmma-ptx60-sm70.py b/llvm/test/CodeGen/NVPTX/wmma-ptx60-sm70.py
new file mode 100644
index 000000000000000..27b847a2d58a5d1
--- /dev/null
+++ b/llvm/test/CodeGen/NVPTX/wmma-ptx60-sm70.py
@@ -0,0 +1,16 @@
+# Check all variants of instructions supported by PTX60 on SM70
+# RUN: %python %s --ptx=60 --gpu-arch=70 > %t-ptx60-sm_70.ll
+# RUN: FileCheck %t-ptx60-sm_70.ll < %t-ptx60-sm_70.ll \
+# RUN: --check-prefixes=INTRINSICS,M16N16
+# RUN: FileCheck %t-ptx60-sm_70.ll < %t-ptx60-sm_70.ll \
+# RUN: --check-prefixes=INTRINSICS,NOEXTGEOM,NOINT,NOSUBINT,NOMMA,NODOUBLE,NOALTFLOAT,NOLDMATRIX
+# RUN: llc < %t-ptx60-sm_70.ll -march=nvptx64 -mcpu=sm_70 -mattr=+ptx60 \
+# RUN: | FileCheck %t-ptx60-sm_70.ll
+# RUN: %if ptxas %{ \
+# RUN: llc < %t-ptx60-sm_70.ll -march=nvptx64 -mcpu=sm_70 -mattr=+ptx60 \
+# RUN: | %ptxas-verify -arch=sm_70 \
+# RUN: %}
+
+import wmma
+
+wmma.main()
diff --git a/llvm/test/CodeGen/NVPTX/wmma-ptx61-sm70.py b/llvm/test/CodeGen/NVPTX/wmma-ptx61-sm70.py
new file mode 100644
index 000000000000000..20ddfc85ec6e43c
--- /dev/null
+++ b/llvm/test/CodeGen/NVPTX/wmma-ptx61-sm70.py
@@ -0,0 +1,16 @@
+# Check all variants of instructions supported by PTX61 on SM70
+# RUN: %python %s --ptx=61 --gpu-arch=70 > %t-ptx61-sm_70.ll
+# RUN: FileCheck %t-ptx61-sm_70.ll < %t-ptx61-sm_70.ll \
+# RUN: --check-prefixes=INTRINSICS,M16N16,EXTGEOM
+# RUN: FileCheck %t-ptx61-sm_70.ll < %t-ptx61-sm_70.ll \
+# RUN: --check-prefixes=INTRINSICS,NOINT,NOSUBINT,NOMMA,NODOUBLE,NOALTFLOAT,NOLDMATRIX
+# RUN: llc < %t-ptx61-sm_70.ll -march=nvptx64 -mcpu=sm_70 -mattr=+ptx61 \
+# RUN: | FileCheck %t-ptx61-sm_70.ll
+# RUN: %if ptxas-9.1 %{ \
+# RUN: llc < %t-ptx61-sm_70.ll -march=nvptx64 -mcpu=sm_70 -mattr=+ptx61 \
+# RUN: | %ptxas-verify -arch=sm_70 \
+# RUN: %}
+
+import wmma
+
+wmma.main()
diff --git a/llvm/test/CodeGen/NVPTX/wmma-ptx63-sm72.py b/llvm/test/CodeGen/NVPTX/wmma-ptx63-sm72.py
new file mode 100644
index 000000000000000..b0403e0101722df
--- /dev/null
+++ b/llvm/test/CodeGen/NVPTX/wmma-ptx63-sm72.py
@@ -0,0 +1,16 @@
+# Check all variants of instructions supported by PTX63 on SM72
+# RUN: %python %s --ptx=63 --gpu-arch=72 > %t-ptx63-sm_72.ll
+# RUN: FileCheck %t-ptx63-sm_72.ll < %t-ptx63-sm_72.ll \
+# RUN: --check-prefixes=INTRINSICS,M16N16,EXTGEOM,INT
+# RUN: FileCheck %t-ptx63-sm_72.ll < %t-ptx63-sm_72.ll \
+# RUN: --check-prefixes=INTRINSICS,NOSUBINT,NOMMA,NODOUBLE,NOALTFLOAT,NOLDMATRIX
+# RUN: llc < %t-ptx63-sm_72.ll -march=nvptx64 -mcpu=sm_72 -mattr=+ptx63 \
+# RUN: | FileCheck %t-ptx63-sm_72.ll
+# RUN: %if ptxas-10.0 %{ \
+# RUN: llc < %t-ptx63-sm_72.ll -march=nvptx64 -mcpu=sm_72 -mattr=+ptx63 \
+# RUN: | %ptxas-verify -arch=sm_72 \
+# RUN: %}
+
+import wmma
+
+wmma.main()
diff --git a/llvm/test/CodeGen/NVPTX/wmma-ptx63-sm75.py b/llvm/test/CodeGen/NVPTX/wmma-ptx63-sm75.py
new file mode 100644
index 000000000000000..ecaa4d287a28345
--- /dev/null
+++ b/llvm/test/CodeGen/NVPTX/wmma-ptx63-sm75.py
@@ -0,0 +1,16 @@
+# Check all variants of instructions supported by PTX63 on SM75
+# RUN: %python %s --ptx=63 --gpu-arch=75 > %t-ptx63-sm_75.ll
+# RUN: FileCheck %t-ptx63-sm_75.ll < %t-ptx63-sm_75.ll \
+# RUN: --check-prefixes=INTRINSICS,M16N16,EXTGEOM,INT,SUBINT
+# RUN: FileCheck %t-ptx63-sm_75.ll < %t-ptx63-sm_75.ll \
+# RUN: --check-prefixes=INTRINSICS,NOMMA,NODOUBLE,NOALTFLOAT,NOLDMATRIX
+# RUN: llc < %t-ptx63-sm_75.ll -march=nvptx64 -mcpu=sm_75 -mattr=+ptx63 \
+# RUN: | FileCheck %t-ptx63-sm_75.ll
+# RUN: %if ptxas-10.0 %{ \
+# RUN: llc < %t-ptx63-sm_75.ll -march=nvptx64 -mcpu=sm_75 -mattr=+ptx63 \
+# RUN: | %ptxas-verify -arch=sm_75 \
+# RUN: %}
+
+import wmma
+
+wmma.main()
diff --git a/llvm/test/CodeGen/NVPTX/wmma-ptx64-sm70.py b/llvm/test/CodeGen/NVPTX/wmma-ptx64-sm70.py
new file mode 100644
index 000000000000000..b35fc9cb5f9cc4a
--- /dev/null
+++ b/llvm/test/CodeGen/NVPTX/wmma-ptx64-sm70.py
@@ -0,0 +1,16 @@
+# Check all variants of instructions supported by PTX64 on SM70+
+# RUN: %python %s --ptx=64 --gpu-arch=70 > %t-ptx64-sm_70.ll
+# RUN: FileCheck %t-ptx64-sm_70.ll < %t-ptx64-sm_70.ll \
+# RUN: --check-prefixes=INTRINSICS,M16N16,EXTGEOM,MMA
+# RUN: FileCheck %t-ptx64-sm_70.ll < %t-ptx64-sm_70.ll \
+# RUN: --check-prefixes=INTRINSICS,NOINT,NOSUBINT,NODOUBLE,NOALTFLOAT,NOLDMATRIX
+# RUN: llc < %t-ptx64-sm_70.ll -march=nvptx64 -mcpu=sm_70 -mattr=+ptx64 \
+# RUN: | FileCheck %t-ptx64-sm_70.ll
+# RUN: %if ptxas-10.1 %{ \
+# RUN: llc < %t-ptx64-sm_70.ll -march=nvptx64 -mcpu=sm_70 -mattr=+ptx64 \
+# RUN: | %ptxas-verify -arch=sm_70 \
+# RUN: %}
+
+import wmma
+
+wmma.main()
diff --git a/llvm/test/CodeGen/NVPTX/wmma-ptx65-sm75.py b/llvm/test/CodeGen/NVPTX/wmma-ptx65-sm75.py
new file mode 100644
index 000000000000000..ac0a3f089a19d1d
--- /dev/null
+++ b/llvm/test/CodeGen/NVPTX/wmma-ptx65-sm75.py
@@ -0,0 +1,16 @@
+# Check all variants of instructions supported by PTX65 on SM75+
+# RUN: %python %s --ptx=65 --gpu-arch=75 > %t-ptx65-sm_75.ll
+# RUN: FileCheck %t-ptx65-sm_75.ll < %t-ptx65-sm_75.ll \
+# RUN: --check-prefixes=INTRINSICS,M16N16,EXTGEOM,INT,SUBINT,MMA,PTX65MMA,PTX65LDMATRIX
+# RUN: FileCheck %t-ptx65-sm_75.ll < %t-ptx65-sm_75.ll \
+# RUN: --check-prefixes=INTRINSICS
+# RUN: llc < %t-ptx65-sm_75.ll -march=nvptx64 -mcpu=sm_75 -mattr=+ptx65 \
+# RUN: | FileCheck %t-ptx65-sm_75.ll
+# RUN: %if ptxas-10.2 %{ \
+# RUN: llc < %t-ptx65-sm_75.ll -march=nvptx64 -mcpu=sm_75 -mattr=+ptx65 \
+# RUN: | %ptxas-verify -arch=sm_75 \
+# RUN: %}
+
+import wmma
+
+wmma.main()
diff --git a/llvm/test/CodeGen/NVPTX/wmma-ptx71-sm80.py b/llvm/test/CodeGen/NVPTX/wmma-ptx71-sm80.py
new file mode 100644
index 000000000000000..0da9c8e799ceb2a
--- /dev/null
+++ b/llvm/test/CodeGen/NVPTX/wmma-ptx71-sm80.py
@@ -0,0 +1,16 @@
+# Check all variants of instructions supported by PTX71 on SM80+
+# RUN: %python %s --ptx=71 --gpu-arch=80 > %t-ptx71-sm_80.ll
+# RUN: FileCheck %t-ptx71-sm_80.ll < %t-ptx71-sm_80.ll \
+# RUN: --check-prefixes=INTRINSICS,M16N16,EXTGEOM,INT,SUBINT,MMA,ALTFLOAT,DOUBLE,PTX65MMA,PTX65LDMATRIX,PTX71MMA
+# RUN: FileCheck %t-ptx71-sm_80.ll < %t-ptx71-sm_80.ll \
+# RUN: --check-prefixes=INTRINSICS
+# RUN: llc < %t-ptx71-sm_80.ll -march=nvptx64 -mcpu=sm_80 -mattr=+ptx71 \
+# RUN: | FileCheck %t-ptx71-sm_80.ll
+# RUN: %if ptxas-11.1 %{ \
+# RUN: llc < %t-ptx71-sm_80.ll -march=nvptx64 -mcpu=sm_80 -mattr=+ptx71 \
+# RUN: | %ptxas-verify -arch=sm_80 \
+# RUN: %}
+
+import wmma
+
+wmma.main()
diff --git a/llvm/test/CodeGen/NVPTX/wmma.py b/llvm/test/CodeGen/NVPTX/wmma.py
index b7153d684671f6c..e1e46f0b8cab34b 100644
--- a/llvm/test/CodeGen/NVPTX/wmma.py
+++ b/llvm/test/CodeGen/NVPTX/wmma.py
@@ -1,96 +1,8 @@
# This test generates all variants of wmma intrinsics and verifies that LLVM
-# generates correct instructions for them.
-
-# Check all variants of instructions supported by PTX60 on SM70
-# RUN: %python %s --ptx=60 --gpu-arch=70 > %t-ptx60-sm_70.ll
-# RUN: FileCheck %t-ptx60-sm_70.ll < %t-ptx60-sm_70.ll \
-# RUN: --check-prefixes=INTRINSICS,M16N16
-# RUN: FileCheck %t-ptx60-sm_70.ll < %t-ptx60-sm_70.ll \
-# RUN: --check-prefixes=INTRINSICS,NOEXTGEOM,NOINT,NOSUBINT,NOMMA,NODOUBLE,NOALTFLOAT,NOLDMATRIX
-# RUN: llc < %t-ptx60-sm_70.ll -march=nvptx64 -mcpu=sm_70 -mattr=+ptx60 \
-# RUN: | FileCheck %t-ptx60-sm_70.ll
-# RUN: %if ptxas %{ \
-# RUN: llc < %t-ptx60-sm_70.ll -march=nvptx64 -mcpu=sm_70 -mattr=+ptx60 \
-# RUN: | %ptxas-verify -arch=sm_70 \
-# RUN: %}
-
-# Check all variants of instructions supported by PTX61 on SM70
-# RUN: %python %s --ptx=61 --gpu-arch=70 > %t-ptx61-sm_70.ll
-# RUN: FileCheck %t-ptx61-sm_70.ll < %t-ptx61-sm_70.ll \
-# RUN: --check-prefixes=INTRINSICS,M16N16,EXTGEOM
-# RUN: FileCheck %t-ptx61-sm_70.ll < %t-ptx61-sm_70.ll \
-# RUN: --check-prefixes=INTRINSICS,NOINT,NOSUBINT,NOMMA,NODOUBLE,NOALTFLOAT,NOLDMATRIX
-# RUN: llc < %t-ptx61-sm_70.ll -march=nvptx64 -mcpu=sm_70 -mattr=+ptx61 \
-# RUN: | FileCheck %t-ptx61-sm_70.ll
-# RUN: %if ptxas-9.1 %{ \
-# RUN: llc < %t-ptx61-sm_70.ll -march=nvptx64 -mcpu=sm_70 -mattr=+ptx61 \
-# RUN: | %ptxas-verify -arch=sm_70 \
-# RUN: %}
-
-# Check all variants of instructions supported by PTX63 on SM72
-# RUN: %python %s --ptx=63 --gpu-arch=72 > %t-ptx63-sm_72.ll
-# RUN: FileCheck %t-ptx63-sm_72.ll < %t-ptx63-sm_72.ll \
-# RUN: --check-prefixes=INTRINSICS,M16N16,EXTGEOM,INT
-# RUN: FileCheck %t-ptx63-sm_72.ll < %t-ptx63-sm_72.ll \
-# RUN: --check-prefixes=INTRINSICS,NOSUBINT,NOMMA,NODOUBLE,NOALTFLOAT,NOLDMATRIX
-# RUN: llc < %t-ptx63-sm_72.ll -march=nvptx64 -mcpu=sm_72 -mattr=+ptx63 \
-# RUN: | FileCheck %t-ptx63-sm_72.ll
-# RUN: %if ptxas-10.0 %{ \
-# RUN: llc < %t-ptx63-sm_72.ll -march=nvptx64 -mcpu=sm_72 -mattr=+ptx63 \
-# RUN: | %ptxas-verify -arch=sm_72 \
-# RUN: %}
-
-# Check all variants of instructions supported by PTX63 on SM75
-# RUN: %python %s --ptx=63 --gpu-arch=75 > %t-ptx63-sm_75.ll
-# RUN: FileCheck %t-ptx63-sm_75.ll < %t-ptx63-sm_75.ll \
-# RUN: --check-prefixes=INTRINSICS,M16N16,EXTGEOM,INT,SUBINT
-# RUN: FileCheck %t-ptx63-sm_75.ll < %t-ptx63-sm_75.ll \
-# RUN: --check-prefixes=INTRINSICS,NOMMA,NODOUBLE,NOALTFLOAT,NOLDMATRIX
-# RUN: llc < %t-ptx63-sm_75.ll -march=nvptx64 -mcpu=sm_75 -mattr=+ptx63 \
-# RUN: | FileCheck %t-ptx63-sm_75.ll
-# RUN: %if ptxas-10.0 %{ \
-# RUN: llc < %t-ptx63-sm_75.ll -march=nvptx64 -mcpu=sm_75 -mattr=+ptx63 \
-# RUN: | %ptxas-verify -arch=sm_75 \
-# RUN: %}
-
-# Check all variants of instructions supported by PTX64 on SM70+
-# RUN: %python %s --ptx=64 --gpu-arch=70 > %t-ptx64-sm_70.ll
-# RUN: FileCheck %t-ptx64-sm_70.ll < %t-ptx64-sm_70.ll \
-# RUN: --check-prefixes=INTRINSICS,M16N16,EXTGEOM,MMA
-# RUN: FileCheck %t-ptx64-sm_70.ll < %t-ptx64-sm_70.ll \
-# RUN: --check-prefixes=INTRINSICS,NOINT,NOSUBINT,NODOUBLE,NOALTFLOAT,NOLDMATRIX
-# RUN: llc < %t-ptx64-sm_70.ll -march=nvptx64 -mcpu=sm_70 -mattr=+ptx64 \
-# RUN: | FileCheck %t-ptx64-sm_70.ll
-# RUN: %if ptxas-10.1 %{ \
-# RUN: llc < %t-ptx64-sm_70.ll -march=nvptx64 -mcpu=sm_70 -mattr=+ptx64 \
-# RUN: | %ptxas-verify -arch=sm_70 \
-# RUN: %}
-
-# Check all variants of instructions supported by PTX65 on SM75+
-# RUN: %python %s --ptx=65 --gpu-arch=75 > %t-ptx65-sm_75.ll
-# RUN: FileCheck %t-ptx65-sm_75.ll < %t-ptx65-sm_75.ll \
-# RUN: --check-prefixes=INTRINSICS,M16N16,EXTGEOM,INT,SUBINT,MMA,PTX65MMA,PTX65LDMATRIX
-# RUN: FileCheck %t-ptx65-sm_75.ll < %t-ptx65-sm_75.ll \
-# RUN: --check-prefixes=INTRINSICS
-# RUN: llc < %t-ptx65-sm_75.ll -march=nvptx64 -mcpu=sm_75 -mattr=+ptx65 \
-# RUN: | FileCheck %t-ptx65-sm_75.ll
-# RUN: %if ptxas-10.2 %{ \
-# RUN: llc < %t-ptx65-sm_75.ll -march=nvptx64 -mcpu=sm_75 -mattr=+ptx65 \
-# RUN: | %ptxas-verify -arch=sm_75 \
-# RUN: %}
-
-# Check all variants of instructions supported by PTX71 on SM80+
-# RUN: %python %s --ptx=71 --gpu-arch=80 > %t-ptx71-sm_80.ll
-# RUN: FileCheck %t-ptx71-sm_80.ll < %t-ptx71-sm_80.ll \
-# RUN: --check-prefixes=INTRINSICS,M16N16,EXTGEOM,INT,SUBINT,MMA,ALTFLOAT,DOUBLE,PTX65MMA,PTX65LDMATRIX,PTX71MMA
-# RUN: FileCheck %t-ptx71-sm_80.ll < %t-ptx71-sm_80.ll \
-# RUN: --check-prefixes=INTRINSICS
-# RUN: llc < %t-ptx71-sm_80.ll -march=nvptx64 -mcpu=sm_80 -mattr=+ptx71 \
-# RUN: | FileCheck %t-ptx71-sm_80.ll
-# RUN: %if ptxas-11.1 %{ \
-# RUN: llc < %t-ptx71-sm_80.ll -march=nvptx64 -mcpu=sm_80 -mattr=+ptx71 \
-# RUN: | %ptxas-verify -arch=sm_80 \
-# RUN: %}
+# generates correct instructions for them. This is the test generator only. The
+# test scripts themselves are in wmma-ptx*-sm*.py files.
+
+# RUN: true
from __future__ import print_function
@@ -98,7 +10,6 @@
from itertools import product
from string import Template
-
class MMAType:
def __init__(self, ptx_type):
self.ptx_type = ptx_type
@@ -1083,11 +994,19 @@ def gen_tests():
gen_check_unsupported_ops(items)
-parser = argparse.ArgumentParser()
-parser.add_argument("--ptx", type=int, default=60)
-parser.add_argument("--gpu-arch", type=int, default=70)
-args = parser.parse_args()
-ptx_version = args.ptx
-gpu_arch = args.gpu_arch
+def main():
+ global ptx_version
+ global gpu_arch
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--ptx", type=int, default=60)
+ parser.add_argument("--gpu-arch", type=int, default=70)
+ args = parser.parse_args()
+
+ ptx_version = args.ptx
+ gpu_arch = args.gpu_arch
+
+ gen_tests()
+
-gen_tests()
+if __name__ == "__main__":
+ main()
More information about the llvm-commits
mailing list