mirror of
https://github.com/karpathy/llm.c.git
synced 2026-07-27 20:25:09 -04:00
fix the corner case where T < 256
This commit is contained in:
parent
efa6767a8a
commit
2fd6fee971
1 changed files with 1 additions and 1 deletions
|
|
@ -1733,7 +1733,7 @@ int main(int argc, char *argv[]) {
|
|||
// on cuDNN 9.2.1 with cuDNN FrontEnd 1.5.2, T >= 256 seems bit-for-bit identical
|
||||
// (but even if it wasn't fully identical that's probably not the end of the world)
|
||||
// note this is still somewhat wasteful because we don't have a KV cache!
|
||||
gpt2_forward(&model, gen_tokens, 1, CEIL_DIV(t, 256) * 256);
|
||||
gpt2_forward(&model, gen_tokens, 1, CEIL_DIV(t, min(T,256)) * min(T,256));
|
||||
// get the V-dimensional vector probs[0, t-1, :]
|
||||
floatX* logits = model.acts.output + (t - 1) * model.config.padded_vocab_size;
|
||||
// move probs back to CPU and sample (note we only move the first vocab_size logits, ignoring the padding)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue