-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathpyproject.toml
More file actions
113 lines (102 loc) · 2.74 KB
/
pyproject.toml
File metadata and controls
113 lines (102 loc) · 2.74 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
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "bergson"
description = "Tracing the memory of neural nets with data attribution"
readme = "README.md"
requires-python = ">=3.10"
keywords = ["interpretability", "explainable-ai"]
license = {text = "MIT License"}
dependencies = [
"accelerate", # For device_map in from_pretrained
"datasets",
"jinja2",
"jaxtyping>=0.3.3",
"ml_dtypes",
"natsort",
"numpy",
"scipy",
"peft>=0.17.0",
"pyarrow",
"pyyaml",
"simple-parsing",
"torch>=2.4",
"torchopt",
"transformers",
"bitsandbytes",
"traker",
]
version = "0.9.1"
[project.optional-dependencies]
# fast-jl is an optional CUDA acceleration for the global TRAK projection
# (bergson.utils.projection). It must be installed with --no-build-isolation
# because its setup.py imports torch:
# pip install fast-jl --no-build-isolation
# Without it the projector falls back to BasicProjector on CPU.
fast-jl = ["fast-jl"]
dev = [
"pre-commit",
"pytest",
"pyright==1.1.378", # pinned to match CI (build.yml)
"trl",
# Generate documentation
"furo",
"myst-parser",
"scipy-stubs",
"sphinx",
"sphinx-autodoc-typehints",
"sphinx-rtd-theme",
"nbsphinx",
"torch-tb-profiler>=0.4.3",
]
benchmarks = [
"wandb",
"kronfluence",
"dattri",
]
example = [
"backoff>=2.2.1",
"bitsandbytes>=0.49.0",
"pydantic>=2.12.5",
"trl",
"wandb",
"lm_eval",
]
faiss = [
"faiss-gpu-cu12",
]
[project.scripts]
bergson = "bergson.__main__:main"
[tool.pyright]
include = ["bergson*"]
reportPrivateImportUsage = false
[tool.setuptools.packages.find]
include = ["bergson*"]
[tool.black]
target-version = ["py310", "py311", "py312"]
[tool.ruff]
lint.ignore = ["E741","F722"] # Ambiguous variable name, jaxtyping typing error
# Enable pycodestyle (`E`), Pyflakes (`F`), and isort (`I`) codes
# See https://beta.ruff.rs/docs/rules/ for more possible rules
lint.select = ["E", "F", "I"]
# Same as Black.
line-length = 88
[tool.ruff.lint.per-file-ignores]
"notebooks/*.ipynb" = ["E501"]
[tool.semantic_release]
version_variables = ["bergson/__init__.py:__version__"]
version_toml = ["pyproject.toml:project.version"]
allow_zero_version = true
[tool.semantic_release.changelog]
mode = "init"
[tool.semantic_release.changelog.default_templates]
mask_initial_release = false
[tool.semantic_release.commit_parser_options]
minor_tags = ["feat"]
patch_tags = ["fix", "perf"]
other_allowed_tags = ["build", "chore", "ci", "docs", "style", "refactor", "test"]
allowed_tags = ["feat", "fix", "perf", "build", "chore", "ci", "docs", "style", "refactor", "test"]
default_bump_level = 0
parse_squash_commits = false
ignore_merge_commits = false