vulkpy: GPGPU array on Vulkan
vulkpy is a Python package providing GPGPU computation based on Vulkan.
Requirements
- C++20 compatible compiler
libvulkan- Vulkan SDK
- Headers (
vulkan/vulkan.hppand so on) - Shaderc (
glslc)
- Headers (
On Ubuntu 22.0,
wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | apt-key add -
wget -qO /etc/apt/sources.list.d/lunarg-vulkan-focal.list http://packages.lunarg.com/vulkan/lunarg-vulkan-focal.list
apt update
apt install -y libvulkan1 libvulkan-dev vulkan-headers shaderc vulkan-validationlayers
Note
vulkan-sdkcannot be installed because it requires obsolete packageqt5-default.
Example
import vulkpy as vk
gpu = vk.GPU()
a = vk.Array(gpu, data=[10, 10, 10])
b = vk.Array(gpu, data=[5, 5, 5])
c = a + b
c.wait()
print(c)
# [15, 15, 15]
Features
- Element-wise Arithmetic Operators between 2
Arrays.-
+,-,*,/,**,+=,-=,*=,/=,**=
-
- Arithmetic Operators between
Arrayandfloat.-
+,-,*,/,**,+=,-=,*=,/=,**=
-
- Arithmetic Operators between
floatandArray.-
+,-,*,/,**
-
- Matrix Multiplication Operator between 1d/2d
Arrays.-
@
-
- Element-wise math functions as
Array's member function-
max(other, inplace=False),min(other, inplace=False) -
abs(inplace=False),sign(inplace=False) -
sin(inplace=False),cos(inplace=False),tan(inplace=False) -
asin(inplace=False),acos(inplace=False),atan(inplace=False) -
sinh(inplace=False),cosh(inplace=False),tanh(inplace=False) -
asinh(inplace=False),acosh(inplace=False),atanh(inplace=False) -
exp(inplace=False),log(inplace=False) -
exp2(inplace=False),log2(inplace=False) -
sqrt(inplace=False),invsqrt(inplace=False) -
clamp(min, max, inplace=False)
-
- Reduction as
Array's member function-
sum(axis=None),prod(axis=None) -
maximum(axis=None),minimum(axis=None) -
mean(axis=None) - argmax, argmin
- ...
-
- Other
Arraymethod-
gather(idx: U32Array) -> Array - tensordot, shuffle
- ...
-
- Bloadcast
- Explicit broadcast copy (memory inefficient, fallback option)
broadcast_to(shape)(used atclamp)
- Special implementations for element-wise arithmetic operators
+,-,*,/,**,+=,-=,*=,/=,**=
- Reduction with re-broadcast
sum,prod,maximum,minimum,mean
- Explicit broadcast copy (memory inefficient, fallback option)
- Pseudo Random Number Generator (PRNG)
- xoshiro128++ (
vulkpy.random.Xoshiro128pp(gpu, *, size=None, data=None))[0, 1)uniform (.random(shape=None, buffer=None))- Gaussian with Box-Muller (
.normal(shape=None, buffer=None, mean=0.0, stddev=1.0))
- pcg32
- xoshiro128++ (
- Neural Network
- Layers
-
Dense,ReLU,Sigmoid,Softmax - conv, batch norm, layer norm, ...
-
- Optimizers
-
SGD,Adam,AdaGrad - rmsprop, ...
-
- Losses
-
CrossEntropyLoss,SoftmaxCrossEntropyLoss,MSELoss,HuberLoss - ...
-
- Initializers
-
Constant,HeNormal - ...
-
- Models
-
Sequance - ...
-
- Regularization
Lasso(coeff=1.0),Ridge(coeff=1.0),Elastic(L1=1.0, L2=1.0)
- ONNX support
- Custom user layer with automatic
backward()definition. - Define by Run API
- Layers
Metadata
Release files for vulkpy 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vulkpy-0.0.8.tar.gz | 58.3 kB | Without provenance | Details for vulkpy-0.0.8.tar.gz |
Release files / vulkpy-0.0.8.tar.gz
| Download URL | vulkpy-0.0.8.tar.gz |
|---|---|
| Size | 58.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ae448ec4281dfc7753b8606789d0e77ac0a63895e005e88cff68f7d89b033824
|
|
BLAKE2b-256 checksum How to use checksums |
72319316a67f1659469ece856ffcc06d50383fc7287c552695826aedbf459626
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.3
|
Security for vulkpy 0.0.8
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.