Can't run Test/Inductor test: test_compiled_optimizers.py
Labels: module: windows, triaged, oncall: pt2

### 🐛 Describe the bug

When I run in terminal: 
`pytest test_compiled_optimizers.py`

I encounter the following error:

```

=============================================== test session starts ================================================
platform win32 -- Python 3.11.1, pytest-7.4.0, pluggy-1.3.0
rootdir: ...\Python Projects\PyTorchContribute\pytorch
configfile: pytest.ini
plugins: anyio-3.7.0, hypothesis-6.82.7, pytorch-0.2.1
collected 0 items / 1 error

====================================================== ERRORS ======================================================
____________________________ ERROR collecting test/inductor/test_compiled_optimizers.py ____________________________
ImportError while importing test module '...\Python Projects\PyTorchContribute\pytorch\test\inductor\test_compiled_optimizers.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test_compiled_optimizers.py:23: in <module>
    from .test_torchinductor import check_model, check_model_cuda, requires_cuda
...\AppData\Local\Programs\Python\Python311\Lib\site-packages\_pytest\assertion\rewrite.py:178: in exec_module
    exec(co, module.__dict__)
test_torchinductor.py:29: in <module>
    from torch._dynamo.testing import (
E   ImportError: cannot import name 'expectedFailureCodegenDynamic' from 'torch._dynamo.testing' (C:\Users\1idan\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\_dynamo\testing.py)

During handling of the above exception, another exception occurred:
...\AppData\Local\Programs\Python\Python311\Lib\importlib\__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test_compiled_optimizers.py:25: in <module>
    from test_torchinductor import check_model, check_model_cuda, requires_cuda
E   ModuleNotFoundError: No module named 'test_torchinductor'
------------------------------------------------- Captured stderr --------------------------------------------------
<class 'ModuleNotFoundError'>: No module named 'test_torchinductor'
============================================= short test summary info ==============================================
ERROR test_compiled_optimizers.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================= 1 error in 6.13s =================================================
```
after add at the beginning of test script:
`sys.path.append(r'...\Python Projects\PyTorchContribute\pytorch\test\inductor')`
I got the following error:
`<class 'ImportError'>: cannot import name 'expectedFailureCodegenDynamic' from 'torch._dynamo.testing' (C:\Users\1idan\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\_dynamo\testing.py)`


I need assistance in resolving this issue as I want to run the tests and contribute to pytorch. Thanks.

### Versions
PyTorch version: 2.1.0.dev20230902
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A

OS: ??Microsoft Windows 11 Home
GCC version: (MinGW.org GCC-6.3.0-1) 6.3.0
Clang version: Could not collect
CMake version: version 3.26.4
Libc version: N/A

Python version: 3.11.0 | packaged by Anaconda, Inc. | (main, Mar  1 2023, 18:18:21) [MSC v.1916 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.22621-SP0
Is CUDA available: True
CUDA runtime version: 11.8.89
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce MX330
Nvidia driver version: 532.09
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture=9
CurrentClockSpeed=1391
DeviceID=CPU0
Family=198
L2CacheSize=5120
L2CacheSpeed=
Manufacturer=GenuineIntel
MaxClockSpeed=1690
Name=11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
ProcessorType=3
Revision=

Versions of relevant libraries:
[pip3] flake8==6.0.0
[pip3] flake8-bugbear==23.3.23
[pip3] flake8-comprehensions==3.12.0
[pip3] flake8-executable==2.1.3
[pip3] flake8-logging-format==0.9.0
[pip3] flake8-pyi==23.3.1
[pip3] flake8-simplify==0.19.3
[pip3] mypy==0.981
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.25.2
[pip3] torch==2.1.0.dev20230902
[pip3] torchaudio==2.2.0.dev20230902
[pip3] torchvision==0.16.0.dev20230902
[conda] blas                      1.0                         mkl
[conda] mkl                       2023.1.0         h6b88ed4_46357
[conda] mkl-service               2.4.0           py311h2bbff1b_1
[conda] mkl_fft                   1.3.6           py311hf62ec03_1
[conda] mkl_random                1.2.2           py311hf62ec03_1
[conda] mpmath                    1.2.1                   py311_0    pytorch-nightly
[conda] numpy                     1.25.2          py311hdab7c0b_0
[conda] numpy-base                1.25.2          py311hd01c5d8_0
[conda] pytorch                   2.1.0.dev20230902 py3.11_cuda11.8_cudnn8_0    pytorch-nightly 
[conda] pytorch-cuda              11.8                 h24eeafa_5    pytorch-nightly
[conda] pytorch-mutex             1.0                        cuda    pytorch-nightly
[conda] requests                  2.28.1                  py311_0    pytorch-nightly
[conda] torchaudio                2.2.0.dev20230902          pypi_0    pypi
[conda] torchvision               0.16.0.dev20230902          pypi_0    pypi

cc @peterjc123 @mszhanyi @skyline75489 @nbcsm @vladimir-aubrecht @iremyux @Blackhex @cristianPanaite @ezyang @msaroufim @wconstab @bdhirsh @anijain2305