Repository navigation
[Benchmark] Mac Studio M2, with some early genai notes #59
Replies: 2 comments 4 replies
|
Thanks for the detailed writeup! Just for some clarity for everyone on this part:
They all measure different things and it can be confusing. We personally think Fregata's metrics are the most useful for seeing how much of your total available CPU is being used by the entire Fregata/Frigate stack, which is why we added it. |
Frigate+ supplementI got the Frigate+ prebuilt models (nothing custom for now). Some preliminary observations:
These are all stable numbers; I let them run for an hour or two and there were no spikes and no errors in the log (beyond the usual "old camera hiccuping in its mp4 stream" issues). None of that affects the genai side, of course, or improve on frame selection for it. And the 0.17.2.4 version of ANE detection properly reports "14ms (ANE, via power)". :-) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Mac Model & Chip
Mac Studio M2
RAM
32GB
Storage
1TB SSD for config; 10TB RAID-1 spinning rust for recordings
Fregata Version
0.17.2.4
Camera Count
5
Camera Make / Model
4x Vivotek IP7361, 1x H.VIEW HV-500G2A"
Camera Resolution(s)
4x 1920x1080, 1x 2560x1440
Camera FPS
4x 25, 1x 30
Camera Codec(s)
H.264
Detection Resolution
Full frame
Detection Sub-streams Configured
No
Detection FPS
5
Detection Model
default
Detection Running On
Apple Neural Engine (ANE)
CPU Usage (from the Fregata menu bar)
5.5%
RAM Usage (from the Fregata menu bar)
6.2GB
Detection Latency (from the Fregata menu bar or Frigate WebUI)
2.7-3.1ms
Comments
Stand-alone test setup (will integrate with HA later).
The recording store is a soft RAID-1 of two old 10TB disks (about 100-120MB/s effective throughput), attached over Thunderbolt. I used hfs+ to avoid the COW penalty of apfs. So far that works out fine.
These are old cameras I use for testing. They sometimes produce nonstandard H.264 that makes Frigate throw up and restart the go2rtc processes. That spams the log but seems otherwise benign. (The new ones for my actual installation are hopefully better behaved. I'll send another benchmark report for those.)
I should note that the CPU usage numbers reported by the Fregata menu-ling bear no resemblance to what either Frigate's own Settings->System Metrics or Frigate's prometheus metrics or macOS's Activity Monitor report. But by any measure it's low; this isn't loading a Mac Studio at all.
This Mac runs Fregata, a SecuritySpy installation feeding off the same cameras (not sharing a recording disk path), an IndigoDomo.com installation, Ollama.app, and a bunch of odds-and-ends. The CPU is mostly idle (>85% idle), but RAM is getting a bit tight (cached files is down to 4GB or so).
GenAI / LLM
Some preliminary genai notes (work in progress). I'm running Ollama on the same Mac and currently use this Frigate config:
This gives me stable narration and object descriptions. They're not exactly brilliant, but they're stable (not crashing or blowing context windows). A full event narration (Frigate sending 20 images) takes about 35-45 seconds on this machine and consumes upward of 12000 tokens. 20 (thankfully) seems to be a built-in Frigate limit. The elapsed time is dominated by image encoding, not model thinking, so largely depends on how many frames Frigate chooses to send, rather than on the complexity of the scene.
Ollama uses about 6GB of (unified) RAM for
qwen3-vl:4b-instructwith two parallel contexts. Frigate seems to be able to send two review requests and have them operate in parallel without apparent trouble. I don't have enough simultaneous action in this test setup to tell whether using Ollama parallelism is worth the extra RAM.Frigate has an odd way of selecting frames to send to the review llm. For quick motion events (a car driving past on the street), it often just sends one frame with the moving car in it, and the llm duly notes that it's seen no movement. That's not the llm's fault; that's on Frigate. Of course, "exhaustively catalog passing cars in the street" is not exactly Frigate's design goal.
I've experimented a bit with other vision/tools capable LLMs in Ollama. None of the ones that fit are notably better. Gemma4:e4b needs fewer tokens but uses more RAM, for no obvious gain. Ministral-3:3b gives worse narration. All the 8b (and above) models are too slow and blow some timeout in Frigate. The 2b (and below) models are stupid, so 4b seems to be a sweet spot of sorts. If I got an M4 Studio, I would probably take the speedup and not go to a larger model; 30s+ is painfully noticeable when I look at new events showing up in the film strip. I haven't tried cloud-based llms (and probably won't).
And that's all for now. I'm new to Frigate, so anyone who wants to give me advice on how to approach improving the genai side (better prompts? different model? change Frigate parameters?), feel free to teach me.
All reactions