You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# The flag below controls whether to allow TF32 on cuDNN. This flag defaults to True.
150
150
# We set it to `False` for CI. See https://github.com/pytorch/pytorch/issues/157274#issuecomment-3090791615
151
151
enable_tf32(False)
152
+
# # torch.backends.fp32_precision does not cascade to torch.backends.cudnn.conv.fp32_precision and torch.backends.cudnn.rnn.fp32_precision
153
+
# TODO: Considering move this to `enable_tf32`, or report a bug to `torch`.
154
+
importtorch
155
+
156
+
# In order to set `torch.backends.cudnn.conv.fp32_precision = "ieee"` below (new API), we still need to set this
157
+
# (old API) because it defaults to `True` (and not changed automatically when we change `cudnn.conv.fp32_precision`)
158
+
# and such inconsistency cause `torch` to complain `RuntimeError: PyTorch is checking whether allow_tf32 is enabled for cuDNN without a specific operator name,but the current flag(s) indica
159
+
# te that cuDNN conv and cuDNN RNN have different TF32 flags.This combination indicates that you have used a mix of the legacy and new APIs
160
+
# to set the TF32 flags. We suggest only using the new API to set the TF32 flag(s).`.
161
+
# TODO: report a bug to `torch`
162
+
ifhasattr(torch.backends.cudnn, "allow_tf32"):
163
+
torch.backends.cudnn.allow_tf32=False
164
+
165
+
# This is necessary to make several `test_batching_equivalence` pass (within the tolerance `1e-5`)
0 commit comments