-
Notifications
You must be signed in to change notification settings - Fork 7
[Compute] Add llm.c request encoder kernel reference #151
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
base: main
Are you sure you want to change the base?
Conversation
@jacobthebanana can you kindly sync your local repo and force push the commit after? |
e6876be
to
d204529
Compare
Hi @jacobthebanana, I had to clean up your PR quite a bit, and in doing so, I hope I didn't modify the core of your contribution, namely your Here's what I had to do:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit but can we change the title to "# Forward Pass Kernels of Positional Embeddings within GPT-2"
can be proceessed with the remainder of the transformer blocks: | ||
|
||
- Input: | ||
- "input" `inp`, produced by the tokenizer- An integer array of shape $(B,\, T)$, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in-line math in the mdbook's render of markdown math doesn't use single "$" as delimeters. Rather it uses '\( \)'. Please replace this and all instances of '$ ... $' with '\( ... \)'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jacobthebanana for the pocket ref contribution! After cleaning up your PR, I was able to make a first pass at reviewing the core content. Left a few comments
|
||
#### References | ||
|
||
1. Code for encoder forward kernels from [llm.c](https://github.com/karpathy/llm.c/blob/master/dev/cuda/encoder_forward.cu) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also change this to MLA style
[_Karpathy, Andrej. "encoder_forward.cu." llm.c, GitHub, accessed 10 Apr. 2025, github.com/karpathy/llm.c/blob/master/dev/cuda/encoder_forward.cu._](https://github.com/karpathy/llm.c/blob/master/dev/cuda/encoder_forward.cu)
this feature to make processing a lot more efficient. | ||
|
||
While in the kernel, the additions are defined in a for-loop across the $\texttt{x128::size}$, | ||
one floating point number at a time, the kernel uses `#pragma unroll` to automatically |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New sentence: "The kernel uses #pragma unroll
to automatically optimize this part of the code during compilation."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reads well! :)
[NLP] Add llm.c request encoder kernel reference
Type of Change
Fixes #
Book
Description
Add LLM.C encoder forwarder references.
Checklist
{{#author}}
or{{#authors}}
)mdbook watch books/<book-name> --open
Additional Context
CUDA Club