Live data from Hacker News

Intel Prepares to Graft Google’s Bfloat16 onto Processors

nextplatform.com

81–90 of 138 posts

Re: Intel Prepares to Graft Google’s Bfloat16 onto Processors

#81
post #78

I desperately want Chinese companies finally begin producing and designing general purpose CPUs, GPUS, and other types of accelerators. Current situation is terrible duo- and mono-polies, slow pace of innovations, and low reliability. We need more players.

Finally Bloomberg will be able to report on real hardware backdoors!

Re: Intel Prepares to Graft Google’s Bfloat16 onto Processors

#82
Newbie question: what is the typical and extreme values (excluding +/-infinity, and are these used too?) that can occur in training/running of NNs? Also, what level of accuracy is needed?

It may well be a stupid q but I really don't know, and always assumed they would be [-1..+1] and that fixed point would suffice. Clearly not.

Re: Intel Prepares to Graft Google’s Bfloat16 onto Processors

#83

Earlier quoted context omitted.

They had an assembler where one person wrote kernels that were faster than cublas in a lot of cases. Afaik, nobody ever released anything else with that assembler, and Nvidia caught up to that performance quickly. In talking with the cublas devs, it seemed more that maxas kernels were highly tuned for specific sizes, whereas cublas/cudnn had to be more general. Nowadays it's really a moot point with Nvidia's Cutlass…

True story-- the Nervana Maxwell stuff didn't go very far-- but it was noteworthy because they had both that small win as well as their own hardware platform. One other thought about the Nervana-Xeon convergence is that the support for more memory (thru DDR, Optane, or even just mmap'ed NVME) will be a big win for modeling and large-minibatch SGD. For example, the minibatch fetching could be pushed to the hardware /…

Can't deep learning be done using 16 bit fixed point instead?

Re: Intel Prepares to Graft Google’s Bfloat16 onto Processors

#84

They're not really "grafting" it, they're implementing it as a first-class data type.

It's not really first class if you have to CVT BF16 to FP32 if you want to use FMA.

FMA on BF16 uses FP32 for the accumulator for accuracy reasons, but you can have instructions for "Rm = Rm + low(Rn) * low(Rp)" and "Rm = Rm + high(Rn) * high(Rp)", and they can be faster than FP32 "Rm=Rm+Rn*Rp" because there are fewer bits in the mantissas.

Also, converting BF16 to FP32 and back is just a vector shuffle that sticks/drops 16 extra mantissa bits at the end of each FP16 value, so it's cheaper than other floating point conversions. This means that even if you occasionally have to escape to FP32, the overhead is low and you keep all of the memory bandwidth benefits.

Re: Intel Prepares to Graft Google’s Bfloat16 onto Processors

#85
post #76

Earlier quoted context omitted.

True story-- the Nervana Maxwell stuff didn't go very far-- but it was noteworthy because they had both that small win as well as their own hardware platform. One other thought about the Nervana-Xeon convergence is that the support for more memory (thru DDR, Optane, or even just mmap'ed NVME) will be a big win for modeling and large-minibatch SGD. For example, the minibatch fetching could be pushed to the hardware /…

A V100 GPU gets 900GB/s of memory bandwidth. I am less of a CPU expert but afaict you'll be lucky to get much more than 10% of that out of a CPU. This is going to make a huge difference that Intel can't make up with bigger execution units. bfloat helps with this because the data is half as large. But of course if you're doing Nvidia you're probably already doing (IEEE) fp16.

Correct, GPUs can do SGD iterations much much faster once the data is in GPU RAM. But if you have a ton of data relative to compute, you might be better off with a shallower model and/or fewer iterations. Here’s one start-up serving these sorts of projects: https://www.memverge.com/

When GPUs kickstarted deep learning research in 2012, people had already studied shallow models on mapreduce for a decade or so. Once NVME / Optane and modern CPUs get 1-10TB of useful “memory” in the hands of grad students, there should be another wave of new research. To date, my experience has been that 1TB of “memory” is only commonly available in industry.

Re: Intel Prepares to Graft Google’s Bfloat16 onto Processors

#86
post #24

> At this point, Intel doesn’t have bfloat16 implemented in any of its processors, so they used current AVX512 vector hardware present in its existing processor to emulate the format and the requisite operations. According to the researchers, this resulted in “only a very slight performance tax.” Why implement bfloat if you get just slightly less performance emulating it with AVX512, which already exists? Maybe it’s…

They did not specify what the tax was relative to. Maybe they meant relative to 32-bit float? AVX512 is expensive. I believe if you have an AVX512-heavy workload it can cause the processor to throttle.

All the newly added instructions, (VCVTNE2PS2BF16, VCVTNEPS2BF16, VDPBF16PS) to support BF16 are AVX512 instructions.

Re: Intel Prepares to Graft Google’s Bfloat16 onto Processors

#87

does anyone know what is the story on the software side - CUDA is basically industry standard now. Tensorflow OpenCL support bug [1] has been open for FOUR years now (with the discussion devolving into an Intel PlaidML flame war). AMD OpenCL is now ROCm ? At the end of the day, I cant run ANY accelerated workloads using Intel graphics or AMD ....because there's simply no software support anywhere. OTOH, if you have a…

> At the end of the day, I cant run ANY accelerated workloads using Intel graphics or AMD ....because there's simply no software support anywhere.

You can, there’s an Intel framework: OpenVINO that is targeting Intel hardware, processors and HD video cards, you can convert TF graph to Vino and use their inference server, that mimics TF serving.

There’s TF ROCm port by AMD as well.

Re: Intel Prepares to Graft Google’s Bfloat16 onto Processors

#88

does anyone know what is the story on the software side - CUDA is basically industry standard now. Tensorflow OpenCL support bug [1] has been open for FOUR years now (with the discussion devolving into an Intel PlaidML flame war). AMD OpenCL is now ROCm ? At the end of the day, I cant run ANY accelerated workloads using Intel graphics or AMD ....because there's simply no software support anywhere. OTOH, if you have a…

I'm pessimistic. I doubt things will change unless all the major platform owners can come to an agreement on a common API for GPU compute. If NVIDIA were the only holdout, they might be forced to support it.

As it stands, CUDA is the only API with a decent implementation available on the three major desktop OSes. It's ridiculous.

Re: Intel Prepares to Graft Google’s Bfloat16 onto Processors

#89
post #77

Earlier quoted context omitted.

It isn't really very good for machine learning - machine learning doesn't need 8 bits of exponent. For weights during training, 7 bits of mantissa also seems a bit low - it's common for weights to adjust much less than 1% during a single batch of training, which this couldn't represent. I think this is more a "we want something which is faster but is compatible with existing code written for fp32's".

Bfloat is specifically designed for ML. It is the native type in Google's TPUs. It is quite good at ML; most models that work with fp32 work with bfloat with no adjustments; that's in contrast to IEEE fp16. You're right that the mantissa is small. The trick is that you always accumulate into fp32 and then truncate down to 16 bits at the end. You'd do this for any 16-bit floating type. Source: I work on this at Google…

Have you evaluated alternatives such as posits, Kulisch accumulation, and zfp? https://arxiv.org/pdf/1805.08624.pdf https://arxiv.org/pdf/1811.01721.pdf https://insidehpc.com/2018/05/universal-coding-reals-alterna...

In particular the latter describes a generic framework that can be used to generate a lot of different number systems. Could hardware implement this, allowing us to compose and choose the number system by just setting some simple flags?

Re: Intel Prepares to Graft Google’s Bfloat16 onto Processors

#90
post #6

I am sorry for Intel. Perhaps John Gustafson’s 16 bit posits or unums would have made a better choice.

Why would you want to introduce a floating point type with completely different and incompatible behavior when you can just change the mantissa of an existing one and reuse everything already build around it?
Post reply on HN