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

[WIP] initial curand implementation for model init #741

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ngc92
Copy link
Contributor

@ngc92 ngc92 commented Aug 13, 2024

as an alternative to the multi-threaded model init, this uses curand to generate initial weights directly on the GPU.
It is still work-in-progress, needs error-checking, and I dislike the cudamalloc inside the loop, but it should be enough to measure how much speed-up we would get.

@ngc92
Copy link
Contributor Author

ngc92 commented Aug 14, 2024

cudaMemset works on the level of individual bytes; we want to set floats or bf16s here; for zero, conveniently repeating the bit-pattern 0 also implies the number zero, so you can use it to initialize floats to 0.0; but unless your desired float has the same bits in every byte, it isn't going to work for other values.

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.

1 participant