Skip to content

Commit

Permalink
follow-up to #1652, resolved a100-80gb issue (#1655)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffra authored Dec 21, 2021
1 parent cbd68dc commit d93d924
Showing 1 changed file with 12 additions and 10 deletions.
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

0 comments on commit d93d924

Please sign in to comment.