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 : fix compute pass descriptor autorelease crash #9718

Merged

Conversation

jmousseau
Copy link
Contributor

@jmousseau jmousseau commented Oct 2, 2024

The context's MTLComputePassDescriptor was created with [MTLComputePassDescriptor computePassDescriptor], which returns an autoreleased object, meaning it would be deallocated at the end of the current autorelease pool block. One way to resolve this is by using [[MTLComputePassDescriptor alloc] init] and then later releasing the object, but a simpler approach is to remove the descriptor entirely. [MTLCommandBuffer computeCommandEncoder] returns an encoder with MTLDispatchTypeSerial by default.

@jmousseau jmousseau changed the title Fix compute pass descriptor autorelease crash ggml : fix compute pass descriptor autorelease crash Oct 2, 2024
@jmousseau jmousseau changed the title ggml : fix compute pass descriptor autorelease crash metal : fix compute pass descriptor autorelease crash Oct 2, 2024
Copy link
Owner

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

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

Thanks for catching that!

@ggerganov ggerganov merged commit 5d5ab1e into ggerganov:master Oct 3, 2024
52 of 53 checks passed
dsx1986 pushed a commit to dsx1986/llama.cpp that referenced this pull request Oct 29, 2024
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 15, 2024
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 18, 2024
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.

4 participants