Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cudamat/cudamat
Python module for performing basic dense linear algebra computations on the GPU using CUDA.
https://github.com/cudamat/cudamat
cuda linear-algebra python
Last synced: 3 months ago
JSON representation
Python module for performing basic dense linear algebra computations on the GPU using CUDA.
- Host: GitHub
- URL: https://github.com/cudamat/cudamat
- Owner: cudamat
- License: bsd-3-clause
- Created: 2013-08-21T19:27:47.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-05-28T16:30:12.000Z (over 4 years ago)
- Last Synced: 2024-07-31T20:30:43.840Z (6 months ago)
- Topics: cuda, linear-algebra, python
- Language: Python
- Size: 170 KB
- Stars: 607
- Watchers: 38
- Forks: 157
- Open Issues: 30
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
CUDAMat
=======The aim of the cudamat project is to make it easy to perform basic matrix calculations on CUDA-enabled GPUs from Python. cudamat provides a Python matrix class that performs calculations on a GPU. At present, some of the operations our GPU matrix class supports include:
* Easy conversion to and from instances of `numpy.ndarray`.
* Limited slicing support.
* Matrix multiplication and transpose.
* Elementwise addition, subtraction, multiplication, and division.
* Elementwise application of exp, log, pow, sqrt.
* Summation, maximum and minimum along rows or columns.
* Conversion of CUDA errors into Python exceptions.The current feature set of cudamat is biased towards features needed for implementing some common machine learning algorithms. We have included implementations of feedforward neural networks and restricted Boltzmann machines in the examples that come with cudamat.
Example:
```python
import numpy as np
import cudamat as cmcm.cublas_init()
# create two random matrices and copy them to the GPU
a = cm.CUDAMatrix(np.random.rand(32, 256))
b = cm.CUDAMatrix(np.random.rand(256, 32))# perform calculations on the GPU
c = cm.dot(a, b)
d = c.sum(axis = 0)# copy d back to the host (CPU) and print
print(d.asarray())
```Documentation
-------------An overview of the main features of cudamat can be found in the technical report:
[CUDAMat: A CUDA-based matrix class for Python](http://www.cs.toronto.edu/~vmnih/docs/cudamat_tr.pdf), Volodymyr Mnih, UTML TR 2009-004.
Download
--------You can obtain the latest release from the repository by typing:
```bash
git clone https://github.com/cudamat/cudamat.git
```You can also download one of the releases from the [releases](https://github.com/cudamat/cudamat/releases) section.
Installation
------------cudamat uses setuptools and can be installed via pip.
For details, please see [INSTALL.md](INSTALL.md).Development
-----------If you want to contribute new features or improvements, you're welcome to fork
cudamat on github and send us your pull requests!
Please see [CONTRIBUTE.md](CONTRIBUTE.md) if you need any help with that.