Skip to content

Commit b35ca2c

Browse files
janselpytorchmergebot
authored andcommitted
Better error message for misconfigured torchbench model (#114827)
``` File "/home/jansel/pytorch/./benchmarks/dynamo/torchbench.py", line 381, in load_model benchmark_cls.name = model_name AttributeError: 'NoneType' object has no attribute 'name ``` becomes ``` File "/home/jansel/pytorch/./benchmarks/dynamo/torchbench.py", line 381, in load_model raise NotImplementedError(f"{model_name}.Model is None") NotImplementedError: torchrec_dlrm.Model is None ``` Pull Request resolved: #114827 Approved by: https://github.com/xuzhao9, https://github.com/yanboliang
1 parent 57e4820 commit b35ca2c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

benchmarks/dynamo/torchbench.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,9 @@ def load_model(
377377
else:
378378
raise ImportError(f"could not import any of {candidates}")
379379
benchmark_cls = getattr(module, "Model", None)
380+
if benchmark_cls is None:
381+
raise NotImplementedError(f"{model_name}.Model is None")
382+
380383
if not hasattr(benchmark_cls, "name"):
381384
benchmark_cls.name = model_name
382385

0 commit comments

Comments
 (0)