pytorch / examples

A set of examples around pytorch in Vision, Text, Reinforcement Learning, etc.

Home Page:https://pytorch.org/examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cudnn deterministic not guaranteed when seed already set in imagenet

yzs981130 opened this issue · comments

Context

  • Pytorch version: not related
  • Operating System and version: not related

Your Environment

Expected Behavior

The whole training will be deterministic when the seed is set, according to the annotations here:

warnings.warn('You have chosen to seed training. '
'This will turn on the CUDNN deterministic setting, '
'which can slow down your training considerably! '
'You may see unexpected behavior when restarting '
'from checkpoints.')

Current Behavior

The cudnn.benchmark = true here will indeed introduce nondeterminism, according to PyTorch docs

cudnn.benchmark = True

I will send a pr soon.