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

BF16 support on Metal #56

Merged
merged 2 commits into from
Sep 17, 2024
Merged

BF16 support on Metal #56

merged 2 commits into from
Sep 17, 2024

Conversation

ikawrakow
Copy link
Owner

@ikawrakow ikawrakow commented Sep 16, 2024

It is slightly slower than fp16, but definitely a massive improvement compared to not having bf16 support at al. Didn't put any effort into optimizing the matrix x vector kernel, so it is likely one can improve bf16 TG performance.

model size params backend ngl test t/s
llama 8B BF16 14.96 GiB 8.03 B Metal 100 pp512 538.84 ± 0.26
llama 8B F16 14.96 GiB 8.03 B Metal 100 pp512 587.26 ± 0.39
llama 8B BF16 14.96 GiB 8.03 B Metal 100 tg128 21.64 ± 0.05
llama 8B F16 14.96 GiB 8.03 B Metal 100 tg128 21.77 ± 0.03

@ikawrakow ikawrakow merged commit 4ee889f into main Sep 17, 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.

2 participants