Skip to content

Commit 46b7238

Browse files
committed
fix: dml.log_metric() resulting in exception when called from within model code when torch.compile()'ing
1 parent 6cbcd02 commit 46b7238

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

dmlcloud/core/metrics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ def add_metric(self, name: str, metric: torchmetrics.Metric):
146146

147147
self.metrics[name] = metric
148148

149+
@torch.compiler.disable
149150
def log(self, name: str, value: Any, reduction: str = 'mean', **kwargs):
150151
if reduction not in ['mean', 'sum', 'min', 'max', 'cat']:
151152
raise ValueError(f'Invalid reduction {reduction}. Must be one of mean, sum, min, max, cat')

0 commit comments

Comments
 (0)