h3.c icon indicating copy to clipboard operation
h3.c copied to clipboard

M1 Max 64gb

Open benb0jangles opened this issue 3 months ago • 8 comments

I have it running on my M1 Max 64gb, I am just wondering what the optimisation is for M5 vs M1? Or will do just same commands just slightly slower/faster?

benb0jangles avatar Aug 14 '26 05:08 benb0jangles

Basically the difference comes down to Metal acceleration. h3.c runs the same Metal shaders on both chips — the M1 Max and M5 Max both execute the same code, but the M5 has more GPU cores and higher memory bandwidth, so it is simply faster. The commands are identical, you just get slower/faster results depending on the chip. On my 32GB M-series I run it with --ssd-streaming to fit the model in memory, and it works great. So: same commands, hardware decides the speed.

z6qaz avatar Aug 14 '26 05:08 z6qaz

M1 Max: 10c cpu/32c gpu - bw:400GB/s M5 Max: 18c cpu/40c gpu - bw:614GB/s

Minimax h3 fits entirely in unified memory on my 64GB M1 Max

I wonder if somebody can vibe code a chart to show generation times for 2s/4s/8s/15s videos using a 'hello world' prompt example. I asked an llm about video generation times but it just throws out imaginary numbers: "A generation that takes 30 minutes on an M1 Max will take roughly 6 to 8.5 minutes on an M5 Max" - But I have yet to see real-world measurement test.

I am excited to explore refining a workflow to speed up generation. So far: -I generate test prompt ideas using low resolution + low steps number -then if I like the prompt or if it matches my idea I generate higher -I figure if i want to generate at 2k i will use an api provider to speed up/offload to

benb0jangles avatar Aug 14 '26 05:08 benb0jangles

Image

@benb0jangles 这是我的基础M5(不是Max)的真实测量结果,32GB,无风扇Air。我运行了你的确切想法:相同的提示,4个持续时间,用--profile测量。这里没有法学硕士猜测😄

图表:(拖拉所附的SVG文件)

视频长度 帧 实时生成时间
2秒 48 67.2秒
4s 96 100.9s
8秒 192 164.6秒
15秒 360 354.7秒

配置:./h3 --配置文件-d。/MiniMax-H3 -p “一只红狐狸在松林中穿过新雪” --宽度 256 --高度 256 --框架 N --步骤 12 --层 45 --重用 3 (H3_NO_音频=1)

关键观察: 1.生成時間隨持續時間非線性縮放——15秒比2秒長5.3倍,而不是7.5倍(幀計數比)。每个视频的开销是固定的(文本编码,VAE解码)。 2.所有四次运行的内存峰值都是~17 GiB——适合32GB,没有SSD流。 3.在我的M5基地上,GPU繁忙时间(root-gpu)只有墙时间的~2-5%——瓶颈是内存带宽,因此您的64GB M1 Max(400GB/s)与我的M5基地相比,规模会有所不同。很高兴看到您相同命令的M1 Max号码!

您的工作流程(低分辨率+低步骤先,然后升级)也正是我所做的。對於2K,API提供商的繁重工作是有意義的——256x256的本地DiT在15秒中已經是355秒,在2K下,速度慢得令人望而卻步。

感谢您开始这个主题——真实数据每次都超过LLM的估计🚀

https://github.com/user-attachments/assets/6d36d402-9d43-4d62-a696-918914b4d3ec

https://github.com/user-attachments/assets/7210e649-63f8-4c97-826a-863c22e13add

z6qaz avatar Aug 14 '26 07:08 z6qaz

Your workflow is exactly what I do too — low-res + low steps first, then commit to a full render once the prompt feels right. I've found it's the only sane way with DiT video, regardless of how much memory you have.

One concrete data point from my testing: at 4 steps the output is basically a colored gradient with no subject at all. 12 steps is the minimum I've found where the subject actually appears. So my "cheap test" config is 256×256 + 12 steps + 45 layers + reuse 3 (~1 minute for a 2s clip) — if the idea holds up at that quality, I render it for real at 768×448.

Would be curious what your minimum viable test config looks like on the M1 Max — do you get away with fewer steps there?

z6qaz avatar Aug 14 '26 07:08 z6qaz

the lowest step number i have tested (i only setup h3.c yesterday) is 15 steps. 20 steps is good with few artifacts, 24 steps looks nice and clean but obviously take longer time to generate.

--width 256 --height 256
--seconds 8 --steps 20
--layers 50 --reuse 1
-o outputs/fox-256.mp4 tokenizer 1/1
text encoder 50/50
refine text 1/1
precompute AdaLN 50/50
load transformer core 50/50
denoise 20/20
audio VAE 7/7
video VAE load 36/36
FFmpeg 192/192

i wonder if h3.c also can output total generation time:hours/mins/seconds?

benb0jangles avatar Aug 14 '26 07:08 benb0jangles

It does output total generation time! At the end of every run you get a line like:

Done -> outputs/fox-256.mp4 [164.6s]

...but it's in plain seconds, not hh:mm:ss format. If you want the friendly format, just wrap it in the shell: time ./h3 ... gives you "real 2m44.6s".

Interesting that your minimum is 15 steps — my cheap-test floor is 12 steps at 256×256 (below that I just get a colored gradient, no subject). 20 steps is my "good" tier too, and 24 for final renders. The 50 layers + reuse 1 you're using explains the cleaner output — I usually run reuse 3 at 45 layers to save time on tests.

Would you mind posting the Done -> line from one of your runs? Curious how the M1 Max time compares to my M5 base for the same 8s clip.

z6qaz avatar Aug 14 '26 07:08 z6qaz

for some reason i do not get the output seconds in terminal :(

benb0jangles avatar Aug 14 '26 07:08 benb0jangles

I don't get the time either.

I get "h3: wrote /Volumes/SSD_4TB_01/AI Images/Videos/TuxKittenTests10 --width 672 --height 384 --seconds 6.000 --steps 40 --layers 45 --reuse 2.mp4"

All the tags come from an app I built to generate the CLI. The tags are optional.

Image

I'll try wrapping it in time.

LewnWorx avatar Aug 19 '26 15:08 LewnWorx