Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numpy/CUDA performance test #5018

Open
satabol opened this issue Oct 15, 2023 · 2 comments
Open

numpy/CUDA performance test #5018

satabol opened this issue Oct 15, 2023 · 2 comments
Labels

Comments

@satabol
Copy link
Collaborator

satabol commented Oct 15, 2023

Sverchok 1.3.0-alpha, Blender 3.6.3, Windows 11.

Performance test numpy/CUDA with node "Generators->Generators Extended->Spiral", mode "Spiral Cornu".

for m in range(M + 1):
u = u + du # u = [l1, l2]
phi = u * u * pi / 2
x = x + cos(phi) * du
y = y + sin(phi) * du

image

Great feature of this method is you can use CUDA-C/C++ inline in python code and many code may be ported just replacing

import numpy as np

to

import cupy as np

but may need a tune. For example: I stuck recursive using np.arange() in vectorize and found than one can use CUDA-C/C++ with for/next and other great feature of C/C++.

image

See:

image
https://cupy.dev/

An Easy Introduction to CUDA C and C++: https://developer.nvidia.com/blog/easy-introduction-cuda-c-and-c/

CUDA C++ Programming Guide: https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html

cupy.ElementwiseKernel: https://docs.cupy.dev/en/stable/reference/generated/cupy.ElementwiseKernel.html

P.S.

May be this technology will incredibly level up of performance of Sverchok?

P.P.S.

I try to use 12.x library cuda-cupy12x:

image

@satabol satabol added Performance 🚀 Proposal 💡 Would be nice to have labels Oct 16, 2023
@zeffii
Copy link
Collaborator

zeffii commented Oct 17, 2023

also numba would speed it up a lot....... a lot!.

the only downside for these external libraries is updates/upgrades/version mismatch issues.

@zeffii
Copy link
Collaborator

zeffii commented Oct 17, 2023

np.ElementWiseKernel(....) looks interesting :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants