setuptools version
setuptools=70.0.0
Python version
Python 3.12
OS
RHEL 9
Additional environment information
No response
Description
Having multiple extensions in ext_modules being compiled in parallel with pip install --config-setting='--build-option=build_ext' --config-setting='--build-option=-j24' ... causes issues because they share the same build folder set at
|
if self.build_temp is None: |
|
self.build_temp = os.path.join(self.build_base, 'temp' + plat_specifier) |
So when they write anything into that folder they may overwrite or delete files used by other extensions
Expected behavior
Building extensions in parallel has the same result as building serially
How to Reproduce
- Add multiple extensions to
ext_modules that use e.g. the same source files but compile them e.g. with different flags.
- Install with the parallel flag set
This was observed with DeepSpeed so you could try installing that from source with "enough" cores but it might be too much to setup
Output
Output varies and it might succeed depending on the amount of parallel actions going on and the available CPU cores. So it may sometimes succeed or fail seemingly randomly
setuptools version
setuptools=70.0.0
Python version
Python 3.12
OS
RHEL 9
Additional environment information
No response
Description
Having multiple extensions in
ext_modulesbeing compiled in parallel withpip install --config-setting='--build-option=build_ext' --config-setting='--build-option=-j24' ...causes issues because they share the same build folder set atsetuptools/setuptools/_distutils/command/build.py
Lines 111 to 112 in 5a13876
So when they write anything into that folder they may overwrite or delete files used by other extensions
Expected behavior
Building extensions in parallel has the same result as building serially
How to Reproduce
ext_modulesthat use e.g. the same source files but compile them e.g. with different flags.This was observed with DeepSpeed so you could try installing that from source with "enough" cores but it might be too much to setup
Output
Output varies and it might succeed depending on the amount of parallel actions going on and the available CPU cores. So it may sometimes succeed or fail seemingly randomly