News for hackers. Stuff that matters.
Re:Towards 1-bit Machine Learning Models by jstmm on Friday March 29, 2024 @05:47PM (#39869371)
In both the '1-bit Model' and '2-bit Model' tables, the forward time (sec) for Llama2-7B with FP16 (full precision) is 0.1 s, whereas it's ~0.231, ~0.257, ~0.353 s respectively for HQQ (1-bit) / HQQ+ (1-bit) / Quip# (2-bit) meaning the FP16 model has ~3x lower inference time.

On the contrary, in the BitNet b1.56 paper [0] the authors report their 7b model has 2.9x reduced inference latency.

It's not clear to me what's happening here. Can someone explain why the 1/2bit HQQ/HQQ+ models are so much slower than the BitNet b1.56 models?

[0] https://arxiv.org/pdf/2402.17764.pdf

Re:Towards 1-bit Machine Learning Models by londons_explore on Friday March 29, 2024 @06:29PM (#39869687)
GPU's aren't really designed for 1 bit math... They don't perform much faster than floating point math.

Whereas a custom ASIC or updated design of GPU could give massive speedups with 1 bit math.

Re:Towards 1-bit Machine Learning Models by UncleOxidant on Friday March 29, 2024 @06:50PM (#39869877)
Yes, exactly. Neither GPUs nor CPUs are setup for 1 bit math. Pulling 1 or 2 bits out of a word isn't all that straightforward on CPU or GPU - lots of shifting and masking. I wonder how long it's going to be before we see custom hardware for bitnets? I suspect we'll see it on FPGAs first.
Re:Towards 1-bit Machine Learning Models by bee_rider on Friday March 29, 2024 @06:41PM (#39869794)
For 1 bit math, at least it should be possible to populate every other bit of an integer type, right? Surely one could do better with a dedicated type for this, but at least we could pack 16 single-bit weights into a 32 bit int for addition, right?
Re:Towards 1-bit Machine Learning Models by imtringued on Saturday March 30, 2024 @06:26AM (#39873500)
You're telling me GPUs aren't designed for additions and subtractions? Where did you hear that?
Re:Towards 1-bit Machine Learning Models by bick_nyers on Saturday March 30, 2024 @11:47AM (#39875958)
I think they are moreso saying that GPUs are not optimized for those operations. CPU aren't "designed" for matrix multiplies yet we can still run them, albeit at a slower rate than on a GPU.
Re:Towards 1-bit Machine Learning Models by shaklee3 on Sunday March 31, 2024 @01:12AM (#39881637)
A100 (> 5yo GPU) has a 1-bit tensor core engine
Re:Towards 1-bit Machine Learning Models by brucethemoose2 on Friday March 29, 2024 @07:05PM (#39870001)
Real world GPU performance is hugely influenced by hand optimization of the CUDA kernels.
Re:Towards 1-bit Machine Learning Models by thatguysaguy on Friday March 29, 2024 @05:55PM (#39869429)
Sounds like these guys didn't use custom kernels, but BitNet did.
Re:Towards 1-bit Machine Learning Models by mobicham on Saturday March 30, 2024 @09:58AM (#39874946)
That's correct. Only the dequantization is done on CUDA, the matmul is done with Pytorch. If they put their kernels open-source we could re-use them!