ml-explore / ml-explore/mlx

Request of implantmentation of lgamma function

Open
#2,050 5 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

I am trying to port an mlx implementation of the SCVI module of scvi-tools (a comprehensive de-batching approach using VAE models), which currently overcomes the problem of mlx.array not supporting scipy sparse matrices by converting the sparse matrices to dense matrices, but in practice I can only use python's internal lanczos approximation due to the lack of a native C++ backend lgamma function (something like torch.lgamma or jax.scipy.special.gamma) which leads to a severely limited code with high training loss, and I would like to request the implementation of a built in gamma as well as the lgamma function since I am completely lacking in C code capabilities.

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 files or tests. Start by locating MLX's native C++ math-function entry points and existing special-function tests, then compare the requested gamma and lgamma behavior with the cited torch and JAX references. Done means both functions are available as built-in MLX operations with coverage for their expected behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.