Skip to content

perf(metal): fuse GDN tree verification into one dispatch - #1298

Open
CC-Yeh wants to merge 9 commits into
mainfrom
fused-gdn-tree-verify
Open

CC-Yeh wants to merge 9 commits into
mainfrom
fused-gdn-tree-verify

Conversation

@CC-Yeh

@CC-Yeh CC-Yeh commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

remove f32 / odd headcount support since no models is using it.

@CC-Yeh

CC-Yeh commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@eugenebokhan need to implement fused verify for vulkan

@CC-Yeh

CC-Yeh commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor Author
M5 Max workload Speedup vs. main
GDN verify kernel · 2 / 4 / 8 nodes 1.86× / 1.90× / 1.91×
9B-M decode · 1k / 4k prompt 1.048× / 1.026×

@CC-Yeh

CC-Yeh commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author
M4 workload Speedup
GDN verify · 2 / 4 / 8 nodes 1.61× / 1.55× / 1.49×
9B-M decode · 1k / 4k prompt 1.054× / 1.002×

@CC-Yeh
CC-Yeh force-pushed the fused-gdn-tree-verify branch from c048974 to beb4359 Compare December 2, 2026 14:33
@CC-Yeh
CC-Yeh enabled auto-merge (squash) December 2, 2026 15:41
let kernel = match arguments.tree_size {
1..=8 => &self.up_to_8,
9..=16 => &self.up_to_16,
size => panic!("GDN tree verification of {size} nodes is unsupported"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the limit went from 32 to 16 nodes and a bigger tree now panics in the middle of decode. the released models use a tree budget of 8 or 16, so nothing breaks today but could we reject a larger budget with an error when the speculator is created instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, moved to decoder(gdn) load time

@eugenebokhan

Copy link
Copy Markdown
Contributor

@eugenebokhan need to implement fused verify for vulkan

#1307

@CC-Yeh
CC-Yeh requested a review from eugenebokhan December 3, 2026 07:58

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants