ml-explore / ml-explore/mlx

[Feature] Metal implementation of linalg APIs

Open
#1,392 12 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement low priority
Dominant language
C++
Stars
28.5k
Forks
2.3k
Avg merge
3d 8h
Merged PRs (30d)
62

Description

Describe the bug
The mx.linalg.svd crashes

To Reproduce

Include code snippet

import mlx.core as mx

a = mx.array([ [1., 2], [2, 3] ])

u, singular_values, v_transpose = mx.linalg.svd(a=a)

libc++abi: terminating due to uncaught exception of type std::runtime_error: [SVD::eval_gpu] Metal SVD NYI.

Expected behavior

import numpy as np
import mlx.core as mx

a = mx.array([ [1., 2], [2, 3] ])

u, singular_values, v = np.linalg.svd(a=a)

singular_values
array([4.236068 , 0.23606798], dtype=float32)

Desktop (please complete the following information):
MLX 0.17.2

Additional context
Add any other context about the problem here.

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 running the Python reproduction for mx.linalg.svd and follow the reported SVD GPU path, which currently raises “Metal SVD NYI.” Implementing the missing Metal behavior is complete when the example runs without crashing and produces the expected singular values.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.