HNHacker News
TopNewBestAskShowJobs

austinvhuang

181 karma · joined October 17, 2021

submissionscomments
austinvhuang··on Gemma.cpp: lightweight, standalone C++ inference engine for Gemma models
any particular hardware folks are most interested in?
austinvhuang··on Gemma.cpp: lightweight, standalone C++ inference engine for Gemma models
lol
austinvhuang··on Gemma.cpp: lightweight, standalone C++ inference engine for Gemma models
I think it's mostly an organic process arising from the ecosystem.

My personal way of understanding it is this - the original sin of model weight format complexity is that NNs are both data and computation.

Representing the computation as data is the hard part and that's where the simplicity falls apart. Do you embed the compute graph? If so, what do you do about different frameworks supporting overlapping but distinct operations. Do you need the artifact to make training reproducible? Well that's an even more complex computation that you have to serialize as data. And so on..

austinvhuang··on Gemma.cpp: lightweight, standalone C++ inference engine for Gemma models
There's a custom 8-bit quantization (SFP), it's what we recommend. At 16 bit, we do bfloat16 instead of fp16 thanks to https://github.com/google/highway, even on CPU. Other quants - stay tuned.

python wrapper - if you want to run the model in python I feel like there's already a lot of more mature options available (see the model variations at https://www.kaggle.com/models/google/gemma) , but if people really want this and have something they want to do with a python wrapper that can't be done with existing options let me know. (similar thoughts wrt to API servers).

austinvhuang··on Gemma.cpp: lightweight, standalone C++ inference engine for Gemma models
Don't be discouraged, you don't have to follow everything.

In fact it's probably better to dive deep into one hobby project like you're doing than constantly context switch with every little news item that comes up.

While working on gemma.cpp there were definitely a lot of "gee i wish i could clone myself and work on that other thing too".

austinvhuang··on Gemma.cpp: lightweight, standalone C++ inference engine for Gemma models
Thanks so much!

Everyone working on this self-selected into contributing, so I think of it less as my team than ... a team?

Specifically want to call out: Jan Wassenberg (author of https://github.com/google/highway) and I started gemma.cpp as a small project just a few months ago + Phil Culliton, Dan Zheng, and Paul Chang + of course the GDM Gemma team.

austinvhuang··on Gemma.cpp: lightweight, standalone C++ inference engine for Gemma models
llama.cpp is great, if it fit your needs you can use it. I think at this point llama.cpp is effectively a platform that's hardened for production.

In its current form, I think of gemma.cpp is more of a direct model implementation (somewhere between the minimalism of llama2.c and the generality of ggml).

I tend to think of 3 modes of usage:

- hacking on inference internals - there's very little indirection, no IRs, the model is just code, so if you want to add support for your own runtime support for sparsity/quantization/model compression/etc. and demo it working with gemma, there's minimal barriers to do so

- implementing experimental frontends - i'll add some examples of this in the very near future. but you're free to get pretty creative with terminal UIs, code that interact with model internals like the KV cache, accepting/rejecting tokens etc.

- interacting with the model locally with a small program - of course there's other options for this but hopefully this is one way to play with gemma w/ minimal fuss.

austinvhuang··on Gemma.cpp: lightweight, standalone C++ inference engine for Gemma models
gguf files are out there, so anyone should be able to do this! are people looking for an "official" version?

ps i'm a fan of cosmopolitan as well.

austinvhuang··on Gemma.cpp: lightweight, standalone C++ inference engine for Gemma models
Hi, one of the authors austin here. Happy to answer any questions the best I can.

To get a few common questions out of the way:

- This is separate / independent of llama.cpp / ggml. I'm a big fan of that project and it was an inspiration (we say as much in the README). I've been a big advocate of gguf + llama.cpp support for gemma and am happy for people to use that.

- how is it different than inference runtime X? gemma.cpp is a direct implementation of gemma, in its current form it's aimed at experimentation + research and portability + easy modifiable rather than a general purpose deployment framework.

- this initial implementation is cpu simd centric. we're exploring options for portable gpu support but the cool thing is it will build and run on a lot of environments you might not expect an llm to run, so long as you have the memory to load the model.

- I'll let other colleagues answer questions about the Gemma model itself, this is a C++ implementation of the model, but relatively independent of the model training process.

- Although this is from Google, we're a very small team that wanted such a codebase to exist. We have lots of plans to use it ourselves and we hope other people like it and find it useful.

- I wrote a twitter thread on this project here: https://twitter.com/austinvhuang/status/1760375890448429459

austinvhuang··on Gemma: New Open Models
You can download the model checkpoints from kaggle https://www.kaggle.com/models/google/gemma and huggingface https://huggingface.co/blog/gemma

Besides the python implementations, we also implemented a standalone C++ implementation that runs locally with just CPU simd https://github.com/google/gemma.cpp

austinvhuang··on Gemma: New Open Models
Yes models can be downloaded locally. In addition to the python NN frameworks and ggml as options, we also implemented a standalone C++ implementation that you can run locally at https://github.com/google/gemma.cpp
austinvhuang··on /tap – Powerful and customizable note-taking system
I'm working on local-first OSS for this sort of second brain thing called OpenMemex. The data store is sqlite (wasm/rust frontend) with programmable integrations in mind:

https://github.com/austinvhuang/openmemex

austinvhuang··on Obsidian – A knowledge base from a local folder of plain text Markdown files
I recently released this which is open source and based on sqlite https://github.com/austinvhuang/openmemex
austinvhuang··on Obsidian – A knowledge base from a local folder of plain text Markdown files
Not the OP, but I recently published this which others may find interesting https://github.com/austinvhuang/openmemex
← PreviousPage 2 of 2