Better HN
topnewbestaskshowjobs
Log inSign up

gitpusher42

459 karma · joined Nov 17, 2018 (8y ago) · 73 submissions

Submissions

comment 3mo ago · link · parent

Yeah, original TurboFieldfare supports Gemma https://github.com/drumih/turbo-fieldfare

comment 3mo ago · link · parent

Thank you for using TurboFieldfare as a starting point for this project and thank you for mentioning it at the README. I am glad it inspired more people to explore area of on-device AI further!

comment 3mo ago · link · parent

It is only a wild guess, but if you have 256gb version and a lot of apps running it can be pretty slow.

comment 3mo ago · link · parent

Thank you for testing and sharing results!

I think I might understand your use case. You ssh the Mac and want something like `ollama run` with an interactive chat in terminal. Am I right?

There is already experimental OpenAI-compatible server in this repo:

``` swift build -c release --product TurboFieldfareServer .build/release/TurboFieldfareServer \ --model scratch/gemma4.gturbo ```

After that a small terminal client can run inside the same ssh session and talk to `/v1/chat/completions`

The client needs to keep a messages array, add each user message, send the full array with `stream:true`, print SSE chunks until `[DONE]`, then add the response back to the array. `/reset` can clear it

There is a python example in the server docs. (https://github.com/drumih/turbo-fieldfare/blob/main/docs/OPE...)

It is non-streaming, but can be used as a starting point.

The server is still experimental and I am fixing some problems currently. But you can try to vibecode a simple terminal client around it.

If not, create an issue on Github and describe desired behaviour

comment 3mo ago · link · parent

I think there is a limit based on MoE number of active parameters and quantisation, bytes count for active experts. But I believe we will see more project like this for different models.

comment 3mo ago · link · parent

Uh, maybe, who knows. I am pretty bad solving leetcode, btw

comment 3mo ago · link · parent

Yeah, gpt-oss-120b is also MoE, so the same ssd-streaming and caching ideas should work. Feel free to fork and try implementing it!

comment 3mo ago · link · parent

Yeah, it must be exactly the same. The same weights are used, nothing skipped or pruned. But it might have differ to MLX for greedy decode because of small floating-point nums difference

comment 3mo ago · link · parent

yeah, looks like a page cache matters a lot I tested on mine m5 pro with 8gb memory pressure, got 27t/s instead of 35t/s Someone tested on m4 max. In regular state it was 48tok/s, but 32-42 with memory pressure

comment 3mo ago · link · parent

Apple does something similar with their latest foundation model. They process input prompt and based on results they preload required experts. Quite neat solution for the edge devices

comment 3mo ago · link · parent

Yeah, sure! You can select different options in the app settings at the right panel, it shows how much memory it will use

For CLI and Server, use --max-context

comment 3mo ago · link · parent

uh, tried most of this

mmap benchmark did basically page touch experiment and cold reads were much slower, unfortunately (10ms vs 3ms)

I tried MADV_WILLNEED, F_RDADVISE and preadv. preadv reduced parallelism because requested experts are rarely adjacent in the file.

pread is still the fastest. And I think Flash-Moe got the same result too

comment 3mo ago · link · parent

afaik there is some research at this area. Also the new apple foundation model uses related idea. they process the whole prompt and based on prompt load required experts and use only these experts for generation. It doesn't require fitting full model into memory or per token ssd streaming

comment 3mo ago · link · parent

Yeah, must be possible. Not fast, but possible if you have enough ram. I think you can search online for projects, I think I saw something related

comment 3mo ago · link · parent

uh, don't worry. Just install the latest Xcode from the App Store. It includes everything you need to run this project

comment 3mo ago · link · parent

It heavily relies on M-series Mac unified memory architecture. And shaders are written using Metal, Apple's own gpu programming technology. It cannot be ported directly to classic architecture (ram+vram)

comment 3mo ago · link · parent

Not sure it will be really usable. Check for Flash-Moe and Colibri repos A lot of request for qwen3.6 moe, it might worth exploring

comment 3mo ago · link · parent

Yeah, Gemma is not the best for coding I guess. qwen must be better

comment 3mo ago · link · parent

Yeah, the same ideas should work for qwen. You can try porting this engine to use Owen.

Owen 3.6-35b-a3b was my initial idea, but I switched to Gemma because of its simpler architecture and kernels

comment 3mo ago · link · parent

Thank you for testing and sharing, it is useful info!

comment 3mo ago · link · parent

Thank you very much for sharing! Great results and useful info!

comment 3mo ago · link · parent

Thanks! Will try!

comment 3mo ago · link · parent

uh, it's a bit difficult to discuss the classical approach with vRAM and regular RAM. Not really familiar with optimisations and hacks, I always worked with apple platforms and shared memory. But description sounds cool, good luck with your project!

comment 3mo ago · link · parent

Check for colibri, dwarf star and flash-moe. they do similar things with bigger models

https://github.com/JustVugg/colibri https://github.com/antirez/ds4 https://github.com/danveloper/flash-moe

comment 3mo ago · link · parent

Yeah, I tried both rearranging experts on disk and predicting the next expert using statistical approach. Reordering helped on the test prompt, but failed on another prompt. Markov and cross layer prediction didn't work either

comment 3mo ago · link · parent

It is Apple platform only implementation because of Metal (and Swift). Other platforms would require CUDA or Vulkan and a complete rework

comment 3mo ago · link · parent

hm. just open repo, copy commands into your terminal and you will get app installed (if you have swift toolchain installed)

after that download 14gb of weights and enjoy offline inference (and a bit of Gemma4 intelligence) for your everyday tasks

multi turn chat is coming!

comment 3mo ago · link · parent

Thank you! If you can use it for your tasks I would be happy!
123