archspec: add support for zen4 (#34609)
Also add: - Upper bound for Xeon Phi compiler support - Better detection for a64fx
This commit is contained in:
parent
bd613b3124
commit
b2c806f6fc
2
lib/spack/external/__init__.py
vendored
2
lib/spack/external/__init__.py
vendored
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
* Homepage: https://pypi.python.org/pypi/archspec
|
* Homepage: https://pypi.python.org/pypi/archspec
|
||||||
* Usage: Labeling, comparison and detection of microarchitectures
|
* Usage: Labeling, comparison and detection of microarchitectures
|
||||||
* Version: 0.2.0 (commit 77640e572725ad97f18e63a04857155752ace045)
|
* Version: 0.2.0 (commit e44bad9c7b6defac73696f64078b2fe634719b62)
|
||||||
|
|
||||||
argparse
|
argparse
|
||||||
--------
|
--------
|
||||||
|
2
lib/spack/external/archspec/__init__.py
vendored
2
lib/spack/external/archspec/__init__.py
vendored
@ -1,2 +1,2 @@
|
|||||||
"""Init file to avoid namespace packages"""
|
"""Init file to avoid namespace packages"""
|
||||||
__version__ = "0.1.2"
|
__version__ = "0.2.0"
|
||||||
|
5
lib/spack/external/archspec/cpu/alias.py
vendored
5
lib/spack/external/archspec/cpu/alias.py
vendored
@ -3,13 +3,12 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
"""Aliases for microarchitecture features."""
|
"""Aliases for microarchitecture features."""
|
||||||
# pylint: disable=useless-object-inheritance
|
|
||||||
from .schema import TARGETS_JSON, LazyDictionary
|
from .schema import TARGETS_JSON, LazyDictionary
|
||||||
|
|
||||||
_FEATURE_ALIAS_PREDICATE = {}
|
_FEATURE_ALIAS_PREDICATE = {}
|
||||||
|
|
||||||
|
|
||||||
class FeatureAliasTest(object):
|
class FeatureAliasTest:
|
||||||
"""A test that must be passed for a feature alias to succeed.
|
"""A test that must be passed for a feature alias to succeed.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -48,7 +47,7 @@ def alias_predicate(func):
|
|||||||
|
|
||||||
# Check we didn't register anything else with the same name
|
# Check we didn't register anything else with the same name
|
||||||
if name in _FEATURE_ALIAS_PREDICATE:
|
if name in _FEATURE_ALIAS_PREDICATE:
|
||||||
msg = 'the alias predicate "{0}" already exists'.format(name)
|
msg = f'the alias predicate "{name}" already exists'
|
||||||
raise KeyError(msg)
|
raise KeyError(msg)
|
||||||
|
|
||||||
_FEATURE_ALIAS_PREDICATE[name] = func
|
_FEATURE_ALIAS_PREDICATE[name] = func
|
||||||
|
11
lib/spack/external/archspec/cpu/detect.py
vendored
11
lib/spack/external/archspec/cpu/detect.py
vendored
@ -11,8 +11,6 @@
|
|||||||
import subprocess
|
import subprocess
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
import six
|
|
||||||
|
|
||||||
from .microarchitecture import generic_microarchitecture, TARGETS
|
from .microarchitecture import generic_microarchitecture, TARGETS
|
||||||
from .schema import TARGETS_JSON
|
from .schema import TARGETS_JSON
|
||||||
|
|
||||||
@ -80,10 +78,9 @@ def proc_cpuinfo():
|
|||||||
|
|
||||||
|
|
||||||
def _check_output(args, env):
|
def _check_output(args, env):
|
||||||
output = subprocess.Popen( # pylint: disable=consider-using-with
|
with subprocess.Popen(args, stdout=subprocess.PIPE, env=env) as proc:
|
||||||
args, stdout=subprocess.PIPE, env=env
|
output = proc.communicate()[0]
|
||||||
).communicate()[0]
|
return str(output.decode("utf-8"))
|
||||||
return six.text_type(output.decode("utf-8"))
|
|
||||||
|
|
||||||
|
|
||||||
def _machine():
|
def _machine():
|
||||||
@ -273,7 +270,7 @@ def compatibility_check(architecture_family):
|
|||||||
this test can be used, e.g. x86_64 or ppc64le etc.
|
this test can be used, e.g. x86_64 or ppc64le etc.
|
||||||
"""
|
"""
|
||||||
# Turn the argument into something iterable
|
# Turn the argument into something iterable
|
||||||
if isinstance(architecture_family, six.string_types):
|
if isinstance(architecture_family, str):
|
||||||
architecture_family = (architecture_family,)
|
architecture_family = (architecture_family,)
|
||||||
|
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
|
@ -5,14 +5,11 @@
|
|||||||
"""Types and functions to manage information
|
"""Types and functions to manage information
|
||||||
on CPU microarchitectures.
|
on CPU microarchitectures.
|
||||||
"""
|
"""
|
||||||
# pylint: disable=useless-object-inheritance
|
|
||||||
import functools
|
import functools
|
||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
import six
|
|
||||||
|
|
||||||
import archspec
|
import archspec
|
||||||
import archspec.cpu.alias
|
import archspec.cpu.alias
|
||||||
import archspec.cpu.schema
|
import archspec.cpu.schema
|
||||||
@ -27,7 +24,7 @@ def coerce_target_names(func):
|
|||||||
|
|
||||||
@functools.wraps(func)
|
@functools.wraps(func)
|
||||||
def _impl(self, other):
|
def _impl(self, other):
|
||||||
if isinstance(other, six.string_types):
|
if isinstance(other, str):
|
||||||
if other not in TARGETS:
|
if other not in TARGETS:
|
||||||
msg = '"{0}" is not a valid target name'
|
msg = '"{0}" is not a valid target name'
|
||||||
raise ValueError(msg.format(other))
|
raise ValueError(msg.format(other))
|
||||||
@ -38,7 +35,7 @@ def _impl(self, other):
|
|||||||
return _impl
|
return _impl
|
||||||
|
|
||||||
|
|
||||||
class Microarchitecture(object):
|
class Microarchitecture:
|
||||||
"""Represents a specific CPU micro-architecture.
|
"""Represents a specific CPU micro-architecture.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -150,7 +147,7 @@ def __str__(self):
|
|||||||
|
|
||||||
def __contains__(self, feature):
|
def __contains__(self, feature):
|
||||||
# Feature must be of a string type, so be defensive about that
|
# Feature must be of a string type, so be defensive about that
|
||||||
if not isinstance(feature, six.string_types):
|
if not isinstance(feature, str):
|
||||||
msg = "only objects of string types are accepted [got {0}]"
|
msg = "only objects of string types are accepted [got {0}]"
|
||||||
raise TypeError(msg.format(str(type(feature))))
|
raise TypeError(msg.format(str(type(feature))))
|
||||||
|
|
||||||
@ -168,7 +165,7 @@ def family(self):
|
|||||||
"""Returns the architecture family a given target belongs to"""
|
"""Returns the architecture family a given target belongs to"""
|
||||||
roots = [x for x in [self] + self.ancestors if not x.ancestors]
|
roots = [x for x in [self] + self.ancestors if not x.ancestors]
|
||||||
msg = "a target is expected to belong to just one architecture family"
|
msg = "a target is expected to belong to just one architecture family"
|
||||||
msg += "[found {0}]".format(", ".join(str(x) for x in roots))
|
msg += f"[found {', '.join(str(x) for x in roots)}]"
|
||||||
assert len(roots) == 1, msg
|
assert len(roots) == 1, msg
|
||||||
|
|
||||||
return roots.pop()
|
return roots.pop()
|
||||||
@ -318,9 +315,6 @@ def _known_microarchitectures():
|
|||||||
"""Returns a dictionary of the known micro-architectures. If the
|
"""Returns a dictionary of the known micro-architectures. If the
|
||||||
current host platform is unknown adds it too as a generic target.
|
current host platform is unknown adds it too as a generic target.
|
||||||
"""
|
"""
|
||||||
# pylint: disable=fixme
|
|
||||||
# TODO: Simplify this logic using object_pairs_hook to OrderedDict
|
|
||||||
# TODO: when we stop supporting python2.6
|
|
||||||
|
|
||||||
def fill_target_from_dict(name, data, targets):
|
def fill_target_from_dict(name, data, targets):
|
||||||
"""Recursively fills targets by adding the micro-architecture
|
"""Recursively fills targets by adding the micro-architecture
|
||||||
|
10
lib/spack/external/archspec/cpu/schema.py
vendored
10
lib/spack/external/archspec/cpu/schema.py
vendored
@ -5,16 +5,12 @@
|
|||||||
"""Global objects with the content of the microarchitecture
|
"""Global objects with the content of the microarchitecture
|
||||||
JSON file and its schema
|
JSON file and its schema
|
||||||
"""
|
"""
|
||||||
|
import collections.abc
|
||||||
import json
|
import json
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
try:
|
|
||||||
from collections.abc import MutableMapping # novm
|
|
||||||
except ImportError:
|
|
||||||
from collections import MutableMapping # pylint: disable=deprecated-class
|
|
||||||
|
|
||||||
|
class LazyDictionary(collections.abc.MutableMapping):
|
||||||
class LazyDictionary(MutableMapping):
|
|
||||||
"""Lazy dictionary that gets constructed on first access to any object key
|
"""Lazy dictionary that gets constructed on first access to any object key
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -56,7 +52,7 @@ def _load_json_file(json_file):
|
|||||||
|
|
||||||
def _factory():
|
def _factory():
|
||||||
filename = os.path.join(json_dir, json_file)
|
filename = os.path.join(json_dir, json_file)
|
||||||
with open(filename, "r") as file: # pylint: disable=unspecified-encoding
|
with open(filename, "r", encoding="utf-8") as file:
|
||||||
return json.load(file)
|
return json.load(file)
|
||||||
|
|
||||||
return _factory
|
return _factory
|
||||||
|
@ -961,21 +961,21 @@
|
|||||||
],
|
],
|
||||||
"intel": [
|
"intel": [
|
||||||
{
|
{
|
||||||
"versions": "18.0:",
|
"versions": "18.0:2021.2",
|
||||||
"name": "knl",
|
"name": "knl",
|
||||||
"flags": "-march={name} -mtune={name}"
|
"flags": "-march={name} -mtune={name}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"oneapi": [
|
"oneapi": [
|
||||||
{
|
{
|
||||||
"versions": ":",
|
"versions": ":2021.2",
|
||||||
"name": "knl",
|
"name": "knl",
|
||||||
"flags": "-march={name} -mtune={name}"
|
"flags": "-march={name} -mtune={name}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dpcpp": [
|
"dpcpp": [
|
||||||
{
|
{
|
||||||
"versions": ":",
|
"versions": ":2021.2",
|
||||||
"name": "knl",
|
"name": "knl",
|
||||||
"flags": "-march={name} -mtune={name}"
|
"flags": "-march={name} -mtune={name}"
|
||||||
}
|
}
|
||||||
@ -1905,6 +1905,86 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"zen4": {
|
||||||
|
"from": ["zen3", "x86_64_v4"],
|
||||||
|
"vendor": "AuthenticAMD",
|
||||||
|
"features": [
|
||||||
|
"bmi1",
|
||||||
|
"bmi2",
|
||||||
|
"f16c",
|
||||||
|
"fma",
|
||||||
|
"fsgsbase",
|
||||||
|
"avx",
|
||||||
|
"avx2",
|
||||||
|
"rdseed",
|
||||||
|
"clzero",
|
||||||
|
"aes",
|
||||||
|
"pclmulqdq",
|
||||||
|
"cx16",
|
||||||
|
"movbe",
|
||||||
|
"mmx",
|
||||||
|
"sse",
|
||||||
|
"sse2",
|
||||||
|
"sse4a",
|
||||||
|
"ssse3",
|
||||||
|
"sse4_1",
|
||||||
|
"sse4_2",
|
||||||
|
"abm",
|
||||||
|
"xsavec",
|
||||||
|
"xsaveopt",
|
||||||
|
"clflushopt",
|
||||||
|
"popcnt",
|
||||||
|
"clwb",
|
||||||
|
"vaes",
|
||||||
|
"vpclmulqdq",
|
||||||
|
"pku",
|
||||||
|
"gfni",
|
||||||
|
"flush_l1d",
|
||||||
|
"erms",
|
||||||
|
"avic",
|
||||||
|
"avx512f",
|
||||||
|
"avx512dq",
|
||||||
|
"avx512ifma",
|
||||||
|
"avx512cd",
|
||||||
|
"avx512bw",
|
||||||
|
"avx512vl",
|
||||||
|
"avx512_bf16",
|
||||||
|
"avx512vbmi",
|
||||||
|
"avx512_vbmi2",
|
||||||
|
"avx512_vnni",
|
||||||
|
"avx512_bitalg",
|
||||||
|
"avx512_vpopcntdq"
|
||||||
|
],
|
||||||
|
"compilers": {
|
||||||
|
"gcc": [
|
||||||
|
{
|
||||||
|
"versions": "10.3:",
|
||||||
|
"name": "znver3",
|
||||||
|
"flags": "-march={name} -mtune={name} -mavx512f -mavx512dq -mavx512ifma -mavx512cd -mavx512bw -mavx512vl -mavx512vbmi -mavx512vbmi2 -mavx512vnni -mavx512bitalg"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"clang": [
|
||||||
|
{
|
||||||
|
"versions": "12.0:",
|
||||||
|
"name": "znver3",
|
||||||
|
"flags": "-march={name} -mtune={name} -mavx512f -mavx512dq -mavx512ifma -mavx512cd -mavx512bw -mavx512vl -mavx512vbmi -mavx512vbmi2 -mavx512vnni -mavx512bitalg"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"aocc": [
|
||||||
|
{
|
||||||
|
"versions": "3.0:3.9",
|
||||||
|
"name": "znver3",
|
||||||
|
"flags": "-march={name} -mtune={name} -mavx512f -mavx512dq -mavx512ifma -mavx512cd -mavx512bw -mavx512vl -mavx512vbmi -mavx512vbmi2 -mavx512vnni -mavx512bitalg",
|
||||||
|
"warnings": "Zen4 processors are not fully supported by AOCC versions < 4.0. For optimal performance please upgrade to a newer version of AOCC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"versions": "4.0:",
|
||||||
|
"name": "znver4",
|
||||||
|
"flags": "-march={name} -mtune={name}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"ppc64": {
|
"ppc64": {
|
||||||
"from": [],
|
"from": [],
|
||||||
"vendor": "generic",
|
"vendor": "generic",
|
||||||
@ -2302,7 +2382,6 @@
|
|||||||
"fp",
|
"fp",
|
||||||
"asimd",
|
"asimd",
|
||||||
"evtstrm",
|
"evtstrm",
|
||||||
"pmull",
|
|
||||||
"sha1",
|
"sha1",
|
||||||
"sha2",
|
"sha2",
|
||||||
"crc32",
|
"crc32",
|
||||||
|
Loading…
Reference in New Issue
Block a user