Lightning-AI / Lightning-AI/lightning-thunder

Mixtral 8x7B network support for thunder.jit path

Open
#194 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

## 🚀 Feature

Mixtral 8x7B is a mixture-of-experts LLM that splits the parameters in 8 distinct groups an I would like to do both training and inference with Thunder.

### Work items
- [x] Run `thunder.examine`
- [ ] #124
- [ ] #195
- [x] #187
- [ ] #303
- [ ] Create Mixtral benchmark

### Additional context
Even though `examine` does not signal any problem with the ops, some testing revealed that Mixtral uses `torch.where(condition)` signature of the `torch.where` function which is not supported at the moment. Moreover, the second issue I was able to identify stems from the indexing done in Mixtral forward function. At the moment, the `_advanced_indexing` clang operation does not take into account `None` as a valid index together with other tensors.

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 with the Mixtral forward path and the reported `torch.where(condition)` call, then inspect the `_advanced_indexing` clang operation and run `thunder.examine`. Done means Mixtral training and inference work through the `thunder.jit` path, with the listed indexing and where cases covered and a Mixtral benchmark created.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
compilers, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.