[Inductor] Make aot-inductor work with pip installed torch (#108319)
It seems pip-installed torch is built with `D_GLIBCXX_USE_CXX11_ABI=0` and it fails the inductor/test_aot_inductor.py with:
```
ERROR: test_with_offset (__main__.AotInductorTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/ubuntu/anaconda3/lib/python3.9/site-packages/torch/testing/_internal/common_utils.py", line 2388, in wrapper
method(*args, **kwargs)
File "/home/ubuntu/src/pytorch/test/inductor/test_aot_inductor.py", line 112, in test_with_offset
actual = AOTInductorModelRunner.run(model, example_inputs, expected)
File "/home/ubuntu/src/pytorch/test/inductor/test_aot_inductor.py", line 63, in run
optimized, exported, output_tensors, output_spec = AOTInductorModelRunner.load(
File "/home/ubuntu/src/pytorch/test/inductor/test_aot_inductor.py", line 50, in load
optimized = torch.utils.cpp_extension.load_inline(
File "/home/ubuntu/anaconda3/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1635, in load_inline
return _jit_compile(
File "/home/ubuntu/anaconda3/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1736, in _jit_compile
return _import_module_from_library(name, build_directory, is_python_module)
File "/home/ubuntu/anaconda3/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 2136, in _import_module_from_library
module = importlib.util.module_from_spec(spec)
File "<frozen importlib._bootstrap>", line 565, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1173, in create_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
ImportError: /tmp/torchinductor_ubuntu/cqrzlw3yizrsx2us5bnjosr4tzct24h6qwb6xbbx654fxvdupoub/cr6ndwlgeorw34etxhwvs547kbnftyxtwwrsmbdraa4hjeevsvji.so: undefined symbol: _ZN3c106detail23torchInternalAssertFailEPKcS2_jS2_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
```
I'm not sure how to test this in CI, maybe run tests with prebuilt wheels?
Pull Request resolved: https://github.com/pytorch/pytorch/pull/108319
Approved by: https://github.com/ezyang