Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
132 lines (118 loc) · 4.93 KB
/
Copy pathpyproject.toml
File metadata and controls
132 lines (118 loc) · 4.93 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
###############################################################################
# Copyright (c) 2025, Advanced Micro Devices, Inc. All rights reserved.
#
# See LICENSE for license information.
###############################################################################
[build-system]
requires = ["hatchling>=1.21"]
build-backend = "hatchling.build"
[project]
name = "primus"
dynamic = ["version"]
description = "Primus-LM: a flexible, high-performance training framework for large-scale foundation models on AMD GPUs."
readme = "README.md"
requires-python = ">=3.10"
license = { file = "LICENSE" }
authors = [{ name = "Advanced Micro Devices, Inc." }]
keywords = ["primus", "amd", "rocm", "llm", "training", "megatron", "torchtitan"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
# Runtime dependencies for the published wheel.
#
# Keep this list to indexable (PEP 440) constraints. Hatchling refuses PEP 508
# direct references (`name @ git+...`) in `project.dependencies`, which broke
# `python -m build` on the v26.6.0 release job. VCS-pinned MLPerf packages live
# in the `mlperf` extra (and in `requirements.txt` / the training images).
# `torch` is provided by the base ROCm image and is deliberately NOT pinned here.
# The remaining names should stay aligned with `requirements.txt`.
dependencies = [
"loguru",
"wandb",
"nltk",
"matplotlib",
"markdown2",
"weasyprint",
"tyro",
"torchao",
"blobfile",
"torchdata>=0.8.0",
"datasets>=3.6.0",
"mlflow==3.11.1",
"pyrsmi",
"plotext",
]
[project.optional-dependencies]
dev = ["pre-commit", "expecttest", "pytest"]
# Not default wheel deps: installing these clones GitHub. Images and
# `pip install -r requirements.txt` already pull the same pins.
mlperf = [
"mlperf-logging @ git+https://github.com/mlcommons/logging.git@6.0.0-rc5",
"mlperf-common @ git+https://github.com/NVIDIA/mlperf-common.git@b86d175a05849d650a8ff69c1e2c37b9f4e61d51",
]
[project.scripts]
# Unified bash launcher (slurm / container / direct). Implemented in runner/.
primus-cli = "primus_cli:main"
# Primus Python CLI (train / benchmark / projection / preflight).
primus = "primus.cli.main:main"
[project.urls]
Homepage = "https://github.com/AMD-AGI/Primus"
Repository = "https://github.com/AMD-AGI/Primus"
[tool.black]
# Pin the formatting target below py39 on purpose. black >= 23.1 infers its
# target from `[project].requires-python`, and `>=3.10` would otherwise make it
# reformat 300+ existing files (e.g. parenthesizing multi-context `with`
# statements), breaking `code-lint` (pre-commit run --all-files). This affects
# formatting STYLE only -- not the runtime Python requirement -- and keeps
# formatting identical to the current main branch.
line-length = 110
target-version = ["py38"]
[tool.isort]
# Mirror the pre-commit hook (isort --profile black) so local runs and the
# pure-checkout CI agree. `odc` lives under primus/core/odc/odc/, so a clean
# checkout has no top-level `odc` package and isort would otherwise treat
# `import odc` as third-party. Declaring it first-party keeps import grouping
# deterministic and identical between local and CI.
profile = "black"
known_first_party = ["odc"]
###############################################################################
# Hatch build configuration
###############################################################################
[tool.hatch.version]
# Read __version__ statically from primus/__init__.py (no import side effects).
path = "primus/__init__.py"
# Required because the `mlperf` extra uses PEP 508 direct references. Without
# this, hatchling 1.32+ aborts `build_sdist` even though those pins are not
# default Requires-Dist. See https://hatch.pypa.io/dev/config/metadata/
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["primus"]
# _thirdparty.lock is generated at build time (and git-ignored); force-include it
# so the wheel ships it for `primus-cli deps sync`.
artifacts = ["primus/_thirdparty.lock"]
[tool.hatch.build.targets.wheel.force-include]
# Ship the whole primus-cli bash toolkit as package data under primus/runner/.
# The console-script entry point locates and execs runner/primus-cli at runtime.
"runner" = "primus/runner"
# Standalone, dependency-free entry-point module for `primus-cli`.
"primus_cli.py" = "primus_cli.py"
[tool.hatch.build.targets.sdist]
include = [
"primus",
"runner",
"primus_cli.py",
"requirements*.txt",
"README.md",
"LICENSE",
"pyproject.toml",
]
# _thirdparty.lock is generated at build time and git-ignored; force it into the
# sdist too, so `python -m build` (sdist -> wheel) keeps it in the final wheel.
artifacts = ["primus/_thirdparty.lock"]