-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
add llama 3 support to llm.c #754
base: master
Are you sure you want to change the base?
Commits on Sep 13, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 09b47a7 - Browse repository at this point
Copy the full SHA 09b47a7View commit details -
first set of changes to match up the .py and the .cu version. default…
… hyperparameters, introduce int+float section of header, read the header and EXIT for now
Configuration menu - View commit details
-
Copy full SHA for 01bc4c6 - Browse repository at this point
Copy the full SHA 01bc4c6View commit details -
change the export code of Llama 3 to be very GPT-2 friendly, using a …
…combination of 3 hacks. this will make it so that we have to change very little code on the C side
Configuration menu - View commit details
-
Copy full SHA for b883560 - Browse repository at this point
Copy the full SHA b883560View commit details
Commits on Sep 16, 2024
-
adapt the sizes of all the parameter tensors and load them from file.…
… so now we are loading all the Llama 3 weights. I verified that the sizes of all the tensors agree with python, and the total number of parameters
Configuration menu - View commit details
-
Copy full SHA for 8866308 - Browse repository at this point
Copy the full SHA 8866308View commit details -
Configuration menu - View commit details
-
Copy full SHA for 45026f6 - Browse repository at this point
Copy the full SHA 45026f6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 77e1d7a - Browse repository at this point
Copy the full SHA 77e1d7aView commit details -
add new Encoder that does not use positional embeddings, like in llam…
…a 3. The activations match after encoding. onwards
Configuration menu - View commit details
-
Copy full SHA for 72e6f1a - Browse repository at this point
Copy the full SHA 72e6f1aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 234de31 - Browse repository at this point
Copy the full SHA 234de31View commit details
Commits on Sep 17, 2024
-
move debugging into fp32, so python has to write the fp32 version, an…
…d then we are focusing on the non-cudnn path at first. we're currently right after the first rmsnorm. the encoding right before this matched EXACTLY. but right now, after the first rmsnorm there is already an error of 1e-3 or so, which is highly suspicious so we are looking into it.
Configuration menu - View commit details
-
Copy full SHA for 508c474 - Browse repository at this point
Copy the full SHA 508c474View commit details -
Configuration menu - View commit details
-
Copy full SHA for 685617f - Browse repository at this point
Copy the full SHA 685617fView commit details
Commits on Sep 21, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 56f956c - Browse repository at this point
Copy the full SHA 56f956cView commit details
Commits on Sep 22, 2024
-
DRAFT: Adding backward kernel for repkv
- [ ] WIP: CPU kernel - [ ] Cuda kernel
Configuration menu - View commit details
-
Copy full SHA for 45401b4 - Browse repository at this point
Copy the full SHA 45401b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 080e57f - Browse repository at this point
Copy the full SHA 080e57fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c68657 - Browse repository at this point
Copy the full SHA 6c68657View commit details -
Configuration menu - View commit details
-
Copy full SHA for ad46043 - Browse repository at this point
Copy the full SHA ad46043View commit details -
Configuration menu - View commit details
-
Copy full SHA for 42d09e8 - Browse repository at this point
Copy the full SHA 42d09e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for fcc3466 - Browse repository at this point
Copy the full SHA fcc3466View commit details
Commits on Sep 24, 2024
-
Configuration menu - View commit details
-
Copy full SHA for de9c817 - Browse repository at this point
Copy the full SHA de9c817View commit details -
integrate the repkv kernel with minor changes. use the bt4c buffer fo…
…r the replication. rope is next
Configuration menu - View commit details
-
Copy full SHA for 76b40e4 - Browse repository at this point
Copy the full SHA 76b40e4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 026e4ed - Browse repository at this point
Copy the full SHA 026e4edView commit details
Commits on Sep 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8336d2a - Browse repository at this point
Copy the full SHA 8336d2aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2ebf8f6 - Browse repository at this point
Copy the full SHA 2ebf8f6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 52c7254 - Browse repository at this point
Copy the full SHA 52c7254View commit details -
Merge pull request #769 from gordicaleksa/fused_rmsnorm
Fused rmsnorm reference
Configuration menu - View commit details
-
Copy full SHA for 6538df6 - Browse repository at this point
Copy the full SHA 6538df6View commit details -
Configuration menu - View commit details
-
Copy full SHA for bb3c92d - Browse repository at this point
Copy the full SHA bb3c92dView commit details -
1
Configuration menu - View commit details
-
Copy full SHA for 1826752 - Browse repository at this point
Copy the full SHA 1826752View commit details -
forward pass matchesgit add train_llama3.cu train_llama3.py ! losses …
…are the same. now comes the backward pass
Configuration menu - View commit details
-
Copy full SHA for 0731b39 - Browse repository at this point
Copy the full SHA 0731b39View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8874c2c - Browse repository at this point
Copy the full SHA 8874c2cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3e5134d - Browse repository at this point
Copy the full SHA 3e5134dView commit details
Commits on Sep 26, 2024
-
Updated repkv_backward cuda kernel
- kernel 1 is tested - build ``` make repkv_backward /usr/local/cuda/bin/nvcc -O3 --use_fast_math --generate-code arch=compute_80,code=[compute_80,sm_80] -lcublas -lcublasLt -std=c++17 repkv_backward.cu -o repkv_backward ``` - test run on A30 ``` Using kernel 1 Checking block size 32. 0.531524 0.531524 0.600285 0.600285 0.458787 0.458787 0.296680 0.296680 -0.911627 -0.911627 Checking block size 64. 0.531524 0.531524 0.600285 0.600285 0.458787 0.458787 0.296680 0.296680 -0.911627 -0.911627 Checking block size 128. 0.531524 0.531524 0.600285 0.600285 0.458787 0.458787 0.296680 0.296680 -0.911627 -0.911627 Checking block size 256. 0.531524 0.531524 0.600285 0.600285 0.458787 0.458787 0.296680 0.296680 -0.911627 -0.911627 Checking block size 512. 0.531524 0.531524 0.600285 0.600285 0.458787 0.458787 0.296680 0.296680 -0.911627 -0.911627 Checking block size 1024. 0.531524 0.531524 0.600285 0.600285 0.458787 0.458787 0.296680 0.296680 -0.911627 -0.911627 All results match. Starting benchmarks. block_size 32 time 3.2461 ms block_size 64 time 1.7509 ms block_size 128 time 1.7374 ms block_size 256 time 1.7441 ms block_size 512 time 1.8092 ms block_size 1024 time 2.0443 ms ```
Configuration menu - View commit details
-
Copy full SHA for d1f2f64 - Browse repository at this point
Copy the full SHA d1f2f64View commit details -
add rmsnorm backward in dev/cuda, it seems to work surprisingly, and …
…is probably ready to be integrated into llmc. we are still using 2X too much shared memory because I didn't want to change way too many things at the same time. I copy pasted our kernel10 of layernorm backward and made tweaks to it removing the bias and mean cool
Configuration menu - View commit details
-
Copy full SHA for 31be5e7 - Browse repository at this point
Copy the full SHA 31be5e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for a2b66f1 - Browse repository at this point
Copy the full SHA a2b66f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 102067f - Browse repository at this point
Copy the full SHA 102067fView commit details -
integrate our rmsnorm backward and move the other rmsnorm functions i…
…nto rmsnorm.cuh that is a new file
Configuration menu - View commit details
-
Copy full SHA for 2c4b3cc - Browse repository at this point
Copy the full SHA 2c4b3ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for cbf53e3 - Browse repository at this point
Copy the full SHA cbf53e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 01c2895 - Browse repository at this point
Copy the full SHA 01c2895View commit details
Commits on Sep 27, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1b54612 - Browse repository at this point
Copy the full SHA 1b54612View commit details -
Merge pull request #764 from insop/insop/llama3
Adding backward kernel for repkv on `llama3` branch (cudamode-irl)
Configuration menu - View commit details
-
Copy full SHA for c8b348e - Browse repository at this point
Copy the full SHA c8b348eView commit details -
small fixes, but still not too happy with this kernel, it wastes thre…
…ad and more efficient implementation kernel2 is desireable and desired
Configuration menu - View commit details
-
Copy full SHA for 28e4a7f - Browse repository at this point
Copy the full SHA 28e4a7fView commit details -
just pushing what i have. it's epsilon away from working sigh. basica…
…lly at this point of where prints happen, gradients match. but once we backward attention, rope and repkv, gradients don't match. attention hasn't changed so that can't be wrong (?), so it's either repkv or rope. i have to go slower and double check the backward pass of both of these in detail. also had to introduce one more additional buffer for backward
Configuration menu - View commit details
-
Copy full SHA for 075e430 - Browse repository at this point
Copy the full SHA 075e430View commit details -
add backward kernel to dev/cuda for rope, to ensure correctness. but …
…i mean, it's trivial. this can't possibly be the issue. it must be the repkv
Configuration menu - View commit details
-
Copy full SHA for 8d49062 - Browse repository at this point
Copy the full SHA 8d49062View commit details -
reshuffle repkv a bit, i wrote it from scratch. the kernel is still c…
…orrect. repkv backward looks correct. rope backward is trivial so i don't see how it's not correct, and i also checked it. basically i'm really confused right now
1Configuration menu - View commit details
-
Copy full SHA for 7d945e9 - Browse repository at this point
Copy the full SHA 7d945e9View commit details
Commits on Oct 1, 2024
-
fix bug with qkvr sizing, has to be 3*C. Credit to @ademeure for find…
…ing this bug and bringing light to darkness and order to chaos. A true warrior in the fight against entropy.
Configuration menu - View commit details
-
Copy full SHA for e6481b6 - Browse repository at this point
Copy the full SHA e6481b6View commit details -
ok the full backward now shows max abs diff of 3e-3, except for the e…
…ncoder backward (that's coming next). i think 3e-3 seems ok just inspecting the differences manually. probably this is correct. encoder backward next
Configuration menu - View commit details
-
Copy full SHA for 9099a0a - Browse repository at this point
Copy the full SHA 9099a0aView commit details -
take out debugging stuff. we can now run training loop for both model…
…s. they don't match yet
Configuration menu - View commit details
-
Copy full SHA for c746e06 - Browse repository at this point
Copy the full SHA c746e06View commit details -
BF16 opt state (m/v) with stochastic rounding, seems to work really w…
…ell (OPTIMIZER_LOW_PRECISION=1)
Configuration menu - View commit details
-
Copy full SHA for 2602b46 - Browse repository at this point
Copy the full SHA 2602b46View commit details -
Merge pull request #772 from ademeure/llama3_arun_new
BF16 opt state (m/v) with stochastic rounding (Llama3 branch)
Configuration menu - View commit details
-
Copy full SHA for d808d78 - Browse repository at this point
Copy the full SHA d808d78View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2c5ced6 - Browse repository at this point
Copy the full SHA 2c5ced6View commit details