Skip to content

Commit

Permalink
[BACKEND][CPU] Specify CPU target to native for GNU/Linux Arm (triton…
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuigesi authored and Devjiu committed Aug 13, 2024
1 parent adcb4bd commit 5323d6c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/triton/runtime/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def quiet():
def _build(name, src, srcdir, library_dirs, include_dirs, libraries):
suffix = sysconfig.get_config_var('EXT_SUFFIX')
system = platform.system()
machine = platform.machine()
so = os.path.join(srcdir, '{name}{suffix}'.format(name=name, suffix=suffix))
# try to avoid setuptools if possible
cc = os.environ.get("CC")
Expand Down Expand Up @@ -56,6 +57,9 @@ def _build(name, src, srcdir, library_dirs, include_dirs, libraries):
cc_cmd += ["-std=c++17", "-fopenmp"]
if src.endswith(".s"):
cc_cmd += ["-gdwarf-5"]
if system == "Linux" and machine in ("aarch64", "arm64"):
# On Arm backend, some CPU (neoverse-v2) needs to be specified through -mcpu
cc_cmd += ["-mcpu=native"]
ret = subprocess.check_call(cc_cmd)
if ret == 0:
return so
Expand Down

0 comments on commit 5323d6c

Please sign in to comment.