Skip to main content

MATE

Project description

MATE

  • MATE represents Manycore computing for Acceleration of Tensor Execution.

Installation

  • :snake: Anaconda is recommended to use and develop MATE.
  • :penguin: Linux distros are tested and recommended to use and develop MATE.

Install from GitHub repository

First, clone the recent version of this repository.

git clone https://github.com/cxinsys/mate

Now, we need to install MATE as a module.

cd mate
pip install -e .

  • Default backend framework of the 'MATE' class is PyTorch.
  • [recommended] To use PyTorch Lightning framework, you need to use a another class called 'MATELightning' (see MATELightning class)

Install optional frameworks

MATE supports several optional backend frameworks such as CuPy and JAX.
To use optional frameworks, you need to install the framework manually


Install Cupy from Conda-Forge with cudatoolkit supported by your driver

conda install -c conda-forge cupy cuda-version=xx.x (check your CUDA version)

Install JAX with CUDA > 12.x

pip install -U "jax[cuda12]"

Install TensorFlow-GPU with CUDA

python3 -m pip install tensorflow[and-cuda]

Tutorial

MATE class

Create MATE instance

import mate

worker = mate.MATE()

Run MATE

parameters

  • arr: numpy array for transfer entropy calculation, required
  • pair: numpy array for calculation pairs, optional, default: compute possible pairs from all nodes in the arr
  • backend: optional, default: 'cpu'
  • device_ids: optional, default: [0] (cpu), [list of whole gpu devices] (gpu)
  • procs_per_device: The number of processes to create per device when using non 'cpu' devices, optional, default: 1
  • batch_size: required
  • kp: kernel percentile, optional, default: 0.5
  • df: history length, optional, default: 1
result_matrix = worker.run(arr=arr,
                           pairs=pairs,
                           backend=backend,
                           device_ids=device_ids,
                           procs_per_device=procs_per_device,
                           batch_size=batch_size,
                           kp=kp,
                           dt=dt,
                           )

MATELightning class

Create MATELightning instance

parameters

  • arr: numpy array for transfer entropy calculation, required
  • pair: numpy array for calculation pairs, optional, default: compute possible pairs from all nodes in the arr
  • kp: kernel percentile, optional, default: 0.5
  • len_time: total length of expression array, optional, default: column length of array
  • dt: history length of expression array, optional, default: 1
import mate

worker = mate.MATELightning(arr=arr,
                            pairs=pairs,
                            kp=kp,
                            len_time=len_time,
                            dt=dt)

Run MATELightning

parameters

MATELightning's run function parameters take the same values as PyTorch's DataLoader and PyTorch Lightning's Trainer. For additional options for parameters, see those documents

  • backend: required, 'gpu', 'cpu' or 'tpu' etc
  • devices: required, int or [list of device id]
  • batch_size: required
  • num_workers: optional, default: 0
result_matrix = worker.run(backend=backend,
                           devices=devices,
                           batch_size=batch_size,
                           num_worker=num_worker)

TODO

  • add 'jax' backend module
  • implement 'pytorch lightning' backend module
  • add 'tensorflow' backend module

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

mate_cxinsys-0.1.19.tar.gz (553.4 kB view details)

Uploaded Source

Built Distribution

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

mate_cxinsys-0.1.19-py3-none-any.whl (557.2 kB view details)

Uploaded Python 3

File details

Details for the file mate_cxinsys-0.1.19.tar.gz.

File metadata

  • Download URL: mate_cxinsys-0.1.19.tar.gz
  • Upload date:
  • Size: 553.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mate_cxinsys-0.1.19.tar.gz
Algorithm Hash digest
SHA256 de32f6e979b4e2893e80e0fe821e42d058ede819a154c8d5819497944b3ec4f9
MD5 1b676e5801ae438ea1d6bb22b4e01c28
BLAKE2b-256 8c8e0f740597cfa0c8a75a0e6aac360b5fbe105f1d8469a65b768fc3f3865099

See more details on using hashes here.

Provenance

The following attestation bundles were made for mate_cxinsys-0.1.19.tar.gz:

Publisher: publish.yml on cxinsys/mate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mate_cxinsys-0.1.19-py3-none-any.whl.

File metadata

  • Download URL: mate_cxinsys-0.1.19-py3-none-any.whl
  • Upload date:
  • Size: 557.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mate_cxinsys-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 fd2e483953f69a8962dbec8a8c99cf1ff0ab05b857cc6c8cab48232c070c3f20
MD5 64d20bf1ae9fe75012d6a57c007e22e1
BLAKE2b-256 6c198d81948983a0f6c7f5ad8b0e4433d04d46752c8afa1f133ecdb48321b846

See more details on using hashes here.

Provenance

The following attestation bundles were made for mate_cxinsys-0.1.19-py3-none-any.whl:

Publisher: publish.yml on cxinsys/mate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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