Lightning-AI / Lightning-AI/lightning-thunder

Investigate the difference in speedup between Llama3-8b and Mistral-7B-v0.1

Open
#1,341 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement performance
Dominant language
Python
Stars
1.5k
Forks
121
PR merge metrics
No merged PRs in 30d

Description

## 🚀 Feature

Make Thunder + Mistral-7B-v0.1 as fast as Thunder + Llama3-8b (comparing to Eager mode).

### Motivation
Below are data for:
* Llama3-8b:

![image](https://github.com/user-attachments/assets/953bf346-8192-400b-adea-74597c3bbbde)

* Mistral-7B-v0.1:

![image](https://github.com/user-attachments/assets/a4665d7a-7a7d-4d20-bf6b-6720d710d846)

* Plot comparing them:
![image](https://github.com/user-attachments/assets/86dbfe3e-3092-4994-85b7-acaa939568a6)

The main difference is that Mistral-7B-v0.1 fits into 1 GPU, but Llama3-8b not, so for Llama3-8b we use distributed training.
* Llama-3-8b config:
```
# https://huggingface.co/meta-llama/Meta-Llama-3-8B/blob/main/config.json
dict(
name="Llama-3-8B{}",
hf_config=dict(org="meta-llama", name="Meta-Llama-3-8B{}"),
block_size=8192,
vocab_size=128000,
padded_vocab_size=128256,
n_layer=32,
n_head=32,
n_query_groups=8,
rotary_percentage=1.0,
parallel_residual=False,
bias=False,
norm_class_name="RMSNorm",
mlp_class_name="LLaMAMLP",
intermediate_size=14336,
rope_base=500000
)
```
* Mistral-7B-v0.1 config:
```
dict(
name="Mistral-7B-{}v0.1",
hf_config=dict(org="mistralai", name="Mistral-7B-{}v0.1"),
padded_vocab_size=32000,
block_size=4096, # should be 32768 but sliding window attention is not implemented
n_layer=32,
n_query_groups=8,
rotary_percentage=1.0,
parallel_residual=False,
bias=False,
norm_class_name="RMSNorm",
norm_eps=1e-05,
mlp_class_name="LLaMAMLP",
intermediate_size=14336,
)

```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Llama-3-8B and Mistral-7B-v0.1 comparisons described in the issue, using their supplied model configurations and the Thunder-versus-Eager measurements. Investigate the effect of single-GPU versus distributed training and determine what change would make the speedups comparable; done means the performance gap is explained and the resulting measurements meet the stated goal.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
distributed-systems, machine-learning, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.