-
Notifications
You must be signed in to change notification settings - Fork 324
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
Flash attention - head_dim 64 #1047
Comments
It would be great if anyone solve this: DeepSeek also suffers from this problem as queries and keys have 192 dims. A workaround is to pad to 256 dims, but this results in unnecessary computations. Also, keys and values need to have the same dim when using flash/splash attention, which is not the case in DeepSeek, whose keys have 192 dims but values have 128 dims. |
@gobbleturk @RissyRan can you please take a look |
Hi @RissyRan , thanks, I've already opened an issue in the jax repo: jax-ml/jax#26433 The code below should be inserted right before this line:
|
I have tried using MaxText to train Llama 3.2 3B. This seems to work fine with just minor modifications to the configs.
However, I am unable to train the Llama 1B. The reason is that Flash/Splash attention seem to require that the head_dim is divisible by 128. The head_dim of the 1B model is only 64. I get a "not implemented" error. Using dot_product attention for long context lengths is really challenging.
Any ideas?
The text was updated successfully, but these errors were encountered: