-
Notifications
You must be signed in to change notification settings - Fork 120
Migrate to uv and pyproject.toml #2148
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
Open
allenwang28
wants to merge
1
commit into
meta-pytorch:main
Choose a base branch
from
allenwang28:export-D89229505
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
|
@allenwang28 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D89229505. |
af37015 to
36f585e
Compare
allenwang28
added a commit
to allenwang28/monarch-1
that referenced
this pull request
Dec 16, 2025
Summary: Pull Request resolved: meta-pytorch#2148 Migrates Monarch to use `uv` and rely more on `pyproject.toml`. - Migrate static package metadata from setup.py to pyproject.toml - Add uv-specific configuration for PyTorch stable builds with multiple CUDA versions (cu128, cu124, cu121, cpu) - Note, for some reason `uv` does not play nicely with PyTorch nightly so we pin it to stable. Logs: P2082930246. Haven't looked into this yet. - Users can install with PyTorch nightly via: `$ uv sync --extra tensor --extra-index-url https://download.pytorch.org/whl/nightly/cu128` - Make torch optional with auto-detection and graceful degradation when not available - We need this because `uv` will first run `setup.py` to identify any dependencies etc., but fails if torch isn't installed. `uv` will then install torch in a secondary pass, then finally run the setup.py script. - This also allows us to avoid needing to build with `--no-build-isolation`. - Use PyO3's extension-module feature liberally to avoid libpython linking issues in Python extensions - Create separate `monarch_hyperactor_bin` crate to isolate binaries from `extension-module` feature. - Without this, `monarch_hyperactor` would always build as "`python-embed`" mode, when it itself is technically a `python-extension`. - add a uv.lock file which ... - Adds a .python-version so `uv` would default to Python 3.12. Without it it defaults to Python 3.10 because we support >=3.10 but this modernizes a bit more. Differential Revision: D89229505
allenwang28
added a commit
to allenwang28/monarch-1
that referenced
this pull request
Dec 16, 2025
Summary: Pull Request resolved: meta-pytorch#2148 Migrates Monarch to use `uv` and rely more on `pyproject.toml`. - Migrate static package metadata from setup.py to pyproject.toml - Add uv-specific configuration for PyTorch stable builds with multiple CUDA versions (cu128, cu124, cu121, cpu) - Note, for some reason `uv` does not play nicely with PyTorch nightly so we pin it to stable. Logs: P2082930246. Haven't looked into this yet. - Users can install with PyTorch nightly via: `$ uv sync --extra tensor --extra-index-url https://download.pytorch.org/whl/nightly/cu128` - Make torch optional with auto-detection and graceful degradation when not available - We need this because `uv` will first run `setup.py` to identify any dependencies etc., but fails if torch isn't installed. `uv` will then install torch in a secondary pass, then finally run the setup.py script. - This also allows us to avoid needing to build with `--no-build-isolation`. - Use PyO3's extension-module feature liberally to avoid libpython linking issues in Python extensions - Create separate `monarch_hyperactor_bin` crate to isolate binaries from `extension-module` feature. - Without this, `monarch_hyperactor` would always build as "`python-embed`" mode, when it itself is technically a `python-extension`. - add a uv.lock file which ... - Adds a .python-version so `uv` would default to Python 3.12. Without it it defaults to Python 3.10 because we support >=3.10 but this modernizes a bit more. Differential Revision: D89229505
36f585e to
abcb1fe
Compare
allenwang28
added a commit
to allenwang28/monarch-1
that referenced
this pull request
Dec 16, 2025
Summary: Pull Request resolved: meta-pytorch#2148 Migrates Monarch to use `uv` and rely more on `pyproject.toml`. - Migrate static package metadata from setup.py to pyproject.toml - Add uv-specific configuration for PyTorch stable builds with multiple CUDA versions (cu128, cu124, cu121, cpu) - Note, for some reason `uv` does not play nicely with PyTorch nightly so we pin it to stable. Logs: P2082930246. Haven't looked into this yet. - Users can install with PyTorch nightly via: `$ uv sync --extra tensor --extra-index-url https://download.pytorch.org/whl/nightly/cu128` - Make torch optional with auto-detection and graceful degradation when not available - We need this because `uv` will first run `setup.py` to identify any dependencies etc., but fails if torch isn't installed. `uv` will then install torch in a secondary pass, then finally run the setup.py script. - This also allows us to avoid needing to build with `--no-build-isolation`. - Use PyO3's extension-module feature liberally to avoid libpython linking issues in Python extensions - Create separate `monarch_hyperactor_bin` crate to isolate binaries from `extension-module` feature. - Without this, `monarch_hyperactor` would always build as "`python-embed`" mode, when it itself is technically a `python-extension`. - add a uv.lock file which ... - Adds a .python-version so `uv` would default to Python 3.12. Without it it defaults to Python 3.10 because we support >=3.10 but this modernizes a bit more. Differential Revision: D89229505
abcb1fe to
1dc0b9e
Compare
allenwang28
added a commit
to allenwang28/monarch-1
that referenced
this pull request
Dec 16, 2025
Summary: Pull Request resolved: meta-pytorch#2148 Migrates Monarch to use `uv` and rely more on `pyproject.toml`. - Migrate static package metadata from setup.py to pyproject.toml - Add uv-specific configuration for PyTorch stable builds with multiple CUDA versions (cu128, cu124, cu121, cpu) - Note, for some reason `uv` does not play nicely with PyTorch nightly so we pin it to stable. Logs: P2082930246. Haven't looked into this yet. - Users can install with PyTorch nightly via: `$ uv sync --extra tensor --extra-index-url https://download.pytorch.org/whl/nightly/cu128` - Make torch optional with auto-detection and graceful degradation when not available - We need this because `uv` will first run `setup.py` to identify any dependencies etc., but fails if torch isn't installed. `uv` will then install torch in a secondary pass, then finally run the setup.py script. - This also allows us to avoid needing to build with `--no-build-isolation`. - Use PyO3's extension-module feature liberally to avoid libpython linking issues in Python extensions - Create separate `monarch_hyperactor_bin` crate to isolate binaries from `extension-module` feature. - Without this, `monarch_hyperactor` would always build as "`python-embed`" mode, when it itself is technically a `python-extension`. - add a uv.lock file which ... - Adds a .python-version so `uv` would default to Python 3.12. Without it it defaults to Python 3.10 because we support >=3.10 but this modernizes a bit more. Differential Revision: D89229505
1dc0b9e to
0a1d53a
Compare
allenwang28
added a commit
to allenwang28/monarch-1
that referenced
this pull request
Dec 16, 2025
Summary: Pull Request resolved: meta-pytorch#2148 Migrates Monarch to use `uv` and rely more on `pyproject.toml`. - Migrate static package metadata from setup.py to pyproject.toml - Add uv-specific configuration for PyTorch stable builds with multiple CUDA versions (cu128, cu124, cu121, cpu) - Note, for some reason `uv` does not play nicely with PyTorch nightly so we pin it to stable. Logs: P2082930246. Haven't looked into this yet. - Users can install with PyTorch nightly via: `$ uv sync --extra tensor --extra-index-url https://download.pytorch.org/whl/nightly/cu128` - Make torch optional with auto-detection and graceful degradation when not available - We need this because `uv` will first run `setup.py` to identify any dependencies etc., but fails if torch isn't installed. `uv` will then install torch in a secondary pass, then finally run the setup.py script. - This also allows us to avoid needing to build with `--no-build-isolation`. - Use PyO3's extension-module feature liberally to avoid libpython linking issues in Python extensions - Create separate `monarch_hyperactor_bin` crate to isolate binaries from `extension-module` feature. - Without this, `monarch_hyperactor` would always build as "`python-embed`" mode, when it itself is technically a `python-extension`. - add a uv.lock file which ... - Adds a .python-version so `uv` would default to Python 3.12. Without it it defaults to Python 3.10 because we support >=3.10 but this modernizes a bit more. Differential Revision: D89229505
0a1d53a to
359ec85
Compare
allenwang28
added a commit
to allenwang28/monarch-1
that referenced
this pull request
Dec 16, 2025
Summary: Pull Request resolved: meta-pytorch#2148 Migrates Monarch to use `uv` and rely more on `pyproject.toml`. - Migrate static package metadata from setup.py to pyproject.toml - Add uv-specific configuration for PyTorch stable builds with multiple CUDA versions (cu128, cu124, cu121, cpu) - Note, for some reason `uv` does not play nicely with PyTorch nightly so we pin it to stable. Logs: P2082930246. Haven't looked into this yet. - Users can install with PyTorch nightly via: `$ uv sync --extra tensor --extra-index-url https://download.pytorch.org/whl/nightly/cu128` - Make torch optional with auto-detection and graceful degradation when not available - We need this because `uv` will first run `setup.py` to identify any dependencies etc., but fails if torch isn't installed. `uv` will then install torch in a secondary pass, then finally run the setup.py script. - This also allows us to avoid needing to build with `--no-build-isolation`. - Use PyO3's extension-module feature liberally to avoid libpython linking issues in Python extensions - Create separate `monarch_hyperactor_bin` crate to isolate binaries from `extension-module` feature. - Without this, `monarch_hyperactor` would always build as "`python-embed`" mode, when it itself is technically a `python-extension`. - add a uv.lock file which ... - Adds a .python-version so `uv` would default to Python 3.12. Without it it defaults to Python 3.10 because we support >=3.10 but this modernizes a bit more. TODO: - will need to remove some of the requirements.txt after we make sure that the CI is working Differential Revision: D89229505
359ec85 to
c67c5c5
Compare
allenwang28
added a commit
to allenwang28/monarch-1
that referenced
this pull request
Dec 16, 2025
Summary: Pull Request resolved: meta-pytorch#2148 Migrates Monarch to use `uv` and rely more on `pyproject.toml`. - Migrate static package metadata from setup.py to pyproject.toml - Add uv-specific configuration for PyTorch stable builds with multiple CUDA versions (cu128, cu124, cu121, cpu) - Note, for some reason `uv` does not play nicely with PyTorch nightly so we pin it to stable. Logs: P2082930246. Haven't looked into this yet. - Users can install with PyTorch nightly via: `$ uv sync --extra tensor --extra-index-url https://download.pytorch.org/whl/nightly/cu128` - Make torch optional with auto-detection and graceful degradation when not available - We need this because `uv` will first run `setup.py` to identify any dependencies etc., but fails if torch isn't installed. `uv` will then install torch in a secondary pass, then finally run the setup.py script. - This also allows us to avoid needing to build with `--no-build-isolation`. - Use PyO3's extension-module feature liberally to avoid libpython linking issues in Python extensions - Create separate `monarch_hyperactor_bin` crate to isolate binaries from `extension-module` feature. - Without this, `monarch_hyperactor` would always build as "`python-embed`" mode, when it itself is technically a `python-extension`. - add a uv.lock file which ... - Adds a .python-version so `uv` would default to Python 3.12. Without it it defaults to Python 3.10 because we support >=3.10 but this modernizes a bit more. TODO: - will need to remove some of the requirements.txt after we make sure that the CI is working Differential Revision: D89229505
c67c5c5 to
4f6b000
Compare
allenwang28
added a commit
to allenwang28/monarch-1
that referenced
this pull request
Dec 16, 2025
Summary: Pull Request resolved: meta-pytorch#2148 Migrates Monarch to use `uv` and rely more on `pyproject.toml`. - Migrate static package metadata from setup.py to pyproject.toml - Add uv-specific configuration for PyTorch stable builds with multiple CUDA versions (cu128, cu124, cu121, cpu) - Note, for some reason `uv` does not play nicely with PyTorch nightly so we pin it to stable. Logs: P2082930246. Haven't looked into this yet. - Users can install with PyTorch nightly via: `$ uv sync --extra tensor --extra-index-url https://download.pytorch.org/whl/nightly/cu128` - Make torch optional with auto-detection and graceful degradation when not available - We need this because `uv` will first run `setup.py` to identify any dependencies etc., but fails if torch isn't installed. `uv` will then install torch in a secondary pass, then finally run the setup.py script. - This also allows us to avoid needing to build with `--no-build-isolation`. - Use PyO3's extension-module feature liberally to avoid libpython linking issues in Python extensions - Create separate `monarch_hyperactor_bin` crate to isolate binaries from `extension-module` feature. - Without this, `monarch_hyperactor` would always build as "`python-embed`" mode, when it itself is technically a `python-extension`. - add a uv.lock file which ... - Adds a .python-version so `uv` would default to Python 3.12. Without it it defaults to Python 3.10 because we support >=3.10 but this modernizes a bit more. TODO: - will need to remove some of the requirements.txt after we make sure that the CI is working Differential Revision: D89229505
4f6b000 to
7849a5d
Compare
allenwang28
added a commit
to allenwang28/monarch-1
that referenced
this pull request
Dec 16, 2025
Summary: Pull Request resolved: meta-pytorch#2148 Migrates Monarch to use `uv` and rely more on `pyproject.toml`. - Migrate static package metadata from setup.py to pyproject.toml - Add uv-specific configuration for PyTorch stable builds with multiple CUDA versions (cu128, cu124, cu121, cpu) - Note, for some reason `uv` does not play nicely with PyTorch nightly so we pin it to stable. Logs: P2082930246. Haven't looked into this yet. - Users can install with PyTorch nightly via: `$ uv sync --extra tensor --extra-index-url https://download.pytorch.org/whl/nightly/cu128` - Make torch optional with auto-detection and graceful degradation when not available - We need this because `uv` will first run `setup.py` to identify any dependencies etc., but fails if torch isn't installed. `uv` will then install torch in a secondary pass, then finally run the setup.py script. - This also allows us to avoid needing to build with `--no-build-isolation`. - Use PyO3's extension-module feature liberally to avoid libpython linking issues in Python extensions - Create separate `monarch_hyperactor_bin` crate to isolate binaries from `extension-module` feature. - Without this, `monarch_hyperactor` would always build as "`python-embed`" mode, when it itself is technically a `python-extension`. - add a uv.lock file which ... - Adds a .python-version so `uv` would default to Python 3.12. Without it it defaults to Python 3.10 because we support >=3.10 but this modernizes a bit more. TODO: - will need to remove some of the requirements.txt after we make sure that the CI is working Differential Revision: D89229505
7849a5d to
71505fe
Compare
Summary: Pull Request resolved: meta-pytorch#2148 Migrates Monarch to use `uv` and rely more on `pyproject.toml`. - Migrate static package metadata from setup.py to pyproject.toml - Add uv-specific configuration for PyTorch stable builds with multiple CUDA versions (cu128, cu124, cu121, cpu) - Note, for some reason `uv` does not play nicely with PyTorch nightly so we pin it to stable. Logs: P2082930246. Haven't looked into this yet. - Users can install with PyTorch nightly via: `$ uv sync --extra tensor --extra-index-url https://download.pytorch.org/whl/nightly/cu128` - Make torch optional with auto-detection and graceful degradation when not available - We need this because `uv` will first run `setup.py` to identify any dependencies etc., but fails if torch isn't installed. `uv` will then install torch in a secondary pass, then finally run the setup.py script. - This also allows us to avoid needing to build with `--no-build-isolation`. - Use PyO3's extension-module feature liberally to avoid libpython linking issues in Python extensions - Create separate `monarch_hyperactor_bin` crate to isolate binaries from `extension-module` feature. - Without this, `monarch_hyperactor` would always build as "`python-embed`" mode, when it itself is technically a `python-extension`. - add a uv.lock file which ... - Adds a .python-version so `uv` would default to Python 3.12. Without it it defaults to Python 3.10 because we support >=3.10 but this modernizes a bit more. TODO: - will need to remove some of the requirements.txt after we make sure that the CI is working Differential Revision: D89229505
71505fe to
363e5b8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Summary:
Migrates Monarch to use
uvand rely more onpyproject.toml.uvdoes not play nicely with PyTorch nightly so we pin it to stable. Logs: P2082930246. Haven't looked into this yet.$ uv sync --extra tensor --extra-index-url https://download.pytorch.org/whl/nightly/cu128uvwill first runsetup.pyto identify any dependencies etc., but fails if torch isn't installed.uvwill then install torch in a secondary pass, then finally run the setup.py script.--no-build-isolation.monarch_hyperactor_bincrate to isolate binaries fromextension-modulefeature.monarch_hyperactorwould always build as "python-embed" mode, when it itself is technically apython-extension.uvwould default to Python 3.12. Without it it defaults to Python 3.10 because we support >=3.10 but this modernizes a bit more.Differential Revision: D89229505