-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
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
setuptools/setuptools/_distutils/command/build.py
Lines 111 to 112 in 5a13876
| 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_modulesthat 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