Repository: pytorch
Issue: torch=2.1, import torch; fails AttributeError: '_OpNamespace' 'aten' object has no attribute 'sym_constrain_range_for_size'
Labels: module: build,oncall: quantization,triaged


### 🐛 Describe the bug

Import torch; fails AttributeError: '_OpNamespace' 'aten' object has no attribute 'sym_constrain_range_for_size'



install using following script
pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cu121

### Versions
python=3.10
ubuntu
```
nvidia-smi                                                                                            
Wed May 29 16:28:09 2024                                                                                                                         
+---------------------------------------------------------------------------------------+                                                        
| NVIDIA-SMI 535.54.03              Driver Version: 535.54.03    CUDA Version: 12.2     |                                                        
|-----------------------------------------+----------------------+----------------------+                                                        
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |                                                        
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |                                                        
|                                         |                      |               MIG M. |                                                        
|=========================================+======================+======================|                                                        
|   0  NVIDIA A100 80GB PCIe          On  | 00000000:01:00.0 Off |                    0 |                                                        
| N/A   37C    P0              45W / 300W |      4MiB / 81920MiB |      0%      Default |                                                        
|                                         |                      |             Disabled |                                                        
+-----------------------------------------+----------------------+----------------------+                                                        
|   1  NVIDIA A100 80GB PCIe          On  | 00000000:25:00.0 Off |                    0 |                                                        
| N/A   36C    P0              41W / 300W |      4MiB / 81920MiB |      0%      Default |                                                        
|                                         |                      |             Disabled |
```


```
>>> import torch                                                                                                                                 
Traceback (most recent call last):                                                                                                               
  File "/home/dhl/miniconda3/envs/torch2.1/lib/python3.10/site-packages/torch/_ops.py", line 757, in __getattr__                                 
    op, overload_names = torch._C._jit_get_operation(qualified_op_name)                                                                          
RuntimeError: No such operator aten::sym_constrain_range_for_size                                                                                
                                                                                                                                                 
The above exception was the direct cause of the following exception:                                                                             
                                                                                                                                                 
Traceback (most recent call last):                                                                                                               
  File "<stdin>", line 1, in <module>                                                                                                            
  File "/home/dhl/miniconda3/envs/torch2.1/lib/python3.10/site-packages/torch/__init__.py", line 1474, in <module>                               
    from torch import quantization as quantization                                                                                               
  File "/home/dhl/miniconda3/envs/torch2.1/lib/python3.10/site-packages/torch/quantization/__init__.py", line 1, in <module>                     
    from .quantize import *  # noqa: F403                                                                                                        
  File "/home/dhl/miniconda3/envs/torch2.1/lib/python3.10/site-packages/torch/quantization/quantize.py", line 10, in <module>                    
    from torch.ao.quantization.quantize import (                                                                                                 
  File "/home/dhl/miniconda3/envs/torch2.1/lib/python3.10/site-packages/torch/ao/quantization/__init__.py", line 3, in <module>                  
    from .fake_quantize import *  # noqa: F403                                                                                                   
  File "/home/dhl/miniconda3/envs/torch2.1/lib/python3.10/site-packages/torch/ao/quantization/fake_quantize.py", line 8, in <module>             
    from torch.ao.quantization.observer import (                                                                                                 
  File "/home/dhl/miniconda3/envs/torch2.1/lib/python3.10/site-packages/torch/ao/quantization/observer.py", line 15, in <module>                 
    from torch.ao.quantization.utils import (                                                                                                    
  File "/home/dhl/miniconda3/envs/torch2.1/lib/python3.10/site-packages/torch/ao/quantization/utils.py", line 12, in <module>                    
    from torch.fx import Node                                                                                                                    
  File "/home/dhl/miniconda3/envs/torch2.1/lib/python3.10/site-packages/torch/fx/__init__.py", line 83, in <module>                              
    from .graph_module import GraphModule                                                                                                                    
  File "/home/dhl/miniconda3/envs/torch2.1/lib/python3.10/site-packages/torch/fx/graph_module.py", line 8, in <module>                           
    from .graph import Graph, _PyTreeCodeGen, _is_from_torch, _custom_builtins, PythonCode                                                       
  File "/home/dhl/miniconda3/envs/torch2.1/lib/python3.10/site-packages/torch/fx/graph.py", line 2, in <module>
    from .node import Node, Argument, Target, map_arg, _type_repr, _get_qualified_name                                                           
  File "/home/dhl/miniconda3/envs/torch2.1/lib/python3.10/site-packages/torch/fx/node.py", line 39, in <module>
    _ops.aten.sym_constrain_range_for_size.default,                                                                                              
  File "/home/dhl/miniconda3/envs/torch2.1/lib/python3.10/site-packages/torch/_ops.py", line 761, in __getattr__
    raise AttributeError(                                               
AttributeError: '_OpNamespace' 'aten' object has no attribute 'sym_constrain_range_for_size'
```
@malfet 

cc @malfet @seemethere @jerryzh168 @jianyuh @raghuramank100 @jamesr66a @vkuzo @jgong5 @Xia-Weiwen @leslie-fang-intel