Skip to content

Commit cebd6fa

Browse files
authored
cuda-12.8 and FlashAttention 2.x compatibility (#351)
* flash-atten2 * support FA2, vocab in cuda12.8 with backwards compatability to cuda11.7 with FA1 * clean up Vocab handling * clarify FlashMHA docs and switch to setuptools for build * GeneVocab init * align mask logic in tests and fix GeneVocab init edge case * ckpt rename rule for mismatched FA backend * FA2-backed FlashMHA * fix FA1 test * FA1 diagnostics * typo * update load_pretrained * clean up * add back vscode * eol
1 parent 7e48355 commit cebd6fa

19 files changed

Lines changed: 1980 additions & 95 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ venv/
109109
ENV/
110110
env.bak/
111111
venv.bak/
112+
.vscode/
112113

113114
# Spyder project settings
114115
.spyderproject

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
"justMyCode": false
2323
}
2424
]
25-
}
25+
}

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"**/save/**": true,
66
"**/wandb/**": true
77
}
8-
}
8+
}

examples/finetune_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,4 +795,4 @@ def eval_testdata(
795795

796796
run.finish()
797797
wandb.finish()
798-
gc.collect()
798+
gc.collect()

pyproject.toml

Lines changed: 55 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,61 @@
1-
[tool.poetry]
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
26
name = "scGPT"
3-
version = "0.2.4"
7+
version = "0.2.5"
48
description = "Large-scale generative pretrain of single cell using transformer."
5-
license = "MIT"
6-
authors = ["Haotian <subercui@gmail.com>"]
7-
repository = "https://github.com/bowang-lab/scGPT"
8-
homepage = "https://github.com/bowang-lab/scGPT"
99
readme = "README.md"
10+
requires-python = ">=3.7.12,<4"
11+
license = { text = "MIT" }
12+
authors = [
13+
{ name = "Haotian", email = "subercui@gmail.com" },
14+
]
15+
dependencies = [
16+
"pandas>=1.3.5",
17+
"pyarrow>=22.0.0",
18+
"scvi-tools>=0.16.0,<1.0",
19+
"scanpy>=1.9.1,<2.0.0",
20+
"torch>=1.13.0",
21+
"numba>=0.55.1",
22+
"scikit-misc>=0.1.4",
23+
"umap-learn>=0.5.3",
24+
"leidenalg>=0.8.10",
25+
"datasets>=2.20.0,<3",
26+
"typing-extensions>=4.2.0,<5.0.0",
27+
"scib>=1.0.3,<2.0.0",
28+
"cell-gears<0.0.3",
29+
"orbax<0.1.8",
30+
]
1031

11-
[tool.poetry.dependencies]
12-
python = ">=3.7.12,<4"
13-
pandas = ">=1.3.5"
14-
scvi-tools = ">=0.16.0,<1.0"
15-
scanpy = "^1.9.1"
16-
torch = ">=1.13.0"
17-
torchtext = "*"
18-
numba = ">=0.55.1"
19-
scikit-misc = ">=0.1.4"
20-
umap-learn = ">=0.5.3"
21-
leidenalg = ">=0.8.10"
22-
datasets = "^2.3.0"
23-
typing-extensions = "^4.2.0"
24-
scib = "^1.0.3"
25-
cell-gears = "<0.0.3"
26-
orbax = "<0.1.8"
32+
[project.optional-dependencies]
33+
fa2 = [
34+
"torch>=2.2.0",
35+
"flash-attn>=2.8.0",
36+
"einops>=0.6.0",
37+
]
2738

28-
[tool.poetry.dev-dependencies]
29-
pytest = "^5.2"
30-
black = "^22.3.0"
31-
tensorflow = "^2.8.0"
32-
flash-attn = "^1.0.1"
33-
torch-geometric = "^2.3.0"
34-
dcor = "~0.5.3"
35-
wandb = "^0.12.3"
36-
plotly = "^5.3.1"
39+
dev = [
40+
"pytest>=7.4,<9.0.0",
41+
"black>=24.0.0,<26.0.0",
42+
"tensorflow>=2.8.0,<3.0.0",
43+
"torch-geometric>=2.3.0,<3.0.0",
44+
"dcor>=0.5.3,<0.6.0",
45+
"wandb>=0.17.0,<1.0.0",
46+
"plotly>=5.20.0,<7.0.0",
47+
]
3748

38-
[build-system]
39-
requires = ["poetry-core>=1.0.0"]
40-
build-backend = "poetry.core.masonry.api"
49+
[project.urls]
50+
Homepage = "https://github.com/bowang-lab/scGPT"
51+
Repository = "https://github.com/bowang-lab/scGPT"
52+
53+
[tool.setuptools.packages.find]
54+
where = ["."]
55+
include = ["scgpt*"]
56+
57+
[tool.setuptools]
58+
include-package-data = true
59+
60+
[tool.setuptools.package-data]
61+
scgpt = ["tokenizer/*.json"]

scgpt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.2.4"
1+
__version__ = "0.2.5"
22
import logging
33
import sys
44

0 commit comments

Comments
 (0)