pytorch/torch/utils
Sv. Lockal 7cda4017dd Fix torch.utils.cpp_extension parser for clang version 20.1.7+libcxx (#157666)
When CC and CXX compiler is set to clang, and clang was compiled with libc++, compilation of torchvision fails with:

```
  File "/usr/lib/python3.12/site-packages/torch/utils/cpp_extension.py", line 585, in build_extensions
    compiler_name, compiler_version = self._check_abi()
                                      ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/torch/utils/cpp_extension.py", line 1034, in _check_abi
    _, version = get_compiler_abi_compatibility_and_version(compiler)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/torch/utils/cpp_extension.py", line 449, in get_compiler_abi_compatibility_and_version
    if tuple(map(int, version)) >= minimum_required_version:
       ^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '7+libcxx'
```

Compiler identification is a valid semantic version:
```
$ clang -dumpfullversion -dumpversion
20.1.7+libcxx
```

After adjusting parser of version, clang is able to compile extensions successfully.

Fixes #157665

Pull Request resolved: https://github.com/pytorch/pytorch/pull/157666
Approved by: https://github.com/msaroufim
2025-07-06 01:35:00 +00:00
..
_strobelight [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
_sympy [attempt 2] Compute contiguity symbolically to avoid dde, and introduce c++ sym_is_contiguous (#157472) 2025-07-02 23:12:29 +00:00
backcompat pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
benchmark [BE] Accelerator agnostic timer.py (#157131) 2025-07-03 22:23:04 +00:00
bottleneck
data [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
hipify Add missing graph and memory related symbols to cuda_to_hip_mappings (#157435) (#157573) 2025-07-04 03:03:04 +00:00
jit
model_dump [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
serialization
tensorboard [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
viz [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
__init__.py
_appending_byte_serializer.py Check integrity of bytes in AppendingByteSerializer (#152139) 2025-04-26 18:10:58 +00:00
_backport_slots.py
_config_module.py [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
_config_typing.pyi inductor codecache: include private inductor configs in cache key (#153672) 2025-06-11 01:33:24 +00:00
_content_store.py
_contextlib.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
_cpp_embed_headers.py [Build] Allow metal shaders to include ATen headers (#156256) 2025-06-18 01:03:25 +00:00
_cpp_extension_versioner.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
_cxx_pytree.py [BE] detect CXX pytree requirement with TorchVersion (#151102) 2025-05-01 18:55:57 +00:00
_device.py [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
_dtype_abbrs.py [BE] Migrate dtype_abbrs into one location (#152229) 2025-04-28 03:52:47 +00:00
_exposed_in.py
_filelock.py
_foreach_utils.py [torch] Add MTIA to the list of devices supporting foreach/fused kernels (#157583) 2025-07-04 01:15:24 +00:00
_freeze.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
_functools.py
_get_clean_triton.py [BE]Enhance _get_clean_triton.py to auto-generate launch_params if missing (#154666) 2025-05-31 19:27:56 +00:00
_helion.py Migrate from lru_cache to cache (#155613) 2025-06-11 19:44:18 +00:00
_import_utils.py
_mode_utils.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
_ordered_set.py Typo fixes for "overridden" in comments and function names (#155944) 2025-06-14 03:37:38 +00:00
_python_dispatch.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
_pytree.py Preserve Enum types during torch.export serialization and deserialization (#154821) 2025-06-08 17:30:31 +00:00
_stats.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
_thunk.py
_traceback.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
_triton.py [inductor] Update triton_key import to support latest Triton (#157242) 2025-06-30 17:51:43 +00:00
_typing_utils.py
_zip.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
backend_registration.py [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
bundled_inputs.py [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
checkpoint.py [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
collect_env.py [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
cpp_backtrace.py
cpp_extension.py Fix torch.utils.cpp_extension parser for clang version 20.1.7+libcxx (#157666) 2025-07-06 01:35:00 +00:00
deterministic.py
dlpack.py Upgrade to DLPack 1.0. (#145000) 2025-06-30 16:58:06 +00:00
file_baton.py Warn user of existing lock file to avoid infinite waiting (#149382) 2025-04-15 20:25:29 +00:00
flop_counter.py Revert "Inductor logging + analysis of torch.profile (#149697)" 2025-07-01 22:11:53 +00:00
hooks.py Add warning for module full backward hook when no input requires gradient (#155339) 2025-06-10 04:42:06 +00:00
mkldnn.py
mobile_optimizer.py
model_zoo.py
module_tracker.py
show_pickle.py
throughput_benchmark.py
weak.py pymft lint torch/utils/weak.py (#154484) 2025-05-28 17:06:58 +00:00