Skip to main content

Various eigendecomposition implementations wrapped for jax.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

jeig - Eigendecompositions wrapped for jax

v0.2.2

Overview

This package wraps eigendecompositions as provided by jax, 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.4.37 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), (16, 1024, 1024))

%timeit jax.block_until_ready(jeig.eig(matrix, backend="jax"))

%timeit jax.block_until_ready(jeig.eig(matrix, backend="magma"))

%timeit jax.block_until_ready(jeig.eig(matrix, backend="numpy"))

%timeit jax.block_until_ready(jeig.eig(matrix, backend="scipy"))

%timeit jax.block_until_ready(jeig.eig(matrix, backend="torch"))
6.81 s ± 54.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
1min 15s ± 1.35 s per loop (mean ± std. dev. of 7 runs, 1 loop each)
28.6 s ± 341 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
14.8 s ± 396 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
1.43 s ± 77.7 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jeig-0.2.2.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jeig-0.2.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file jeig-0.2.2.tar.gz.

File metadata

  • Download URL: jeig-0.2.2.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for jeig-0.2.2.tar.gz
Algorithm Hash digest
SHA256 c4400a567db5aef563de584e408818df3b25621a24eed4bd86131fa1aeab88e6
MD5 d06848fb47b8935d0992689bef309b26
BLAKE2b-256 f4166b1f6bfef06f76d720ca3dfa7e80c33b466699a3417ea66cb7848580ff47

See more details on using hashes here.

File details

Details for the file jeig-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: jeig-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for jeig-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 be08b3c1b9b0f20d2358017638de25fc7c701d72fda9257e98dbe72eff7d736a
MD5 4263d776c79dd44c4ebd42bbe9efea2a
BLAKE2b-256 e40f2a48c5aa47fb31266a4c3adeecef3bf985bc419d69236e1754136a4967a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page