mlx icon indicating copy to clipboard operation
mlx copied to clipboard

Request of implantmentation of lgamma function

Open c0nleyinnnn opened this issue 8 months ago • 5 comments

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.

c0nleyinnnn avatar Apr 07 '25 06:04 c0nleyinnnn

Error when trying to feature native MLX accelerated scvi #3268 https://github.com/scverse/scvi-tools/issues/3268

c0nleyinnnn avatar Apr 07 '25 06:04 c0nleyinnnn

@awni I am interested, can I pick this one?

AvikantSrivastava avatar Apr 13 '25 23:04 AvikantSrivastava

@awni I am interested, can I pick this one?

plz plz plz plz plz :)

c0nleyinnnn avatar Apr 19 '25 07:04 c0nleyinnnn

@awni I am interested, can I pick this one?

Any movement on this? Otherwise I'll try my hand at vibe-coding something out.

The PyMC library for Bayesian modeling supports MLX as a backend now, and is attracting user interest. MLX speedups scale with dataset size, which is often enormous for the CLV models in PyMC-Marketing. All CLV models contain log-Gamma in their loss functions, so if we get this added, Bayesian modeling with MLX could really start taking off 🚀

ColtAllen avatar Nov 11 '25 19:11 ColtAllen

@awni I am interested, can I pick this one?

Any movement on this? Otherwise I'll try my hand at vibe-coding something out.

The PyMC library for Bayesian modeling supports MLX as a backend now, and is attracting user interest. MLX speedups scale with dataset size, which is often enormous for the CLV models in PyMC-Marketing. All CLV models contain log-Gamma in their loss functions, so if we get this added, Bayesian modeling with MLX could really start taking off 🚀

please please please

c0nleyinnnn avatar Nov 12 '25 03:11 c0nleyinnnn