cupy_vs_numpy
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
cupy_vs_numpy [2020/04/07 13:33] – serge | cupy_vs_numpy [2020/09/06 13:51] (Version actuelle) – [Comment adapter un fichier numpy en cupy] serge | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== Cupy: calcul numpy avec CUDA ====== | ====== Cupy: calcul numpy avec CUDA ====== | ||
- | <WRAP center round box 60% centeraling> | + | <WRAP center round box 70% centeralign> |
**CuPy – NumPy-like API accelerated with CUDA** | **CuPy – NumPy-like API accelerated with CUDA** | ||
</ | </ | ||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
===== Ressources ===== | ===== Ressources ===== | ||
* **Un pdf de présentation de [[https:// | * **Un pdf de présentation de [[https:// | ||
- | {{: | + | {{: |
- | {{: | + | {{: |
- | {{: | + | {{: |
* **[[https:// | * **[[https:// | ||
* **[[https:// | * **[[https:// | ||
Ligne 25: | Ligne 28: | ||
* **scipy** | * **scipy** | ||
* **opencv** | * **opencv** | ||
- | =====Mesure des temps d'exécution d'un script | + | =====Installation===== |
+ | sudo pip3 install cupy-cuda102 | ||
+ | |||
+ | =====Comment adapter un fichier numpy en cupy===== | ||
+ | [[https:// | ||
+ | |||
+ | |||
+ | =====Exemple avec l'intelligence du sémaphore===== | ||
+ | * Exemple avec: [[l_intelligence_du_semaphore|L'intelligence du sémaphore]] | ||
+ | * [[https:// | ||
+ | |||
+ | ====Numpy==== | ||
+ | Avec le script | ||
+ | < | ||
+ | AMD FX(tm)-8320 Eight-Core Processor | ||
+ | |||
+ | Calcul | ||
+ | Training: Shot 60000 Lettre 60000; Testing: Shot 10000 Lettre 10000 | ||
+ | Training... | ||
+ | type(weight_list :) <class ' | ||
+ | len(weight_list) = 3 | ||
+ | 0 100 | ||
+ | 1 100 | ||
+ | 2 27 | ||
+ | weights.npy enregistré | ||
+ | Testing... | ||
+ | Learningrate: | ||
+ | Calcul en: 139.8 s | ||
+ | </ | ||
+ | |||
+ | ====Cupy==== | ||
+ | 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 ' | ||
+ | len(weight_list) = 3 | ||
+ | 0 100 <class ' | ||
+ | 1 100 <class ' | ||
+ | 2 27 <class ' | ||
+ | weights_cupy.npy enregistré | ||
+ | Testing... | ||
+ | Learningrate: | ||
+ | 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 | ||
+ | [[https:// | ||
+ | ===== OpenCV | ||
+ | https:// | ||
- | <WRAP center round todo 60%> | ||
- | suite .... | ||
- | </ | ||
- | {{tag> | + | {{tag> |
cupy_vs_numpy.1586266408.txt.gz · Dernière modification : 2020/04/07 13:33 de serge