News for hackers. Stuff that matters.
Re:The Era of 1-bit LLMs: ternary parameters for cost-effect... by creshal on Wednesday February 28, 2024 @10:24AM (#39539123)
> With some kind of streaming-from-flash architecture you might be in the realm already.

I thought mmap'ing models to only keep the currently needed pieces in RAM was something that was figured out ~6 months ago? Performance wasn't terribly great iirc, but with how much faster 1.58B is, it should still be okay-ish.

Re:The Era of 1-bit LLMs: ternary parameters for cost-effect... by imtringued on Wednesday February 28, 2024 @10:45AM (#39539442)
I'm not sure what use that is, other than to maintain the KV cache across requests.
Re:The Era of 1-bit LLMs: ternary parameters for cost-effect... by liuliu on Wednesday February 28, 2024 @01:40PM (#39542002)
There is a more detailed paper from Apple on this. Basically, you can do a little bit better than only keeping current weights in RAM with mmap.

For LLM, you are mostly dealing with b = W @ a where a and b are vectors, only W is the matrix. If a is sparse (i.e. have a few 0s), you don't need all the columns from W to do the matrix-vector multiplication. A cleverly arranged W can make sure during inference, only related columns loaded from flash. Further more, if you can apply "One Weird Trick" paper to this matrix-vector multiplication, you can shard W by rows, i.e. `b[i:i+n] = W[i:i+n,:] @ a[i:i+n] for i in range(N, N / b)` such that while the previous b[i:i+n] is still computing, you have visibility on which columns of the next matrix to be loaded already.

Re:The Era of 1-bit LLMs: ternary parameters for cost-effect... by cjbprime on Wednesday February 28, 2024 @04:15PM (#39543531)
You need all of the model in RAM to perform the matmult that gets you the next token from it. There's no shortcut.