We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c85660c commit 7d45effCopy full SHA for 7d45eff
src/lightning/pytorch/plugins/precision/amp.py
@@ -112,7 +112,11 @@ def clip_gradients(
112
super().clip_gradients(optimizer=optimizer, clip_val=clip_val, gradient_clip_algorithm=gradient_clip_algorithm)
113
114
def autocast_context_manager(self) -> torch.autocast:
115
- return torch.autocast(self.device, dtype=(torch.bfloat16 if self.precision == "bf16-mixed" else torch.half))
+ return torch.autocast(
116
+ self.device,
117
+ dtype=(torch.bfloat16 if self.precision == "bf16-mixed" else torch.half),
118
+ cache_enabled=False
119
+ )
120
121
@override
122
@contextmanager
0 commit comments