Skip to content

Building fuser project

jjsjann123 edited this page Mar 31, 2023 · 17 revisions

How to build fuser project from source.

Build issue is tracked here: https://github.com/NVIDIA/Fuser/issues/101. If you run into problems, open an issue and link it against that.

Option 1 - build nvfuser as part of pytorch's subdirectory (submodule build):

  1. clone pytorch code base to your local machine. https://github.com/pytorch/pytorch (we do nightly build against pytorch upstream. viable/strict branch is recommended for stable CI.)
  2. clone fuser code base to your local machine. https://github.com/NVIDIA/Fuser (default to main, which is our development branch)
  3. Build pytorch from the [PATH_TO_PYTORCH], with one environment variable export NVFUSER_SOURCE_DIR=[PATH_TO_FUSER] to use the latest fuser code base, replacing the submodule fuser code that's shipped with pytorch under [PATH_TO_PYTORCH]/third_party/nvfuser.

Option 2 - build nvfuser separately from PyTorch (standalone build):

  1. Install pytorch (either from source or via pip wheel);
  2. clone fuser code to your local machine https://github.com/NVIDIA/Fuser;
  3. Update nvfuser submodule: git submodule sync --recursive; git submodule update --init --recursive;
  4. Install required pip modules: pip install -r requirements.txt;
  5. Build nvfuser with python setup.py develop;

A few note on pytorch standalone build:

  1. nightly pip from pytorch currently doesn't work for our cpp tests: https://github.com/pytorch/pytorch/issues/98093
  2. there was some packaging issue with pytorch that has been patched (https://github.com/pytorch/pytorch/pull/97404), So as of today 3/31/2023, nightly pip wheel should work, but pytorch 2.0 pip wheel doesn't.

Note for developers

For PRs changing build system. We kindly ask you to verify it in all three uses:

  1. submodule build;
  2. standalone build against your locally build pytorch;
  3. [somewhat optional] standalone build against a pip installed pytorch; (note that since upstream pip package has issues, you might want to build a pip wheel locally and use that instead)

Clone this wiki locally