Lightning-AI / Lightning-AI/litgpt

Smart choice of the inference algorithm

Open
#1,016 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13.7k
Forks
1.5k
Avg merge
15h 37m
Merged PRs (30d)
1

Description

`generate/base.py` and `generate/chat.py` (uses the former) assume that the model fits in memory.

There's `generate/sequentially.py` and `generate/tp.py` that support using multiple devices.

To streamline the experience, we could have the `chat` or `generate` entrypoints choose one implementation based on the model config (size, sequence length) and available hardware (memory, number of devices). This would require #921.

Contributor guide

Open the contributing guide

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 reading generate/base.py and generate/chat.py, then compare their assumptions with generate/sequentially.py and generate/tp.py. Trace the chat and generate entrypoints and the model configuration and hardware information they can access; done means they select an appropriate implementation for model size, sequence length, available memory, and device count, accounting for the dependency on #921.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.