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

[Feature] Infini Attention #169

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2ab9858
add retrieving memory
xrsrke Apr 22, 2024
7659415
add computing the output
xrsrke Apr 22, 2024
936a45b
add linear delta memory update
xrsrke Apr 23, 2024
8f3a61e
fix computing global attention
xrsrke Apr 23, 2024
d681ee5
fix
xrsrke Apr 23, 2024
74545cc
support gqa and new theta
xrsrke Apr 27, 2024
30b95a6
support loading hf ckp
xrsrke Apr 27, 2024
fef75ff
tested, llama3 wiht infini, get 5 loss
xrsrke Apr 27, 2024
234d33d
add gqa optional
xrsrke May 1, 2024
2f50a7b
fix v minus 1 in memory update
xrsrke May 7, 2024
597ff44
noy apply pe to memory
xrsrke May 7, 2024
2e74dd6
use this for exp19
xrsrke May 7, 2024
e36ed87
use this for exp19
xrsrke May 7, 2024
440e674
don't change the max positional encodings
xrsrke May 14, 2024
63cdce5
add generating training data
xrsrke May 14, 2024
f62e1a5
generate finetuning data with a target context length
xrsrke May 15, 2024
b76c61c
fix splitting sequence
xrsrke May 16, 2024
f2c1b91
add logging the internals of neural network
xrsrke May 21, 2024
d1d54f1
add monitor
xrsrke May 23, 2024
c57a3e9
fix sequence splitting
xrsrke May 25, 2024
05c48b3
fix decode for non-megatron-sp
xrsrke May 27, 2024
f3a39b1
backup with new sp splitting, but wrong reduction dimension in infini…
xrsrke May 27, 2024
b1deec5
backup
xrsrke May 29, 2024
4e18fac
save run evals and generate data
xrsrke May 29, 2024
97d3861
save generation
xrsrke May 31, 2024
5a15f2e
add specifying segment length, ctx length, and turn on/off memory fro…
xrsrke May 31, 2024
6273da1
support turning off memory
xrsrke May 31, 2024
18b3ef3
fix modeling code for bs = 1
xrsrke Jun 7, 2024
692b052
fix wrong interdimate activations after splitting qkv with bs > 1
xrsrke Jun 11, 2024
328fb71
code use for exp 33
xrsrke Jun 12, 2024
838cce6
fix inference
xrsrke Jun 13, 2024
25f1f35
refactor passkey retrivial data generation script
xrsrke Jun 19, 2024
dcbe86e
refactor for generating finetuning data and run evals
xrsrke Jun 20, 2024
a6b8b5e
add debugging
xrsrke Jun 25, 2024
15fd9dd
add l2 nor, kurtosis, abmax, weight update magnitude
xrsrke Jun 25, 2024
9ef1f4c
each segment in the attention layer uses the same balance factors
xrsrke Jun 28, 2024
a91d1fe
support custom balance factor's act func, init
xrsrke Jun 30, 2024
962a8e1
it works, backup for exp 57
xrsrke Jul 3, 2024
03b43ea
backup
xrsrke Jul 3, 2024
8aa0ee5
backup before cleaning
xrsrke Jul 29, 2024
75485da
clean up the core parts
xrsrke Aug 2, 2024
3f860fd
clean
xrsrke Aug 2, 2024
0d99cfb
clean
xrsrke Aug 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,15 @@ cython_debug/

checkpoints/
wandb/
*.pkl
examples/infinite-context-length/*.txt

*.json
*.arrow
*.txt
*.out
debug/
llama3_8b_generated_from_brrr/
llama3_8b_generated_from_brrr_tp_8/
llama3_8b_generated_from_brrr_with_pp_4/
examples/infinite-context-length/configs/exp59/
1,515 changes: 1,515 additions & 0 deletions debug_dataset.ipynb

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions debug_exp33.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"from datasets import load_from_disk"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"# DATA_PATH = \"/fsx/phuc/projects/nanotron/examples/infinite-context-length/exp33_eval_data/needle_eval_ctx_len_1024_and_depth_20_and_id_0\"\n",
"# DATA_PATH = \"/fsx/phuc/projects/nanotron/examples/infinite-context-length/exp33_eval_data/needle_eval_ctx_len_1024_and_depth_0_and_id_0\"\n",
"DATA_PATH = \"/fsx/phuc/projects/nanotron/examples/infinite-context-length/exp33_eval_data/needle_eval_ctx_len_1024_and_depth_90_and_id_0\""
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"data = load_from_disk(DATA_PATH)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\"There is a pass key hidden inside a lot of irrelevant text. Find it and memorize them. I will quiz you about what is the pass key later on............................................................... The leaves rustle in the wind. The birds chirp their melodies. The squirrels scamper up the trees. Nature's symphony plays on. Life thrives in the forest.\\nThe city bustles with energy. The skyscrapers touch the clouds. The streets are alive with people. Horns honk and engines roar. The urban jungle never sleeps.\\nThe mountains stand tall and proud. The snow caps their peaks. The valleys are lush and green. Hikers traverse the trails. Adventure awaits in the wilderness.\\nThe stars twinkle in the night sky. The moon casts its gentle glow. The crickets sing their lullabies. Fireflies dance in the darkness. The world is at peace under the celestial blanket.\\nThe waves crash against the shore. The seagulls soar overhead. The sand is warm beneath my feet. I breathe in the salty air. The ocean's embrace is calming.\\nThe leaves rustle in the wind. The birds chirp their melodies. The squirrels scamper up the trees. Nature's symphony plays on. Life thrives in the forest.\\nThe city bustles with energy. The skyscrapers touch the clouds. The streets are alive with people. Horns honk and engines roar. The urban jungle never sleeps.\\nThe mountains stand tall and proud. The snow caps their peaks. The valleys are lush and green. Hikers traverse the trails. Adventure awaits in the wilderness.\\nThe stars twinkle in the night sky. The moon casts its gentle glow. The crickets sing their lullabies. Fireflies dance in the darkness. The world is at peace under the celestial blanket.\\nThe waves crash against the shore. The seagulls soar overhead. The sand is warm beneath my feet. I breathe in the salty air. The ocean's embrace is calming.\\nThe leaves rustle in the wind. The birds chirp their melodies. The squirrels scamper up the trees. Nature's symphony plays on. Life thrives in the forest.\\nThe city bustles with energy. The skyscrapers touch the clouds. The streets are alive with people. Horns honk and engines roar. The urban jungle never sleeps.\\nThe mountains stand tall and proud. The snow caps their peaks. The valleys are lush and green. Hikers traverse the trails. Adventure awaits in the wilderness.\\nThe stars twinkle in the night sky. The moon casts its gentle glow. The crickets sing their lullabies. Fireflies dance in the darkness. The world is at peace under the celestial blanket.\\nThe waves crash against the shore. The seagulls soar overhead. The sand is warm beneath my feet. I breathe in the salty air. The ocean's embrace is calming.\\nThe leaves rustle in the wind. The birds chirp their melodies. The squirrels scamper up the trees. Nature's symphony plays on. Life thrives in the forest.\\nThe city bustles with energy. The skyscrapers touch the clouds. The streets are alive with people. Horns honk and engines roar. The urban jungle never sleeps.\\nThe mountains stand tall and proud. The snow caps their peaks. The valleys are lush and green. Hikers traverse the trails. Adventure awaits in the wilderness.\\nThe stars twinkle in the night sky. The moon casts its gentle glow. The crickets sing their lullabies. Fireflies dance in the darkness. The world is at peace under the celestial blanket.\\nThe waves crash against the shore. The seagulls soar overhead. The sand is warm beneath my feet. I breathe in the salty air. The ocean's embrace is calming.\\nThe leaves rustle in the wind. The birds chirp their melodies. The squirrels scamper up the trees. Nature's symphony plays on. Life thrives in the forest.\\nThe city bustles with energy. The skyscrapers touch the clouds. The streets are alive with people. Horns honk and engines roar.. The pass key is 3. Remember it. 3 is the pass key. The urban jungle never sleeps.\\nThe mountains stand tall and proud. The snow caps their peaks. The valleys are lush and green. Hikers traverse the trails. Adventure awaits in the wilderness.\\nThe stars twinkle in the night sky. The moon casts its gentle glow. The crickets sing their lullabies. Fireflies dance in the darkness. The world iThe waves crash against the shore. The seagulls soar overhead. The sand is warm beneath my feet. I breathe in the salty air. The. \\n\\nWhat is the pass key? The pass key is \""
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data[0][\"prompt\"]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
265 changes: 265 additions & 0 deletions debug_exp34.ipynb

Large diffs are not rendered by default.

Empty file added debug_infini_ckp.ipynb
Empty file.
Loading