Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

jeig - Eigendecompositions wrapped for jax

Continuous integration PyPI version

Overview

This package wraps eigendecompositions as provided by jax, cusolver, magma, numpy, scipy, and torch for use with jax. Depending upon your system and your versions of these packages, you may observe significant speed differences. The following were obtained using jax 0.8.0 on a system with 28-core Intel Xeon w7-3465X and NVIDIA RTX4090.

Speed comparison

Install

jeig can be installed via pip,

pip install jeig

This will also install torch. If you only need torch for use with jeig, then the CPU-only version could be sufficient and you may wish to install manually as described in the pytorch docs.

Example usage

import jax
import jeig

matrix = jax.random.normal(jax.random.PRNGKey(0), (1, 2048, 2048)).astype(complex)

%timeit jax.block_until_ready(jeig.eig(matrix, backend="cusolver"))
%timeit jax.block_until_ready(jeig.eig(matrix, backend="lapack"))
%timeit jax.block_until_ready(jeig.eig(matrix, backend="magma"))
%timeit jax.block_until_ready(jeig.eig(matrix, backend="torch"))
1.31 s ± 43 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
5.44 s ± 379 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
11.1 s ± 937 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
4.93 s ± 92.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

The default torch backend has good performance when performing batched eigendecomposition on many-core CPUs.

matrix = jax.random.normal(jax.random.PRNGKey(0), (8, 2048, 2048)).astype(complex)

%timeit jax.block_until_ready(jeig.eig(matrix, backend="cusolver"))
%timeit jax.block_until_ready(jeig.eig(matrix, backend="lapack"))
%timeit jax.block_until_ready(jeig.eig(matrix, backend="magma"))
%timeit jax.block_until_ready(jeig.eig(matrix, backend="torch"))
10.4 s ± 116 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
48.1 s ± 6.74 s per loop (mean ± std. dev. of 7 runs, 1 loop each)
1min 33s ± 1.49 s per loop (mean ± std. dev. of 7 runs, 1 loop each)
7.18 s ± 91.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

Credit

The torch implementation of eigendecomposition is due to a comment by @YouJiacheng.

Metadata

Release files for jeig 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jeig 0.5.1
File Size Uploaded Provenance Actions
jeig-0.5.1.tar.gz 7.5 kB Without provenance Details for jeig-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jeig 0.5.1
File Interpreter ABI Platform Actions
jeig-0.5.1-py3-none-any.whl Python 3 none any Details for jeig-0.5.1-py3-none-any.whl

Total release size: 13.8 kB

Release files / jeig-0.5.1.tar.gz

Download URL jeig-0.5.1.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bdc0846cbd84cd8c48e56ed616490f1a0dca3952aff9e6199d6a340fc8647a34
BLAKE2b-256 checksum
How to use checksums
3f42b95626c73ce8835cb4b74a2ab067fbaddd83f643e3e83e6ab352231a4654
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / jeig-0.5.1-py3-none-any.whl

Download URL jeig-0.5.1-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5b22841d81a5b511bcf1353c9bbe68e005a585e3641600ee2552be85ca5d184
BLAKE2b-256 checksum
How to use checksums
07dcedafbd0164ca25695be3240f149fec0dd607643c0d60ee23f47818843694
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for jeig 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page