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

Failed assertion in ggml-metal.m #1435

Closed
bjnortier opened this issue Nov 6, 2023 · 3 comments
Closed

Failed assertion in ggml-metal.m #1435

bjnortier opened this issue Nov 6, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@bjnortier
Copy link
Contributor

I have been testing the SwiftUI example app and I'm getting the following error in ggml-metal.m when running on iPhone and Mac:

-[MTLDebugComputeCommandEncoder setThreadgroupMemoryLength:atIndex:]:817: failed assertion `length(4) must be a multiple of 16 bytes.'

at this line:

[encoder setThreadgroupMemoryLength:nth/32*sizeof(float) atIndex:0];

since nth is 32 and 32/32*4=4 is not a multiple of 16.

If I remove the /32 it works but I'm not sure what the correct value should be.

Also, running the app without the debugger attached doesn't seem to generate a problem (the assertion doesn't fail).

@iandundas
Copy link

Thanks, I was just about to post this too!

@ggerganov
Copy link
Owner

There is a fix in llama.cpp : ggml-org/llama.cpp#3938

Will sync it here tomorrow

@bjnortier
Copy link
Contributor Author

Just FYI to anyone else reading this I see the reason why it doesn't fail on Simulator is because use_gpu is false.

#if targetEnvironment(simulator)
        params.use_gpu = false
        print("Running on the simulator, using CPU")
#endif

vonstring pushed a commit to vonstring/whisper.cpp that referenced this issue Nov 7, 2023
@bobqianic bobqianic added the bug Something isn't working label Nov 8, 2023
felrock pushed a commit to felrock/whisper.cpp that referenced this issue Nov 18, 2023
landtanin pushed a commit to landtanin/whisper.cpp that referenced this issue Dec 16, 2023
iThalay pushed a commit to iThalay/whisper.cpp that referenced this issue Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants