Effacer les filtres
Effacer les filtres

CNN Performance: CPU Consistency vs. GPU Variance - Why?

4 vues (au cours des 30 derniers jours)
Hamza
Hamza le 22 Nov 2023
Réponse apportée : Ruth le 23 Nov 2023
Hello everyone,
I have executed CNN code multiple times using rng(0) with CPU and consistently obtained the same result. However, when I attempted to accelerate the training process using the GPU, the results differed. Has anyone else faced this issue?
Thank you in advance!

Réponse acceptée

Ruth
Ruth le 23 Nov 2023
Hi Hamza,
Even when using "gpurng" some small non-deterministic behavior is expected to happen in the GPU during training, particularly during the backward pass. This is out of our control.
However the behavior should be deterministic in the forward pass and subsequently at prediction time.
If one sets the learning rate to be almost zero (e.g. 1e-16, meaning nothing is updated in the backward pass), the output of training (using "rng" and "gpurng") should look deterministic.
Best wishes,
Ruth

Plus de réponses (1)

Edric Ellis
Edric Ellis le 23 Nov 2023
I'm not certain if it will make everything consistent, but note that random state on the GPU is controlled by the gpurng function.
  1 commentaire
Hamza
Hamza le 23 Nov 2023
@Edric Ellis thanks for your answer, I have tried that also and didnt work!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Parallel and Cloud dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by