Operation | Performance Improvement (%) |
---|---|
Attention | 279.11% |
RMSNorm | 392.75% |
RotaryEmbedding | 133.37% |
SwiGLU | 33.53% |
Rebuild Padding | 987% |
Model | Accuracy |
---|---|
LLAMA | 83.01% |
Nakta | 83.01% |
Accuracy drop 없이 2.87배 빠른 모델 구현
repository 를 clone 후 다음 스크립트를 실행해주세요.
chmode +x ./setting.sh
./setting.sh
python convert.py {original weight path} {output path}
스크립트 실행전 weight 의 경로와 tokenizer 의 경로를 수정해주세요.(tokenizer 의 경우 llama original tokenizer.model 경로를 지정해주세요)
chmod +x ./nakta5_test.sh
./nakta5_test.sh
RMSNorm
Rotary Embedding
SwiGLU
Rebuild Padding
Batch Scheduler
*Memory Efficient Attention 의 경우 Pytorch 2.0.0 의 구현을 사용하였음.
- Accuracy Test: https://github.com/EleutherAI/lm-evaluation-harness
- Rotary Embedding, RMSNorm: https://github.com/openai/triton https://github.com/Dao-AILab/flash-attention