15 ms·
Will Floating Point 8 Solve AI/ML Overhead?
- eklitzke 4y agoKind of a weird article, as 8-bit quantization is widely used in production for neural networks for a number of years now. The title of the article is a bit misleading since it's widely known that 8-bit quantization does work and is extremely effective at improving inference throughput and latency. I'm not 100% sure if I'm reading the article correctly since it's a bit oblique, but it seems like the news here is that work is being done to formally specify a cross-vendor FP8 standard, as what exists right now is de facto standards from different vendors.
- FL33TW00D 4y agoINT8 quantisation has been used in production for years. FP8 has not.
- Dylan16807 4y agoFP8 provides some nice accuracy benefits over INT8 but if you swap it out that doesn't affect your overhead.
- ftufek 4y agoThe article mentions the 8 bit quantization, I believe this is about training in fp8 as native format. The latest GPUs provide huge flops for those, Tim Dettmers updated his gpu article and he talks about this, the claim is 0.66 PFLOPS for an RTX 4090.
- tysam_and 4y agoThis is very different, FP8 is a new and active area of research that has new hardware that is just supporting it. You are thinking of (U)INT8 quantization
- _0ffh 4y agoThe article, comparing single and double precision: >the mantissa jumps from 32 bits to 52 bits Rather from 23 (+1 for implicit msb) to 52 (+), I suppose.
- fswd 4y agoFor LLM, INT8 is old news but still exciting. FP8 would definitely be an improvement. However the new coolness is INT4. > Excitingly, we manage to reach the INT4 weight quantization for GLM-130B while existing successes have thus far only come to the INT8 level. Memory-wise, by comparing to INT8, the INT4 version helps additionally save half of the required GPU memory to 70GB, thus allowing GLM130B inference on 4 × RTX 3090 Ti (24G) or 8 × RTX 2080 Ti (11G). Performance-wise, Table 2 left indicates that without post-training at all, the INT4-version GLM-130B experiences almost no performance degradation, thus maintaining the advantages over GPT-3 on common benchmarks. Page 7 https://arxiv.org/pdf/2210.02414.pdf https://arxiv.org/pdf/2210.02414.pdf
- cypress66 4y agoHopper seems to drop int4 support so maybe it's old news now? https://en.m.wikipedia.org/wiki/Hopper_(microarchitecture) https://en.m.wikipedia.org/wiki/Hopper_(microarchitecture)
- dragontamer 4y agoAt this rate, we're going to end up with FP1 (1-bit floating point) numbers... I guess that's nonsensical. 1-bit in all FP is the sign bit. So I guess the minimum size is 2-bit FP (1-bit sign + 1-bit exponent + 0-bit implicit 1 mantissa)
- kortex 4y agoAt FP2, you are probably better off with {-1, 0, 1, NaN} (sign+mantissa) rather than sign/exponent. You basically bit pack. FP3 gives you sign, 1x "exponent", 1x mantissa, so still kinda bit packing. I could see FP4 with sign, 1x exponent, 2x mantissa. Exponent would really just be a 4x multiplier, giving +/-0,1,2,3,4,8,12 Or invert all those, so you are expressing common fractions on 0..1
- dragontamer 4y agoReal life has the E3 series: 1, 2.2, 4.7, and then 10, 22, 47, 100, 220, 470, 1000, etc. Etc. EEs would recognize these values to be the Preferred Resistors values for projects (though more commonly the E6 series is used in projects, the E3 and E1 values are preferred) That's 3 values per decade, which is slightly more dispersed than a FP4 that consists of 1 sign + 3 exponent + 0 (implicit mantissa 1 bit). Or the values -128, -64, -32, -16, -8, -4, -2, -1, 1, 2, ... 128. Maybe we can take -128 and call that zero instead, cause zero is useful. -------- Given how even E3 is still useful in real world electrical engineering problems, I'm more inclined to allocate more bits to the exponent than the mantissa.
- sj4nz 4y agoCould be 8-bit posits may be enough. Has that been done? At scale. I do not know.
- bigbillheck 4y agoPosits aren't the answer to any question worth asking.
- meltyness 4y agoWhy not?
- SideQuark 4y agoOriginal posits are variable width, making them nearly useless for high performance parallel computations. Later versions don't add anything of use for low precision neural networks, and lack of hardware support anywhere make them too slow for anything other than toying around. See also http://people.eecs.berkeley.edu/~wkahan/UnumSORN.pdf http://people.eecs.berkeley.edu/~wkahan/UnumSORN.pdf and https://www.youtube.com/watch?v=LZAeZBVAzVw https://www.youtube.com/watch?v=LZAeZBVAzVw
- moloch-hai 4y ago> lack of hardware support That seems fixable. Don't people make chips that do what you want a lot of? A chip with an array of 8-bit posit PUs could process a hell of a lot in parallel, subject only to getting the arguments and results to useful places.
- Dylan16807 4y agoSo for reference to everyone, the way a fixed-width posit works is by unary-encoding the high bits of the exponent, then encoding the low bits if space is available, then encoding mantissa into whatever bits are left. Near 1.0 they look like a normal float. Maybe they have an extra bit or two of precision. Then as you get closer to 0 or infinity, every time the exponent field would run out you instead reset it, at the cost of one bit of precision. The main benefit is that they have a lot more dynamic range than an equivalent float. The downside is the further you go into that range, the less accurate your numbers are. They can also trade off accuracy near 1 for accuracy far from 1. Different exponent widths represent different points on this scale. At smaller bit sizes, they have a good mix of preserving precision while being quite hard to overflow. Overall they're not very different from standard floating point. Most of the bold claims from Gustafson are outside the scope of the posit itself. - Naively I would expect them to be kind of useful, if we ignore the issue of hardware support. Do neural networks need to represent extreme values with just as much precision as non-extreme values? And is the risk of overflow mitigated sufficiently at the same time? If so, yeah, the whole idea is useless.
- ansk 4y agoWill Doubling Disk Size Solve Storage?
- visarga 4y agoThe practical question of interest is: will this make it possible to run GPT-3 size models on normal desktops with GPU? Like Stable Diffusion.
- SoftTalker 4y agoAt some point the practical question would be how do you get all the data onto the desktop.
- Dylan16807 4y agoPeople are already downloading 100GB games. And data rates are growing much faster than RAM capacities. The logistics of downloading a model smaller than GPU RAM are unlikely to ever get complicated.
- nine_k 4y agoUsing bittorrent, of course :) Once AI models become usable on desktops without esoteric hardware, their datasets will go the way of all large media which people have been distributing for many years.
- wolfram74 4y agoI feel like the fastest tier of ram can only get so big before speed of light delays become relevant.
- brrrrrm 4y agoStorage isn’t much of an issue these days. The bottleneck is computing values from RAM, fp8 can improve this drastically
- gumby 4y agoReally for me just the mantissa would be fine; no need for exponent bc so much of what I worked on is between 0..1 There was an interesting paper from the Allen Institute a few years ago describing a system with 1 bit weights that worked pretty well! Since I read it I've been musing on trying that, though it seems unlikely I will be able to any time soon.
- deleted 4y ago[deleted]
- thfuran 4y agoIf you just have a mantissa, aren't you doing fixed point math?
- gumby 4y agoYes, just looking for a weight in the range 0 <= x < 1. But I want to do large numbers of calculations using the GPU, else I'd use the SIMD int instructions (AVX)
- snickerbockers 4y agoJust do fixed point bruh.
- gumby 4y agoit is, but doesn't give me the hardware affordance I want: https://news.ycombinator.com/item?id=34405604 https://news.ycombinator.com/item?id=34405604
- voz_ 4y ago“ High on the ML punch list is how to run models more efficiently using less power, especially in critical applications like self-driving vehicles where latency becomes a matter of life or death.” Never ever heard of inference latency being a bottleneck here…
- deleted 4y ago[deleted]
- make3 4y agoThe title is nonsensical. The faster the compute is, or the faster inference is (through eg precision), the larger the models people will train, because accuracy / output quality increases indefinitely with model size, and everyone knows this. So a different precision it will not "Solve the AI/ML Overhead", that's nonsense. People will just use as large a model as they can for their latency budget at inference & for their $ budget at training, whatever it is.
- psychphysic 4y agoA modern day analog to Jevon's Paradox.
- naasking 4y agoChinchilla suggests that most models now are undertrained. It's been the lore that model size was the bottleneck but we've since passed that and now training data is the limiting factor.
- make3 4y agochinchilla only says that it would be more computationally efficient to have more data than to make the model larger, not that making the model larger wouldn't still benefit in performance gain
- kortex 4y agoRelated: https://ai.facebook.com/blog/making-floating-point-math-highly-efficient-for-ai-hardware/ https://ai.facebook.com/blog/making-floating-point-math-high... Which is meta's 8 bit data type originally called (8,1, alpha, beta, gamma). I think they realized that's a terrible name so I think they are calling it Deepfloat or something now.
- tysam_and 4y agoTo be honest, the second name has connotations that are even more terrible than the original name. They need to seek help from a better naming team, please. It would help them, us, and the world, so much.
- thriftwy 4y agoWhy go so extreme when you can have fp12? Perhaps have 4 high bit exponent and low signed int8 mantissa. Or vice versa, 7 bit exponent, sign and 4 bit mantissa.
- jasonjmcghee 4y agoI think the general idea is to make use of SIMD, and generally the max size is 2^x. So if you're trying to multiply as many numbers as possible in, say, 64 bits, FP8 would get you 8x8 and FP16 would get you 4x4. FP12 would get you 5x5 with some unused space which would be a huge amount of extra work to implement for a 20% gain in efficiency.
- moonchild 4y agoYou can pack arrays of NPOT elements by breaking each element into POT components and transposing. So e.g. you could have one array of 8-bit mantissas and one array of 4-bit exponents.
- jasonjmcghee 4y agoI am curious, if folks have tried hybrid methods using ensembles. Train the main model using FP8 (or other quantized approaches) and have a small calibrating model at FP32 that is trained afterward.
- amelius 4y ago> People who follow a strict neuromorphic interpretation have even discussed binary neural networks, in which the input functions like an axon spike, just 0 or 1. How do you perform differentiation with this datatype?
- amelius 4y agoIn the old days of CS, people were talking about optimizations in the big-O sense. Nowadays the talk is mostly about optimization of constant factors, so it seems.
- SkeuomorphicBee 4y agoI don't know when is "old days" for you, but I remember plenty of constant factor optimization talk in CS two+ decades ago. In fact the "ignore constant factors" mantra was only valid in theoretical CS, most practical subjects saw plenty of gains in constant factors.
- ardit33 4y agoThis is a great article. I have had to deal with this lately, and FP8 / INT8 is very important especially for mobile/on-device inference. AI will start to get embedded in all kind of devices (even low power one), and often backend inference is not desired or feasible. It is actually pretty awesome if the industry moves towards INT8 / FP8 inference as a standard. "But if FP8 becomes real, and if the popular training tools begin to develop ML models with FP8 as the native format, it could be a huge boon to embedded inference deployments. Eight-bit weights take the same storage space, whether they are INT8 or FP8."
- pclmulqdq 4y agoSupposedly, 8-bit numbers could be even better if they were posits, rather than straight floats, but I haven't seen any commercial interest in posit arithmetic yet.
- johnsutor 4y agoI'm more intrigued in the adoption of Posits for ML (particularly DL) tasks: https://www.cs.cornell.edu/courses/cs6120/2019fa/blog/posits/ https://www.cs.cornell.edu/courses/cs6120/2019fa/blog/posits...
- jakobov 4y agono