lm-sys / lm-sys/FastChat

Unable to use --gpus to load model onto specific GPU

Open
#2,360 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
39.5k
Forks
4.8k
PR merge metrics
No merged PRs in 30d

Description

This is using vicuna-13b. I have not found a way to use `--gpus` to successfully utilize a specific GPU. With my workaround for issue #2359, I am able to use `num_gpus 1` which assigns GPU 0 by default.

Using `--gpus 1` or `--gpus 0` (with or without `--num-gpus 1`) fails with `RuntimeError: device >= 0 && device < num_gpus INTERNAL ASSERT FAILED at "../aten/src/ATen/cuda/CUDAContext.cpp":50, please report a bug to PyTorch`

Interestingly, if I `export CUDA_VISIBLE_DEVICES=1` then the --gpus assignment works as expected, even when specifying `--gpus 0`, which allows me to run on the same machine two worker processes, one assigned to each GPU.

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

No files or tests are mentioned. Start by reproducing the vicuna-13b commands with --gpus 1 and --gpus 0, then compare them with the CUDA_VISIBLE_DEVICES=1 workaround. Done means selecting a specific GPU with --gpus works without the PyTorch device assertion failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.