-
Notifications
You must be signed in to change notification settings - Fork 434
pyproject.toml #1852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyproject.toml #1852
Conversation
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
/te-ci |
# See LICENSE for license information. | ||
|
||
[build-system] | ||
requires = ["setuptools>=61.0", "cmake>=3.21", "wheel", "pybind11[global]", "ninja", "pip", "torch>=2.1", "jax[cuda12]", "flax>=0.7.1"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean PyTorch is a dependency for JAX-only builds, and vice versa? That doesn't seem right.
One problem with the pyproject.toml approach is that build-time dependencies are static, but we would really like to have dynamic dependencies. Should we migrate away from supporting a monolithic TE package and commit to using framework-specific subpackages? The TE core package only has runtime dependencies on the framework subpackages, and runtime dependencies can be dynamic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of important points to note:
- These static build dependencies are only relevant when using build isolation, which is to be viewed purely as an extra feature on top of the current recommendation of using
--no-build-isolation
. - This is also only the case for source installations. As installations from PyPI circumvents this by having a wheel for the core build and specific dependencies from the framework packages.
Feature 1 will help users who want to be able to do a simple build without installing any dependencies beforehand and in that case they will get both frameworks. The main issue that I see with having the framework packages completely separate even for a source install is that we won't be able to support the workflow of doing a simple pip install
from the top level directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think requiring --no-build-isolation
is fine for now (I wonder if there's a way to error out if it's not set), but doesn't this mean you also need --no-deps
for the source build? Or else you might install PyTorch/JAX unnecessarily. Maybe better to assume that the user has PyTorch/JAX in their environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't this mean you also need --no-deps for the source build?
No, because of the distinction between build vs runtime dependencies. --no-build-isolation
is strictly for build time dependencies, whereas --no-deps
is for runtime dependencies. With --no-build-isolation
(the current recommended install method), the user must preinstall all needed build deps for the necessary framework extension they want to compile (include the fw itself). Few cases:
- If they only have
torch
installed then the Jax extensions won't be built and the install deps for TE/Jax will not be installed, and vice-versa. - If the user has both frameworks but doesn't set
NVTE_FRAMEWORK
then everything will be built and all runtime deps will be installed. - If the user has both frameworks and sets
NVTE_FRAMEWORK
then only that framework's extension will be built and thus only it's runtime deps will be installed.
I wonder if there's a way to error out if it's not set
I think this is not needed because:
- We updated all installation instructions and docs in
v2.3
to ensure that--no-build-isolation
is the default everywhere. - This PR does add support for build isolation, purely as an new feature or fallback. Worst case the user env has a few extra libs/dependencies installed that they might not need, but this is a good trade-off for the basic user that doesn't want to manage deps and worry about the env. This will be powerful especially once we remove the toolkit restriction because then we will not longer have any system package dependency and user can simply
pip install .
.
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
/te-ci |
Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
/te-ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
NVIDIA/TransformerEngine#1852 removed pybind11 as part of JAX extension build. User now needs to install pybind11 prior to TE build
Description
Move to a
pyproject.toml
setup for build (pep517).Type of change
Changes
pypyproject.toml
setup for wheel and source builds. Related fixes to wheels.nvidia-*
libs as dependencies. These are currently not being used and will be added to build dependencies in a future PR supporting full e2e compilation and usage without CUDA toolkit.pybind11
for JAX extensions is removed, for installations without build isolation, the user must have it preinstalled in the environment.Pybind11CPPExtension
implementation.--no-build-isolation
missed previously.Checklist: