-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
190 lines (178 loc) · 5.52 KB
/
pyproject.toml
File metadata and controls
190 lines (178 loc) · 5.52 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
[project]
name = "mussel"
version = "1.3.3"
description = "weakly supervised computational pathology on whole slide images"
license = { text = "GPL-3.0 license" }
readme = "README.md"
requires-python = ">=3.10, <3.12" # NOTE: flash-attn prebuilt wheels (see lines 112–113) are only provided for 3.10/3.11; update wheel URLs if raising this upper bound.
dependencies = [
"pandas",
"numpy",
"h5py",
"matplotlib",
"tiffslide",
"opencv-python-headless",
"hydra-core",
"geopandas",
"scikit-learn",
# NOTE: Upper bound kept in sync with the fastattn extra, which pins transformers==4.36.2
# and a narrow huggingface-hub range. Relax this once the fastattn stack is updated/tested.
"transformers<4.46",
"gdown>=4.6.0",
"shapely>=2.0.7",
"einops>=0.8.1",
"einops-exts>=0.0.4",
"setuptools",
"configargparse>=1.7.1",
"environs",
"sacremoses",
"tqdm",
"pyarrow>=23.0.1",
]
[dependency-groups]
dev = [
"mypy",
"isort",
"black",
"pytest",
"pytest-timeout",
"ipython>=8.37.0",
]
[project.optional-dependencies]
"tensorflow-gpu" = [
"tensorflow[and-cuda]<=2.19.0",
"keras",
"tf-keras",
"huggingface_hub<0.20",
"torch < 2.6",
"torchvision",
"open-clip-torch",
]
"tensorflow-cpu" = [
"tensorflow",
"keras",
"tf-keras",
"torch < 2.6",
"torchvision",
"open-clip-torch",
]
"torch-cpu" = ["torch < 2.6", "torchvision", "open-clip-torch", "segmentation-models-pytorch"]
"torch-gpu" = ["torch < 2.6", "torchvision", "open-clip-torch", "segmentation-models-pytorch"]
"fastattn" = [
"gigapath@git+https://github.com/prov-gigapath/prov-gigapath",
"fairscale",
"torch==2.11.0",
"torchvision",
"xformers>=0.0.34",
"flash-attn==2.6.3",
"timm>=1.0.3",
"omegaconf",
"torchmetrics==0.10.3",
"fvcore",
"iopath",
"webdataset",
"lifelines",
"scikit-survival",
"wandb",
"open-clip-torch",
"ninja==1.11.1.1",
]
"distributed" = [
"azure-batch",
"azure-storage-blob",
"azure-storage-file-share",
"azure-identity",
"boto3",
"fsspec",
"s3fs",
"adlfs",
]
"convert" = [
"pyvips",
"aicsimageio",
]
"cucim" = [
"cucim",
]
"zarr" = [
"zarr",
"ome-zarr",
]
[tool.uv]
conflicts = [
# These are mutually exclusive: torch/tensorflow and fastattn pin incompatible torch versions.
# fastattn uses torch==2.11.0+cu126; torch-gpu/cpu use torch 2.x+cu121/cpu.
[
{ extra = "tensorflow-gpu" },
{ extra = "tensorflow-cpu" },
{ extra = "torch-cpu" },
{ extra = "torch-gpu" },
{ extra = "fastattn" },
],
]
[tool.uv.sources]
torch = [
{ index = "torch-cpu", extra = "tensorflow-gpu" },
{ index = "torch-cpu", extra = "tensorflow-cpu" },
{ index = "torch-cpu", extra = "torch-cpu" },
{ index = "torch-gpu", extra = "torch-gpu" },
{ index = "torch-gpu-cu126", extra = "fastattn" },
]
torchvision = [
{ index = "torch-cpu", extra = "tensorflow-gpu" },
{ index = "torch-cpu", extra = "tensorflow-cpu" },
{ index = "torch-cpu", extra = "torch-cpu" },
{ index = "torch-gpu", extra = "torch-gpu" },
{ index = "torch-gpu-cu126", extra = "fastattn" },
]
xformers = [{ index = "torch-gpu-cu126", extra = "fastattn" }]
flash-attn = [
{ url = "https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.9.4/flash_attn-2.6.3%2Bcu126torch2.11-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", marker = "python_version == '3.11'" },
{ url = "https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.9.4/flash_attn-2.6.3%2Bcu126torch2.11-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", marker = "python_version == '3.10'" },
]
[[tool.uv.index]]
name = "torch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[[tool.uv.index]]
name = "torch-gpu"
url = "https://download.pytorch.org/whl/cu121"
explicit = true
[[tool.uv.index]]
name = "torch-gpu-cu118"
url = "https://download.pytorch.org/whl/cu118"
explicit = true
[[tool.uv.index]]
name = "torch-gpu-cu126"
url = "https://download.pytorch.org/whl/cu126"
explicit = true
[tool.setuptools.packages.find]
include = ["mussel*"]
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.pytest.ini_options]
addopts = "-v --tb=short --import-mode=importlib"
markers = [
"slow: marks tests as slow and require significant time to run (deselect with '-m \"not slow\"')",
"integration: marks integration tests that perform actual model inference",
"gpu_compatible: marks tests that support --use-gpu flag for faster execution (use the use_gpu fixture to check)",
"requires_tensorflow: marks tests that require the tensorflow extra (run via tests/slurm/test_tensorflow.sh)",
"requires_fastattn: marks tests that require the fastattn extra (run via tests/slurm/test_fastattn.sh)",
]
[project.scripts]
annotate = 'mussel.cli.annotate:main'
cache_tiles = 'mussel.cli.cache_tiles:main'
extract_features = 'mussel.cli.extract_features:main'
aggregate_slide_features = 'mussel.cli.aggregate_slide_features:main'
aggregate_sample_features = 'mussel.cli.aggregate_sample_features:main'
filter_features = 'mussel.cli.filter_features:main'
filter_tessellate = 'mussel.cli.filter_tessellate:main'
tessellate = 'mussel.cli.tessellate:main'
tessellate_extract_features = 'mussel.cli.tessellate_extract_features:main'
create_class_embeddings = 'mussel.cli.create_class_embeddings:main'
merge_annotation_features = 'mussel.cli.merge_annotation_features:main'
linear_probe_benchmark = 'mussel.cli.linear_probe_benchmark:main'
export_tiles = 'mussel.cli.export_tiles:main'
save_model = 'mussel.cli.save_model:main'
convert = 'mussel.cli.convert:main'