mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Add abi flags to cpp_extension cache folder (#136890)
This is to avoid cache confusion between normal vs pydebug vs nogil builds in cpp extensions which can lead to catastrophic ABI issues. This is rare today for people to run both normal and pydebug on the same machine, but we expect quite a few people will run normal and nogil on the same machine going forward. This is tested locally by running each version alternatively. Pull Request resolved: https://github.com/pytorch/pytorch/pull/136890 Approved by: https://github.com/colesbury
This commit is contained in:
@ -2075,7 +2075,7 @@ def _get_build_directory(name: str, verbose: bool) -> str:
|
||||
root_extensions_directory = get_default_build_root()
|
||||
cu_str = ('cpu' if torch.version.cuda is None else
|
||||
f'cu{torch.version.cuda.replace(".", "")}') # type: ignore[attr-defined]
|
||||
python_version = f'py{sys.version_info.major}{sys.version_info.minor}'
|
||||
python_version = f'py{sys.version_info.major}{sys.version_info.minor}{getattr(sys, "abiflags", "")}'
|
||||
build_folder = f'{python_version}_{cu_str}'
|
||||
|
||||
root_extensions_directory = os.path.join(
|
||||
|
||||
Reference in New Issue
Block a user