MCPcopy Index your code
hub / github.com/BlinkDL/LinearAttentionArena

github.com/BlinkDL/LinearAttentionArena @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
101 symbols 228 edges 9 files 1 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

LinearAttentionArena

Here we will test various linear attention designs.

pip install pytorch-lightning==1.9.5 torch deepspeed wandb ninja --upgrade

RWKV-6.0b differences (vs RWKV-6.0): GroupNorm => LayerNorm, and remove "gate" in TimeMix, so the params count is lower.

# Example: RWKV-6.0b L12-D768 (189M params) on 4x4090, minipile 1.5B tokens loss 2.812

./prepare.sh --model_type "x060b" --layer 12 --emb 768 --ctx_len 512 --suffix "-0"

./train.sh --model_type "x060b" --layer 12 --emb 768 --lr_init "6e-4" --lr_final "2e-4" --ctx_len 512 --n_gpu 4 --m_bsz 32 --grad_cp 0 --save_period 1000 --suffix "-0"
# Example: Mamba L12-D768 (191M params) on 4x4090, minipile 1.5B tokens loss 2.885

./prepare.sh --model_type "mamba" --layer 12 --emb 768 --ctx_len 512 --suffix "-0"

./train.sh --model_type "mamba" --layer 12 --emb 768 --lr_init "6e-4" --lr_final "2e-4" --ctx_len 512 --n_gpu 4 --m_bsz 32 --grad_cp 0 --save_period 1000 --suffix "-0"

rwkv-x060b-mamba

Core symbols most depended-on inside this repo

print_rank_0
called by 7
src/binidx.py
write
called by 6
src/binidx.py
data_file_path
called by 3
src/binidx.py
get
called by 3
src/binidx.py
my_save
called by 3
src/trainer.py
_warmup_mmap_file
called by 2
src/binidx.py
index_file_path
called by 2
src/binidx.py
_do_init
called by 2
src/binidx.py

Shape

Method 64
Function 22
Class 15

Languages

Python92%
C++8%

Modules by API surface

src/model.py39 symbols
src/binidx.py34 symbols
src/utils.py8 symbols
src/trainer.py8 symbols
src/dataset.py4 symbols
cuda/wkv6_op.cpp4 symbols
cuda/wkv5_op.cpp4 symbols

For agents

$ claude mcp add LinearAttentionArena \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact