ml-explore / ml-explore/mlx-examples

GPU Usage dropping before completion ends

Open
#669 18 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

I have been using the new Command-R+ model in 4-bit mode and consistently observe a drop in GPU utilization immediately after prompt evaluation, as it begins generation/prediction. This leads to significantly reduced performance.

During evaluation:
Screenshot 2024-04-09 at 12 59 42 PM

During generation – drop occurs right before the first token is predicted (i.e. "<PAD>"):
Screenshot 2024-04-09 at 1 01 04 PM

Here's my setup:
Machine: Apple M2 Ultra (cores: 8E+16P+60GPU), 192GB Ram
ProductName: macOS
ProductVersion: 14.3
BuildVersion: 23D56

I have tried with and without setting my memory limit:
sudo sysctl iogpu.wired_lwm_mb=150000

I have tried with and without disabling the cache:
mx.metal.set_cache_limit(0)

Any help would be welcome, because at the moment I am only able to use the llama.cpp implementation of Command-R+, which works without any issues.

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

The issue names no source files or tests. Reproduce Command-R+ in 4-bit mode during generation on the stated M2 Ultra setup, comparing GPU utilization before and after prompt evaluation; done when the cause of the pre-first-token drop is identified and a regression check or clearly verified fix is available.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.