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.3

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.3.tar.gz (6.5 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.3-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jeig-0.2.3.tar.gz
  • Upload date:
  • Size: 6.5 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.3.tar.gz
Algorithm Hash digest
SHA256 04afae11f5ec33bd411f66d2c3352ce27940b9005b00740c05a74dfdf6b55d5e
MD5 a137778bf6f182220e43ec637a9ad075
BLAKE2b-256 7b0f07bfdd21b5148fb52c8cffe76687685a36a00fecbba187f95696d46d53f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jeig-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 6.4 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 64ffdbf075fa9078db588fae8750740caa9f8b18711bb8dc3fc4adf275256a06
MD5 4c5b50c602fc2909a2cefff446a44931
BLAKE2b-256 27e670d788f2999292770d1f51e682615dfb068f9440b4f154e700e4433a66fe

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