Skip to content

Commit 05a489c

Browse files
authored
Fix CI build issue for Graviton (#1034)
CI was failing for the AMX specific test on ARM graviton. This patch disables the AMX specific test on ARM graviton to fix the CI build issue.
1 parent e9bce17 commit 05a489c

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import subprocess
2+
3+
def has_support(feature):
4+
# uArch detection not working on Windows
5+
if sys.platform in ['win32']:
6+
return False
7+
8+
try:
9+
cmd = subprocess.Popen(
10+
['grep', feature, '/proc/cpuinfo'], stdout=subprocess.PIPE)
11+
except OSError:
12+
return False
13+
14+
out = cmd.stdout.read().decode('ascii')
15+
cmd.wait()
16+
17+
if out == "":
18+
return False
19+
20+
return True
21+
22+
def is_arch(target):
23+
# Arch detection not working on Windows
24+
if sys.platform in ['win32']:
25+
return False
26+
27+
try:
28+
cmd = subprocess.Popen(
29+
['uname', '-m'], stdout=subprocess.PIPE)
30+
except OSError:
31+
return False
32+
33+
out = cmd.stdout.read().decode('ascii')
34+
cmd.wait()
35+
36+
return target in out
37+
38+
39+
# Check if the target supports AMX BF16 instructions, disable tests if not
40+
# supported.
41+
if not has_support('amx_bf16'):
42+
config.unsupported = True
43+
44+
# Enable only on x86
45+
# Other targets may use different VNNI blocking scheme that is not compatible with
46+
# prepacked shapes in some of the tests
47+
if not is_arch('x86'):
48+
config.unsupported = True

test/Passes/pass-vector-contract-to-amx.mlir

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// REQUIRES: target=x86{{.*}}
2+
13
// RUN: tpp-opt %s --vector-contract-to-amx --split-input-file | FileCheck %s
24

35

0 commit comments

Comments
 (0)