Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@ezyang @zdevito
A braindump of how I got here:
Why do we need ninja
First, let me say that there are two
ninja
things:ninja
, the command line tool and build system,ninja
, the Python module that exposes a tiny module to emit ninja build files.The PyTorch CI currently requires neither, however the new C++ extensions do require the command line tool (but not the Python module).
Why can't we
pip install ninja
?It is currently very hard to install
ninja
withpip
, as there is a bug in setuptools, that manifests itself like this:Sometimes, this can be solved by upgrading pip (
pip install --upgrade pip
) -- but not always (e.g. does not fix the problem on nightly Python). I have spent many hours trying to work around this.The solution
The best solution IMO is to simply install
ninja
with apt directly, then there need be nopip
issues.This will not interfere with the rest of the build, since the
ninja
Python module is not installed by apt, so Pytorch'ssetup.py
will not pick it up and still build with cmake. Howeverninja
will be available as a command-line tool, so that the C++ extensions can be built.