简体   繁体   English

我可以在 Xeon Phi (Knight's Landing) 处理器上编译 Go 程序吗?

[英]Can I compile Go programs on Xeon Phi (Knight's Landing) processors?

I'm a hobbyist who likes to run my own programs in Go, and as Xeon Phi processors become older they're also becoming extremely cheap.我是一个业余爱好者,喜欢在 Go 中运行我自己的程序,而且随着 Xeon Phi 处理器的老化,它们也变得非常便宜。 So cheap I can build a dual socket machine from 2015/16 for <$1000如此便宜,我可以从 2015/16 年开始以 <1000 美元的价格建造一台双插槽机器

I'm trying to find out if I can run Go programs on these.我想知道我是否可以在这些上运行 Go 程序。 From what I've seen, this thread says they won't run (and to try gccgo), but it says it won't run because it partially runs on an x87 ISA.从我所见, 这个线程说他们不会运行(并尝试 gccgo),但它说它不会运行,因为它部分运行在 x87 ISA 上。 Confusingly, in Go release notes they say they're dropping x87 support in 1.16 , implying it was supported in the past.令人困惑的是,在 Go 发行说明中,他们说他们将在 1.16 中放弃对 x87 的支持,这意味着过去曾支持它。 I've seen in other threads that all programs will run on the compatibility layer, but that's an extremely slow layer which only has access to a small portion of the cpu's cache.我在其他线程中看到所有程序都将在兼容层上运行,但这是一个非常慢的层,只能访问 CPU 缓存的一小部分。

I feel like I'm moving farther and farther out of my element;我觉得我离我的元素越来越远了; I was wondering if someone who's used Xeon Phi knows if it will run Go code?我想知道使用 Xeon Phi 的人是否知道它是否会运行 Go 代码? Or just in general, after booting up Ubuntu (or FreeBSD, something that I've seen done and is listed in motherboard specs ) what sort of things aren't going to work and what will?或者只是一般来说,在启动 Ubuntu(或FreeBSD,我已经看到完成并列在主板规格中)之后,什么样的事情不会起作用,什么会起作用?

I appreciate any and all help!我感谢任何和所有的帮助!

You're basing your Knight's Landing worries on this quote about Knight's Corner :您的 Knight's Landing 担忧基于关于 Knight's Corner的这句话:

The Knight's Corner processor is based on an x86-64 foundation, yes, but it in fact has its own floating-point instruction set—no x87, no AVX, no SSE, no MMX... Oh, and then you can throw all that away when Knight's Landing (KNL) comes out. Knight's Corner 处理器基于 x86-64 基础,是的,但实际上它有自己的浮点指令集——没有 x87、没有 AVX、没有 SSE、没有 MMX……哦,然后你可以抛出所有当Knight's Landing(KNL)出来时,它就消失了。

By "throw all that away", they mean all the worries and incompatibilities. “把所有的东西都扔掉”,他们的意思是所有的担忧和不相容。 KNL is based on Silvermont and is fully x86-64 compatible (including x87, SSE, and SSE2 for both standard ways of doing FP math). KNL 基于 Silvermont 并且完全兼容 x86-64(包括 x87、SSE 和 SSE2 用于执行 FP 数学的两种标准方法)。 It also supports AVX-512F, AVX-512ER, and a few other AVX-512 extensions , along with AVX and AVX2 and SSE up to SSE4.2.它还支持 AVX-512F、AVX-512ER 和其他一些 AVX-512 扩展,以及 AVX 和 AVX2 以及 SSE 到 SSE4.2。 A lot like a Skylake-server CPU, except a different set of AVX-512 extensions.很像 Skylake 服务器 CPU,除了一组不同的 AVX-512 扩展。

The point of this is exactly to solve the problem you're worried about: so any legacy binary can run on KNL.这样做的目的正是为了解决您担心的问题:因此任何遗留二进制文件都可以在 KNL 上运行。 To get good performance out of it, you want to be running code vectorized with AVX-512 vectors in the loops that do the heavy lifting, but all the surrounding code and other programs in the rest of the Linux distro or whatever can be running ordinary bog-standard code that uses whatever x87 and/or SSE.为了获得良好的性能,您希望在执行繁重工作的循环中运行使用 AVX-512 向量向量化的代码,但是 Linux 发行版的 rest 中的所有周围代码和其他程序或任何可以运行普通的程序使用任何 x87 和/或 SSE 的沼泽标准代码。


Knight's Corner (first-gen commercial Xeon Phi) has its own variant / precursor of AVX-512 in a core based on P5-Pentium, and no other FP hardware. Knight's Corner (第一代商业 Xeon Phi)在基于 P5-Pentium 的内核中拥有自己的 AVX-512 变体/前身,并且没有其他 FP 硬件。

Knight's Landing (second-gen commercial Xeon Phi) is based on Silvermont, with AVX-512, and is the first that can act as a "host" processor (bootable) instead of just a coprocessor. Knight's Landing (第二代商业 Xeon Phi)基于 Silvermont,配备 AVX-512,是第一个可以充当“主机”处理器(可启动)而不仅仅是协处理器的产品。

This "host" mode is another reason for including enough hardware to decode and execute x87 and SSE: if you're running a whole system on KNL, you're much more likely to want to execute some legacy binaries for non-perf-sensitive tasks, not only binaries compiled specifically for it.这种“主机”模式是包含足够硬件来解码和执行 x87 和 SSE 的另一个原因:如果您在 KNL 上运行整个系统,您更有可能希望为非性能敏感型执行一些遗留二进制文件任务,不仅是专门为它编译的二进制文件。

Its x87 performance is not great, though: like one scalar fmul per 2 clocks ( https://agner.org/optimize ).但是,它的 x87 性能并不是很好:就像每 2 个时钟一个标量fmul ( https://agner.org/optimize )。 vs. 2-per-clock SSE mulsd (0.5c recip throughput).与每时钟 2 个 SSE mulsd (0.5c 接收吞吐量)相比。 Same 0.5c throughput for other SSE/AVX math, including AVX-512 vfma132ps zmm to do 16x single-precision Fused-Multiply-Add operations in one instruction.其他 SSE/AVX 数学具有相同的 0.5c 吞吐量,包括 AVX-512 vfma132ps zmm在一条指令中执行 16 倍单精度融合乘加运算。

So hopefully Go's compiler doesn't use x87 much.所以希望 Go 的编译器不会过多地使用 x87。 The normal way to do scalar math in 64-bit mode (that C compilers and their math libraries use) is SSE, in XMM registers.在 64 位模式(C 编译器及其数学库使用)中进行标量数学的常规方法是 SSE,在 XMM 寄存器中。 x86-64 C compilers only use x87 for types like long double . x86-64 C 编译器仅将 x87 用于long double等类型。

Yes:是的:

Xeon Phi is a series of x86 manycore processors designed and made by Intel.至强融核是英特尔设计制造的x86系列众核处理器。 It is intended for use in supercomputers, servers, and high-end workstations.它旨在用于超级计算机、服务器和高端工作站。 Its architecture allows use of standard programming languages and application programming interfaces (APIs) such as... See also https://en.wikipedia.org/wiki/Xeon_Phi其架构允许使用标准编程语言和应用程序编程接口 (API),例如...

If you can compile go on an x86 processor then you will be able to compile on that specific x86 processor which is manufactured by intel.如果您可以在 x86 处理器上编译 go,那么您将能够在英特尔制造的特定 x86 处理器上编译。

Xeon is not Itanium:)至强不是安腾:)

On such systems you would also be able to compile go you would just need to provide a suitable c compiler...在这样的系统上,您还可以编译 go 您只需要提供合适的 c 编译器...

What makes you think you would otherwise not be able to compile go on say... an Atari or perhaps a Arduino?是什么让您认为您将无法编译 go 上说... Atari 或 Arduino?

If you can elaborate on that perhaps I can improve my terrible answer further.如果你能详细说明,也许我可以进一步改进我糟糕的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM