-
Notifications
You must be signed in to change notification settings - Fork 70
Building fuser project
Ryan Spring edited this page Apr 28, 2025
·
17 revisions
- Install PyTorch with CUDA support (either build from source or install via pip wheel);
- Clone Fuser code to your local machine
git clone --recursive https://github.com/NVIDIA/Fuser.git; - Install required pip modules:
pip install -r requirements.txt; - Build NvFuser with
pip install -v --no-build-isolation python;
- Use
-eor--editableflag for editable install - Use environment flags starting with
NVFUSER_BUILD_to configurepip install. See Comprehensive List of NVFUSER_BUILD environment variables.
Here are the steps to create pip wheel that can be distributed and used on top of a pip installed pytorch wheel package:
# Repeat steps 1-3 from building Fuser from source.
# Specify NVRTC for pip wheel
export NVFUSER_BUILD_INSTALL_REQUIRES="nvidia-cuda-nvrtc-cu12,nvidia-nvtx-cu12"; \
# Skip building tests
export NVFUSER_BUILD_NO_TEST=1; \
# Skip building benchmarks
export NVFUSER_BUILD_NO_BENCHMARK=1; \
# Build pip wheel
python -m build --wheel --outdir dist --no-isolation ./python; \- Build against upstream pip package - if you need to work with upstream distributed pytorch https://pytorch.org/, you need to make sure that you nvfuser is built against a pytorch library with the same CXX ABI flag, otherwise, you are going to see undefined symbols. The safest bet is just build against upstream pip package directly!
-
Specify additional pip packages - Currently, upstream pytorch pip package can run on system with no cuda installation. NvFuser links against
libnvrtc. You need to specify the proper nvrtc as required package. This can be done via specifyNVFUSER_BUILD_INSTALL_REQUIRES=...environment variable.