Repository: pytorch
Issue: torch.jit.script fails when parsing torch.SymInt
Labels: oncall: jit

### 🐛 Describe the bug

`torch.jit.script(...)` fails when the model contains `torch.SymInt` as annotation. This can happen when a Torch Dynamo backend interally uses `torch.jit.script(...)` and `torch.compile(..., dynamic=True)` is set.

Reproducer:
```python
import torch

class Model(torch.nn.Module):
        def forward(self, x: torch.Tensor, y: torch.SymInt):
                return x

torch.jit.script(Model())
```

For all who also run into this problem, here a workaround:
```python
@torch._dynamo.register_backend(name='...')
def mybackend(gm, example_inputs):
	for node in gm.graph.nodes:
		if node.op == 'placeholder' and node.type == torch.SymInt:
			node.type = int
	gm.recompile()
	jit = torch.jit.script(gm)
	...
```

### Versions

Collecting environment information...
PyTorch version: 2.1.1+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: CentOS Linux 7 (Core) (x86_64)
GCC version: (GCC) 10.5.0
Clang version: Could not collect
CMake version: version 3.28.0
Libc version: glibc-2.17

Python version: 3.8.18 (default, Nov 21 2023, 09:31:57)  [GCC 10.2.1 20210130 (Red Hat 10.2.1-11)] (64-bit runtime)
Python platform: Linux-3.10.0-1160.102.1.el7.x86_64-x86_64-with-glibc2.17
Is CUDA available: True
CUDA runtime version: 12.3.103
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: Quadro P4000
Nvidia driver version: 535.98
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                24
On-line CPU(s) list:   0-23
Thread(s) per core:    2
Core(s) per socket:    12
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 85
Model name:            Intel(R) Xeon(R) Gold 6126 CPU @ 2.60GHz
Stepping:              4
CPU MHz:               1942.382
CPU max MHz:           3700.0000
CPU min MHz:           1000.0000
BogoMIPS:              5200.00
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              1024K
L3 cache:              19712K
NUMA node0 CPU(s):     0-23
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 cdp_l3 invpcid_single intel_ppin ssbd mba rsb_ctxsw ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke md_clear spec_ctrl intel_stibp flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] intel-extension-for-pytorch==2.1.0
[pip3] numpy==1.24.3
[pip3] onnx==1.15.0
[pip3] onnxruntime==1.14.1
[pip3] onnxruntime-training==1.16.3
[pip3] onnxscript-preview==0.1.0.dev20230907
[pip3] pytorch-lightning==2.0.1
[pip3] torch==2.1.1
[pip3] torchmetrics==0.11.4
[pip3] torchvision==0.16.1
[pip3] triton==2.1.0
[conda] Could not collect

cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel