Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metal : increase GPU duty-cycle during inference #9507

Open
ggerganov opened this issue Sep 16, 2024 · 0 comments
Open

metal : increase GPU duty-cycle during inference #9507

ggerganov opened this issue Sep 16, 2024 · 0 comments
Labels
Apple Metal https://en.wikipedia.org/wiki/Metal_(API) help wanted Extra attention is needed performance Speed related topics

Comments

@ggerganov
Copy link
Owner

ggerganov commented Sep 16, 2024

Apparently there is a significant GPU downtime between Metal compute encoders within a single ggml_metal_graph_compute():

image

See #6506 for instructions how to generate the trace from the picture.

My expectation was that enqueuing the command buffers in parallel would make them execute without any downtime. The goal of this issue is to understand where this overhead comes from and if there is a way to avoid it.

Obviously, using a single command buffer will avoid all the GPU downtime, but it is much slower to construct it in a single thread. Ideally, we want to continue queuing multiple encoders, but not have the gaps in-between during execution.

@ggerganov ggerganov added help wanted Extra attention is needed performance Speed related topics Apple Metal https://en.wikipedia.org/wiki/Metal_(API) labels Sep 16, 2024
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) help wanted Extra attention is needed performance Speed related topics
Projects
Status: Todo
Development

No branches or pull requests

1 participant