-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathpyproject.toml
More file actions
164 lines (148 loc) · 4.77 KB
/
pyproject.toml
File metadata and controls
164 lines (148 loc) · 4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Build system configuration - PEP 517/518
[build-system]
# Note: torch is required at build time (not just runtime) because:
# 1. setup.py needs to detect torch installation paths and C++11 ABI
# 2. C++ extensions (monarch.common._C, gradient_generator) link against libtorch
# 3. Build-time torch detection determines whether to enable tensor_engine feature
# The torch index is controlled by [tool.uv.sources] below (e.g., pytorch-cu128)
requires = ["setuptools>=64", "setuptools-rust", "wheel", "numpy", "torch"]
build-backend = "setuptools.build_meta"
[project]
name = "torchmonarch"
dynamic = ["version"] # overridden via MONARCH_VERSION env var
description = "Monarch: Single controller library"
readme = "README.md"
requires-python = ">=3.10"
license = "BSD-3-Clause"
license-files = ["LICENSE"]
authors = [
{name = "Meta", email = "oncall+monarch@xmail.facebook.com"}
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Rust",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: System :: Distributed Computing",
]
dependencies = [
"pyzmq",
"pyarrow",
"requests",
"numpy",
"pyre-extensions",
"typing-extensions>=4.12",
"cloudpickle",
"torchx-nightly",
"lark",
"tabulate",
"opentelemetry-api",
"clusterscope",
"flask>=2.0",
"xxhash",
"py-spy",
]
# PyTorch nightly build indices for different platforms
# To use a different nightly, change the index in [tool.uv.sources] below
# or use: uv pip install --extra-index-url https://download.pytorch.org/whl/nightly/{platform} torch
[[tool.uv.index]]
name = "pytorch-cu126"
url = "https://download.pytorch.org/whl/cu126"
explicit = true
[[tool.uv.index]]
name = "pytorch-cu128"
url = "https://download.pytorch.org/whl/cu128"
explicit = true
[[tool.uv.index]]
name = "pytorch-cu130"
url = "https://download.pytorch.org/whl/cu130"
explicit = true
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.uv.sources]
# Override with: uv sync --extra-index-url https://download.pytorch.org/whl/nightly/{platform} e.g.
# uv sync --extra-index-url https://download.pytorch.org/whl/nightly/cu128
torch = [
{ index = "pytorch-cu128", marker = "sys_platform != 'darwin'" },
# MacOS cannot have cuda symbols, so default to CPU.
{ index = "pytorch-cpu", marker = "sys_platform == 'darwin'" },
]
# Configure uv for torch nightly builds
[tool.uv]
prerelease = "allow" # Required for torch nightly builds (pre-release versions)
required-environments = ["sys_platform == 'linux'"] # Force resolution for Linux x86_64
python-preference = "managed" # Use uv-managed Python installations
python-downloads = "automatic" # Automatically download Python if needed
cache-keys = [
{ file = "pyproject.toml" },
{ file = "setup.py" },
# Note: we intentionally avoid "**/*.rs" because it matches generated
# .rs files in target/release/build/, causing a full rebuild every time.
{ file = "*/src/**/*.rs" },
{ file = "*/Cargo.toml" },
{ file = "Cargo.lock" },
{ file = "*/src/**/*.{cc,cpp,c,h}" },
{ file = "*/src/**/*.{cu,cuh}" },
{ file = "python/monarch/**/*.{cpp,c,h}" },
]
[project.optional-dependencies]
examples = [
"bs4",
"ipython",
"psutil",
]
test = [
"kubernetes",
"pytest",
"pytest-timeout",
"pytest-asyncio",
"pytest-xdist",
"pyright",
]
kubernetes = [
"kubernetes",
]
# Modern dependency groups for uv
[dependency-groups]
dev = [
"pytest>=7.0",
"pytest-timeout>=2.0",
"pytest-asyncio>=0.21",
"pytest-xdist>=3.0",
"pytest-split",
"pyright>=1.1",
"torch>=2.9.1",
"setuptools-rust",
]
[project.urls]
Homepage = "https://meta-pytorch.org/monarch/"
Documentation = "https://meta-pytorch.org/monarch/"
Repository = "https://github.com/meta-pytorch/monarch"
Issues = "https://github.com/meta-pytorch/monarch/issues"
[project.scripts]
monarch = "monarch.tools.cli:main"
monarch_bootstrap = "monarch._src.actor.bootstrap_main:invoke_main"
monarch-dashboard = "monarch.monarch_dashboard.__main__:main"
[tool.setuptools]
packages = {find = {where = ["python"]}}
[tool.setuptools.package-dir]
"" = "python"
[tool.setuptools.package-data]
"monarch.monarch_dashboard" = ["frontend/build/**/*"]
"monarch.tools" = ["SKILL.md"]
[tool.pytest.ini_options]
markers = [
"oss_skip: marks tests to skip in OSS CI",
]
asyncio_mode = "auto"
# Default timeout of 5 minutes
timeout = 300