Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

follow-up to #1652, resolved a100-80gb issue #1655

Merged
merged 1 commit into from
Dec 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions op_builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,17 @@ def cpu_arch(self):
try:
from cpuinfo import get_cpu_info
except ImportError as e:
cpu_info = _backup_cpuinfo()
cpu_info = self._backup_cpuinfo()
if cpu_info is None:
return "-march=native"

try:
cpu_info = get_cpu_info()
except json.decoder.JSONDecodeError as e:
#FIXME: temp workaround, seeing strange JSON stack trace from
# cpuinfo on A100-80GB machines and possibly others.
cpu_info = _backup_cpuinfo()
except Exception as e:
self.warning(
f"{self.name} attempted to use `py-cpuinfo` but failed (exception type: {type(e)}, {e}), "
"falling back to `lscpu` to get this information.")
cpu_info = self._backup_cpuinfo()
if cpu_info is None:
return "-march=native"

Expand Down Expand Up @@ -318,16 +319,17 @@ def simd_width(self):
try:
from cpuinfo import get_cpu_info
except ImportError as e:
cpu_info = _backup_cpuinfo()
cpu_info = self._backup_cpuinfo()
if cpu_info is None:
return '-D__SCALAR__'

try:
cpu_info = get_cpu_info()
except json.decoder.JSONDecodeError as e:
cpu_info = _backup_cpuinfo()
#FIXME: temp workaround, seeing strange JSON stack trace from
# cpuinfo on A100-80GB machines and possibly others.
except Exception as e:
self.warning(
f"{self.name} attempted to use `py-cpuinfo` but failed (exception type: {type(e)}, {e}), "
"falling back to `lscpu` to get this information.")
cpu_info = self._backup_cpuinfo()
if cpu_info is None:
return '-D__SCALAR__'

Expand Down