Repository: pytorch/benchmark
Issue: fambench_dlrm fails to load and uses jit when `jit=False`
Root cause: Configuration Error

Using [torchbench.py](https://github.com/facebookresearch/torchdynamo/blob/main/torchbench.py):
```
$ ./torchbench.py -k fambench_dlrm --nothing
Unable to import mlperf_logging,  No module named 'mlperf_logging'
ERROR:__main__:failed to load model: fambench_dlrm
Traceback (most recent call last):
  File "./torchbench.py", line 151, in load_model
    return load_model_(device, model_name, is_training, use_eval_mode)
  File "./torchbench.py", line 171, in load_model_
    benchmark = benchmark_cls(
  File "/home/jansel/torchbenchmark/torchbenchmark/util/model.py", line 15, in __call__
    obj.__post__init__()
  File "/home/jansel/torchbenchmark/torchbenchmark/util/model.py", line 97, in __post__init__
    apply_opt_args(self, self.opt_args)
  File "/home/jansel/torchbenchmark/torchbenchmark/util/extra_args.py", line 105, in apply_opt_args
    model.set_module(enable_jit(model=module, example_inputs=exmaple_inputs, test=model.test))
  File "/home/jansel/torchbenchmark/torchbenchmark/util/backends/jit.py", line 8, in enable_jit
    model = torch.jit.script(model, example_inputs=[example_inputs, ])
  File "/home/jansel/pytorch/torch/jit/_script.py", line 1266, in script
    return torch.jit._recursive.create_script_module(
  File "/home/jansel/pytorch/torch/jit/_recursive.py", line 453, in create_script_module
    concrete_type = get_module_concrete_type(nn_module, share_types)
  File "/home/jansel/pytorch/torch/jit/_recursive.py", line 404, in get_module_concrete_type
    concrete_type = concrete_type_store.get_or_create_concrete_type(nn_module)
  File "/home/jansel/pytorch/torch/jit/_recursive.py", line 345, in get_or_create_concrete_type
    concrete_type_builder = infer_concrete_type_builder(nn_module)
  File "/home/jansel/pytorch/torch/jit/_recursive.py", line 210, in infer_concrete_type_builder
    sub_concrete_type = get_module_concrete_type(item, share_types)
  File "/home/jansel/pytorch/torch/jit/_recursive.py", line 404, in get_module_concrete_type
    concrete_type = concrete_type_store.get_or_create_concrete_type(nn_module)
  File "/home/jansel/pytorch/torch/jit/_recursive.py", line 345, in get_or_create_concrete_type
    concrete_type_builder = infer_concrete_type_builder(nn_module)
  File "/home/jansel/pytorch/torch/jit/_recursive.py", line 210, in infer_concrete_type_builder
    sub_concrete_type = get_module_concrete_type(item, share_types)
  File "/home/jansel/pytorch/torch/jit/_recursive.py", line 404, in get_module_concrete_type
    concrete_type = concrete_type_store.get_or_create_concrete_type(nn_module)
  File "/home/jansel/pytorch/torch/jit/_recursive.py", line 345, in get_or_create_concrete_type
    concrete_type_builder = infer_concrete_type_builder(nn_module)
  File "/home/jansel/pytorch/torch/jit/_recursive.py", line 247, in infer_concrete_type_builder
    concrete_type_builder.add_constant(name, _get_valid_constant(name, value, type(nn_module).__name__))
  File "/home/jansel/pytorch/torch/jit/_recursive.py", line 107, in _get_valid_constant
    raise TypeError(textwrap.dedent("""
TypeError: 
'numpy.int64' object in attribute 'EmbeddingBag.num_embeddings' is not a valid constant.
Valid constants are:
1. a nn.ModuleList
2. a value of type {bool, float, int, str, NoneType, torch.device, torch.layout, torch.dtype}
3. a list or tuple of (2)
```

1) this model is failing to load
2) this model is call `jit.script()` even though I set `jit=False`

This is strange, I couldn't reproduce it, here is the output of `$ ./torchbench.py -k fambench_dlrm --nothing`:
```
Unable to import mlperf_logging,  No module named 'mlperf_logging'
cpu  eval  fambench_dlrm                      []
```

I am using the torchdynamo commit bcb169d, torchbench commit f6c4d27. 

I tried this again, and it just hangs and never finishes.

Did you figure out why the stack trace involves calling torch.jit.script?

@jansel sorry I have tried a few times but still couldn't reproduce. I am using the latest commit for both pytorch/benchmark and torchdynamo main branch. I have also added runtime log to check if torchscript is applied to the model (https://github.com/pytorch/benchmark/blob/xz9/test-jit/torchbenchmark/util/extra_args.py#L118-L127), here is the output:
```
$ ./torchbench.py -k fambench_dlrm --nothing
Unable to import mlperf_logging,  No module named 'mlperf_logging'
XU: model is not using torchscript
cpu  eval  fambench_dlrm                      []
```

The output shows the model is not using torchscript. Sorry I don't understand why the stack trace in your reproduction is calling `torch.jit.script`.

Can I have the commit hash of the torchbench repo and torchdynamo repo you are working on, to reproduce this problem?

Closed as we can't reproduce this problem