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

Question about the dimension of head #11

Closed
PeiqinZhuang opened this issue Apr 21, 2022 · 7 comments
Closed

Question about the dimension of head #11

PeiqinZhuang opened this issue Apr 21, 2022 · 7 comments
Labels
question Further information is requested

Comments

@PeiqinZhuang
Copy link

PeiqinZhuang commented Apr 21, 2022

Hi, I notice that right now the dimension of the head is fixed as 32 because of the constraint of the Cuda kernel. I wonder what if I change the dimension of the head to 64 since that figure in some codebases is set as 64.

@alihassanijr
Copy link
Member

alihassanijr commented Apr 21, 2022

Hello,
Thank tou for your interest.

We fixed the dimension for our purposes to get a minor speed improvement. You can modify the line #define DIM 32 and change it to 64 and recompile if you're interested in doing that.
We plan to release either a separate version of the kernel with dynamic dims, or merge that into the kernel directly.

@alihassanijr alihassanijr added the enhancement New feature or request label Apr 21, 2022
@XiaoyuShi97
Copy link

Hi, I want to double check that no matter the value of dim and num_heads, the dim of head is always 32?

@alihassanijr
Copy link
Member

Hi,
No, we specifically kept the per-head dim at 32 for our 4 variants, and extended heads for larger variants. That's why we kept it fixed in the kernel.

@alihassanijr
Copy link
Member

alihassanijr commented Apr 30, 2022

Just an update,
You can now use arbitrary dims per head with v0.11 (PR #23 )

@PeiqinZhuang If that resolves your question, feel free to close the issue.

@PeiqinZhuang
Copy link
Author

PeiqinZhuang commented Dec 16, 2022

Just an update, You can now use arbitrary dims per head with v0.11 (PR #23 )

@PeiqinZhuang If that resolves your question, feel free to close the issue.

Hi, I have one question. Should I change the block size from 32 to 64, if I change the default dimension from 32 to 64.

@alihassanijr
Copy link
Member

Sorry, to what exactly are you referring by block size?

@alihassanijr alihassanijr added question Further information is requested and removed enhancement New feature or request labels Dec 30, 2022
@alihassanijr
Copy link
Member

Closing this due to inactivity. If you still have questions feel free to open it back up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants