Skip to content

metal : add env var to trigger graph capture - #20398

Merged
ggerganov merged 1 commit into
masterfrom
gg/metal-capture-env
Mar 11, 2026
Merged

ggerganov merged 1 commit into
masterfrom
gg/metal-capture-env

Conversation

@ggerganov

@ggerganov ggerganov commented Mar 11, 2026 •

Copy link
Copy Markdown
Member

QoL for capturing execution of Metal graphs for profiling purposes.

Usage:

# capture the 8th compute graph
METAL_CAPTURE_ENABLED=1 GGML_METAL_CAPTURE_COMPUTE=8 llama-completion ...

0.00.707.463 W ggml_metal_graph_compute: capturing graph in /tmp/perf-metal-47193.gputrace

Inspect in XCode:

open /tmp/perf-metal-47193.gputrace

Useful for detecting register spills:

image

Or for finding hot spots in the kernel implementations:

image

@github-actions github-actions Bot added ggml changes relating to the ggml tensor library for machine learning Apple Metal https://en.wikipedia.org/wiki/Metal_(API) labels Mar 11, 2026
@ggerganov
ggerganov merged commit c363256 into master Mar 11, 2026
16 of 75 checks passed
@ggerganov
ggerganov deleted the gg/metal-capture-env branch March 11, 2026 14:25
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
MrLordCat referenced this pull request in MrLordCat/llama.cpp-rdna-lab Jul 16, 2026
zommiommy pushed a commit to zommiommy/llama.cpp that referenced this pull request Aug 18, 2026
frostyautumnleaf pushed a commit to frostyautumnleaf/llama.cpp that referenced this pull request Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Apple Metal https://en.wikipedia.org/wiki/Metal_(API) ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant