CuPy – NumPy-like API accelerated with CUDA
s9738-using-gpu-power-for-numpy-syntax-calculations.pdf sur developer.download.nvidia.com
Difference between CuPy and NumPy — CuPy 7.8.0 documentation sur docs-cupy.chainer.org
sudo pip3 install cupy-cuda102
Avec le script semaphore_ia.py
AMD FX(tm)-8320 Eight-Core Processor
Calcul avec numpy ... numpy ... numpy ... numpy ...
Training: Shot 60000 Lettre 60000; Testing: Shot 10000 Lettre 10000
Training...
type(weight_list :) <class 'list'>
len(weight_list) = 3
0 100
1 100
2 27
weights.npy enregistré
Testing...
Learningrate: 0.023 Résultat 87.4
Calcul en: 139.8 s
Avec le script cupy_ia.py
cupy 7.3
Successfully installed cupy-7.3.0 fastrlock-0.4
Nvidia 1060 GTX
Calcul avec cupy ... cupy ... cupy ... cupy ...
Training: Shot 60000 Lettre 60000; Testing: Shot 10000 Lettre 10000
Training...
type(weight_list :) <class 'list'>
len(weight_list) = 3
0 100 <class 'cupy.core.core.ndarray'>
1 100 <class 'cupy.core.core.ndarray'>
2 27 <class 'cupy.core.core.ndarray'>
weights_cupy.npy enregistré
Testing...
Learningrate: 0.023 Résultat 89.9
Calcul en: 91.7 s
Soit un gain de 34% avec cupy
Il faut vérifier que toutes les datas sont bien chargées dans la RAM GPU: cupy.array docs-cupy.chainer.org: basic