Project

General

Profile

Bug #1906

incorrect CPU detection on AMD Jaguar/Puma architectures

Added by Szilárd Páll over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
core library
Target version:
-
Affected version - extra info:
5.1.x, master
Affected version:
Difficulty:
uncategorized
Close

Description

Our CPU detection seems to assume on x86 either Intel, older AMD with SSE4.1 or newer with Bulldozer architecture with. These assumptions don't take into account the AMD Jaguar, Puma[+] architectures in mobile/low-power AMD chips (and AFAICT the Excavator AVX2 support may not work either).

As a result, the v5.x detection simply assumes that newer AMD should use GMX_SIMD=AVX_128_FMA, but as FMA is not supported on these arch. the binaries obviously won't work.

In the current master, unfortunate the build- and tun-time detection have diverged and give contradicting results: while the built-time detection gets GMX_SIMD=AVX_256 right, the runtime detection claims that AVX_128_FMA would be better.

Summary:
  • v5.x needs fixing to prevent incorrect SIMD detection and crashing binaries
  • v'16 needs run-time detection fix
  • v'16 danger of detection inconsistency needs to be considered (opened separate issue)
  • Excavator support?
  • consider whether AVX-128 could be better on these platforms (though performance is not a great concern on these rare and low-power CPUs, I'd say)
athlon-5350_cpuinfo.txt (4.47 KB) athlon-5350_cpuinfo.txt Jaguar arch / Athlon 5350 /proc/cpuinfo Szilárd Páll, 02/17/2016 04:38 PM
test_gmx51_1x1_cpu_sse-4.1.log (21.1 KB) test_gmx51_1x1_cpu_sse-4.1.log Szilárd Páll, 02/17/2016 05:16 PM
test_gmx51_1x1_cpu_avx-256.log (21.1 KB) test_gmx51_1x1_cpu_avx-256.log Szilárd Páll, 02/17/2016 05:16 PM
test_gmx51_1x1_cpu_sse-4.1-mavx.log (21.1 KB) test_gmx51_1x1_cpu_sse-4.1-mavx.log Szilárd Páll, 02/17/2016 05:16 PM

Related issues

Related to GROMACS - Task #1907: keeping compile- and run-time CPU/arch detection consistentAccepted

Associated revisions

Revision e4e3fe7e (diff)
Added by Erik Lindahl over 4 years ago

Fix SIMD detection on new AMD AVX CPUs w/o fma

We earlier assumed that all AMD CPUs had fma
support and could use AVX_128_FMA, but with this
change we properly detect it and revert to
AVX_256 otherwise.

Fixes #1906 for release-5.1.

Change-Id: I803a6bfa75c5069b73023688a477cfca03c1ddcd

Revision dd8f72ac (diff)
Added by Erik Lindahl over 4 years ago

Fix SIMD detection on AMD AVX CPUs w/o fma (master)

This is essentially the same fix as for release-5.1,
but since the cpu detection code has been rewritten from
scrath this part has been moved to the SIMD module.

Fixes #1906.

Change-Id: Ie25d6013c737279ece902d40d1f54a6e3c5966bb

History

#1 Updated by Szilárd Páll over 4 years ago

  • Related to Task #1907: keeping compile- and run-time CPU/arch detection consistent added

#3 Updated by Szilárd Páll over 4 years ago

Took some time to compile, this CPU isn't too fast, to be honest.

Logs attached. Performance seems best with 128-bit instructions, but the difference between AVX_256 and SSE4.1+-mavx is, not that big.

#4 Updated by Gerrit Code Review Bot over 4 years ago

Gerrit received a related patchset '1' for Issue #1906.
Uploader: Erik Lindahl ()
Change-Id: I803a6bfa75c5069b73023688a477cfca03c1ddcd
Gerrit URL: https://gerrit.gromacs.org/5777

#5 Updated by Gerrit Code Review Bot over 4 years ago

Gerrit received a related patchset '1' for Issue #1906.
Uploader: Erik Lindahl ()
Change-Id: Ie25d6013c737279ece902d40d1f54a6e3c5966bb
Gerrit URL: https://gerrit.gromacs.org/5778

#6 Updated by Erik Lindahl over 4 years ago

  • Status changed from New to Fix uploaded

#7 Updated by Erik Lindahl over 4 years ago

  • Status changed from Fix uploaded to Resolved

#9 Updated by Erik Lindahl over 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF