From d023342165a0e3bc3e8e2f34b70a5b928cdf52aa Mon Sep 17 00:00:00 2001 From: ClashSAN <98228077+ClashSAN@users.noreply.github.com> Date: Sun, 30 Oct 2022 09:43:03 +0000 Subject: [PATCH] Added tip (from @aliencaocao) to install ninja to the @duckness guide --- Xformers.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Xformers.md b/Xformers.md index 8cdbe99..30e4589 100644 --- a/Xformers.md +++ b/Xformers.md @@ -64,7 +64,23 @@ pip install wheel 7. You can finally build xFormers, note that the build will take a long time (probably 10-20minutes), it may initially complain of some errors but it should still compile correctly. -```sh +> OPTIONAL tip: To further speed up on multi-core CPU Windows systems, install ninja https://github.com/ninja-build/ninja. +> Steps to install: +> 1. download ninja-win.zip from https://github.com/ninja-build/ninja/releases and unzip +> 2. place ninja.exe under C:\Windows OR add the full path to the extracted ninja.exe into system PATH +> 3. Run ninja -h in cmd and verify if you see a help message printed +> 4. Run the follow commands to start building. It should automatically use Ninja, no extra config is needed. You should see significantly higher CPU usage (40%+). +> ``` +> python setup.py build +> python setup.py bdist_wheel +> ``` +> This has reduced build time on a windows PC with a AMD 5800X CPU from 1.5hr to 10min. +> Ninja is also supported on Linux and MacOS but I do not have these OS to test thus can not provide step-by-step tutorial. + + + +8. Run the following: + ```sh python setup.py build python setup.py bdist_wheel ```