Lightning-AI / Lightning-AI/litgpt

[Question] Best Practice With Multiple GPUs on 1 node

Open
#711 0 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

Hello, I'm creating a fine-tuned LLM based off of StableLM 3b Tuned model. I used lora.py with 4 Nvidia L4(24 GB) on GCP(I don’t have access to A100 but anything else I do). My observation is that for the amount of compute I'm providing the fine-tuning takes too long and consumes too much VRAM which has led to reducing max-seq-length to 2000 tokens instead of the max of 4096. The fine-tuning dataset is lighteval/legal-summarization on hugging Face and I adapted it to a alpaca format. Here are my questions:

  1. Should I be using different GPU's as I looked at the benchmarks on the github page and it showed 3 min for 1000 iterations (1 A100) while for me it was around 40 minutes?
  2. My dataset's input goes well beyond 4096 tokens, does the lora.py file do any type of chunking or does it just take the first 4096 tokens?
  3. For micro-batch-size of 4 and batches of 128 and max-seq-length of 500 tokens, the gpu utilization on all gpu's was around 18GB (using bf16-true). Shouldn't this be lower for 3B parameter model?
  4. What can I do to make this fine-tuning process faster (should i spawn a cluster of nodes or 1 instance with multiple gpus is enough)?

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 lora.py and the repository's documented multi-GPU fine-tuning entry points, then compare the reported 4×L4 setup with the benchmark cited in the issue. Check how lighteval/legal-summarization inputs are handled at max-seq-length and how bf16-true affects memory; done means a maintainer-confirmed explanation and actionable guidance for the four questions.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, huggingface, python
Domain
cloud, machine-learning
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.