-
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
Merged
Merged
pyproject.toml #1852
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
efcbc9a
Initial basic setup
ksivaman 0c6276b
rm setup reqs
ksivaman 88a358b
fix
ksivaman 2c8201f
Merge branch 'main' into pyproject.toml
ksivaman 8d741c1
buil-isolation support
ksivaman b0d678c
Merge branch 'main' into pyproject.toml
ksivaman 55c936e
rm not needed funcs
ksivaman 39d6d36
Merge branch 'NVIDIA:main' into pyproject.toml
ksivaman 0035b12
Fix workflows
ksivaman 3718fad
Merge branch 'main' into pyproject.toml
ksivaman bbb3e8b
fix wheel
ksivaman ec59158
Fix invalid wheel
ksivaman ab55d72
Fix JAX build in baremetal env
ksivaman 5944ddf
Merge branch 'main' into pyproject.toml
ksivaman 7be3229
Update install inst in readme
ksivaman f195fe9
Merge branch 'main' into pyproject.toml
ksivaman f08296b
Merge branch 'main' into pyproject.toml
ksivaman 8676b07
Update build.yml
ksivaman 3e5cb2a
docstring fix
ksivaman 4772b08
Merge branch 'main' into pyproject.toml
ksivaman 1541150
fix
ksivaman c83fcc0
Merge branch 'main' into pyproject.toml
ksivaman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# | ||
# 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"] | ||
|
||
# Use legacy backend to import local packages in setup.py | ||
build-backend = "setuptools.build_meta:__legacy__" | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# | ||
# See LICENSE for license information. | ||
|
||
[build-system] | ||
requires = ["setuptools>=61.0", "pybind11[global]", "pip", "jax[cuda12]", "flax>=0.7.1"] | ||
|
||
# Use legacy backend to import local packages in setup.py | ||
build-backend = "setuptools.build_meta:__legacy__" | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# | ||
# See LICENSE for license information. | ||
|
||
[build-system] | ||
requires = ["setuptools>=61.0", "pip", "torch>=2.1"] | ||
|
||
# Use legacy backend to import local packages in setup.py | ||
build-backend = "setuptools.build_meta:__legacy__" | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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:
--no-build-isolation
.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.
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:torch
installed then the Jax extensions won't be built and the install deps for TE/Jax will not be installed, and vice-versa.NVTE_FRAMEWORK
then everything will be built and all runtime deps will be installed.NVTE_FRAMEWORK
then only that framework's extension will be built and thus only it's runtime deps will be installed.I think this is not needed because:
v2.3
to ensure that--no-build-isolation
is the default everywhere.pip install .
.