llama2.zig icon indicating copy to clipboard operation
llama2.zig copied to clipboard

read checkpoint in as float data

Open garrisonhh opened this issue 8 months ago • 2 comments

Resolves #12 by avoiding page alignment in the first place.

garrisonhh avatar May 15 '25 18:05 garrisonhh

Sorry I had missed that this was opened, thank you for the fix. Did you run any benchmarks with this change? I’ll have to do some checks but I think the reason for page alignment was to have perfect divisions of the memory so that all the simd and usage of weights wouldn’t cross/straddle the page boundaries. I’d bet in practice it makes minimal to no difference but I’d want to check before merging. That may have been only a thing when mmaping but it’s been awhile since I’ve looked into the details.

cgbur avatar Jun 10 '25 07:06 cgbur

Of course, thanks for your excellent work. I didn't do anything more extensive than running both versions several times with the same input. The token generation speed was basically identical

garrisonhh avatar Jun 10 '25 16:06 garrisonhh