[Compute] Add llm.c request encoder kernel reference#151
[Compute] Add llm.c request encoder kernel reference#151jacobthebanana wants to merge 12 commits intomainfrom
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.
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.
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 '\( ... \)'
nerdai
left a comment
There was a problem hiding this comment.
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.
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.
New sentence: "The kernel uses #pragma unroll to automatically optimize this part of the code during compilation."
[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> --openAdditional Context
CUDA Club