Skip to content

Commit 41e9720

Browse files
committed
skip bf16 tests if AVX512 is unavailable
1 parent 82d84dc commit 41e9720

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/python/contrib/test_dnnl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
ids=["compile", "run"],
3838
)
3939

40+
bf16_supported = "avx512" in open("/proc/cpuinfo", "r").read()
41+
4042

4143
def partition_for_dnnl(mod, params=None, alter_layout=True):
4244
"""Partition the graph greedily offloading supported operators to DNNL.
@@ -148,7 +150,7 @@ def check_dnnl_used(mod, subgraph_num=None):
148150
(True, False, False),
149151
(True, True, False),
150152
]
151-
if test_bf16:
153+
if test_bf16 and bf16_supported:
152154
configs += [(True, False, True), (True, True, True)]
153155
for use_dnnl, alter_layout, use_bf16 in configs:
154156
result_key = (

0 commit comments

Comments
 (0)