-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
129 lines (115 loc) · 3.81 KB
/
Copy pathpyproject.toml
File metadata and controls
129 lines (115 loc) · 3.81 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
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "commprof"
version = "1.0.0"
description = "Per layer DDP gradient all-reduce profiling for PyTorch, with a calibrated ring all-reduce cost model."
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.11"
authors = [{ name = "Olajide Badejo" }]
keywords = ["pytorch", "ddp", "distributed-training", "profiling", "nccl", "mlsys"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: System :: Benchmark",
]
dependencies = [
"torch>=2.4",
"torchvision>=0.19",
"numpy>=1.26",
"pyyaml>=6.0",
"tqdm>=4.66",
"matplotlib>=3.8",
"pandas>=2.1",
]
[project.optional-dependencies]
# ruff and mypy are pinned exactly rather than by lower bound. Both change their
# output across minor releases, so an unpinned CI would eventually fail a build that
# passes locally, on a formatting rule nobody chose to adopt.
dev = [
"pytest>=8.0",
"pytest-cov>=5.0",
"ruff==0.16.0",
"mypy==2.3.0",
"pre-commit>=3.8",
"types-PyYAML",
"pandas-stubs",
]
[project.scripts]
commprof = "commprof.cli:main"
[project.urls]
Homepage = "https://github.com/Olajide-Badejo/Distributed-Training-Communication-Profiler"
Repository = "https://github.com/Olajide-Badejo/Distributed-Training-Communication-Profiler"
Issues = "https://github.com/Olajide-Badejo/Distributed-Training-Communication-Profiler/issues"
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
commprof = ["py.typed"]
[tool.ruff]
line-length = 100
target-version = "py311"
src = ["src", "tests", "scripts"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"RUF", # ruff specific
"D", # pydocstyle
]
ignore = [
"D107", # __init__ docstring lives on the class
"D203", # incompatible with D211
"D213", # incompatible with D212
"B008", # function call in default argument, used deliberately for configs
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["D100", "D101", "D102", "D103", "D104"]
"scripts/*" = ["D103"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.mypy]
python_version = "3.11"
files = ["src", "scripts", "tests"]
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
no_implicit_optional = true
strict_equality = true
[[tool.mypy.overrides]]
module = ["torchvision.*", "matplotlib.*", "tqdm.*", "scipy.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
# Test bodies are assertions, not API. Annotating every `-> None` adds noise
# without adding safety, so the two strictness flags that would demand it are off
# here. Everything else, including argument types, still applies.
#
# This pattern only resolves because the test tree carries __init__.py files. Without
# them mypy names each module by basename and `tests.*` matches nothing.
module = ["tests.*"]
disallow_untyped_defs = false
disallow_incomplete_defs = false
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-ra --strict-markers"
markers = [
"gpu: requires a CUDA device (skipped in CI)",
"slow: takes more than a few seconds",
"integration: spawns real processes",
"timing: asserts a relationship between measured durations, so it depends on how fast the machine is (excluded in CI)",
]
filterwarnings = ["ignore::DeprecationWarning"]