Instructions to use Synthyra/ESMplusplus_small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Synthyra/ESMplusplus_small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="Synthyra/ESMplusplus_small", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("Synthyra/ESMplusplus_small", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update FastPLMs runtime and model cards
Browse files- README.md +3 -28
- fastplms/models.toml +37 -1
- fastplms/models/esm_plusplus/modeling_esm_plusplus.py +2 -0
- fastplms/registry.py +0 -0
- fastplms_bundle.py +0 -0
- modeling_fastplms.py +1 -1
README.md
CHANGED
|
@@ -267,32 +267,7 @@ the SAEs with unmasked sequences. This interface supports hidden-state SAEs
|
|
| 267 |
only, not MLP-output SAEs. FastPLMs does not copy SAE weights or add SAE
|
| 268 |
checkpoints to its model manifest.
|
| 269 |
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
The default uses checkpoint BF16 behavior. FP8 is an explicit experimental
|
| 273 |
-
inference option for every ESM++ scale:
|
| 274 |
-
|
| 275 |
-
```python
|
| 276 |
-
import torch
|
| 277 |
-
from transformers import AutoModel
|
| 278 |
-
|
| 279 |
-
fp8_model = AutoModel.from_pretrained(
|
| 280 |
-
"Synthyra/ESMplusplus_small",
|
| 281 |
-
trust_remote_code=True,
|
| 282 |
-
dtype=torch.bfloat16,
|
| 283 |
-
).cuda().eval()
|
| 284 |
-
fp8_model.enable_fp8()
|
| 285 |
-
print(fp8_model.esmc_precision_status)
|
| 286 |
-
|
| 287 |
-
with torch.inference_mode():
|
| 288 |
-
fp8_output = fp8_model(**{name: value.cuda() for name, value in batch.items()})
|
| 289 |
-
```
|
| 290 |
-
|
| 291 |
-
FP8 forward calls require `torch.inference_mode()`. The model pads the sequence
|
| 292 |
-
dimension to a multiple of 16. Transformer Engine converts supported linear
|
| 293 |
-
layers. The call fails if the dependency, compatible CUDA hardware, or complete
|
| 294 |
-
conversion set is unavailable. It does not silently use BF16. FP8 does not
|
| 295 |
-
claim numerical parity.
|
| 296 |
|
| 297 |
| Backend | Support | Measurement status |
|
| 298 |
| --- | --- | --- |
|
|
@@ -315,7 +290,7 @@ and
|
|
| 315 |
- Transformers classes: `AutoConfig`, `AutoModel`, `AutoModelForMaskedLM`, `AutoModelForSequenceClassification`, `AutoModelForTokenClassification`
|
| 316 |
- Checkpoint weights: `AutoConfig` = `FastPLMs extension`, `AutoModel` = `pretrained`, `AutoModelForMaskedLM` = `pretrained`, `AutoModelForSequenceClassification` = `base weights + untrained task head`, `AutoModelForTokenClassification` = `base weights + untrained task head`
|
| 317 |
- Attention backends: `eager`, `sdpa`, `flex_attention`, `flash_attention_2`, `flash_attention_3`
|
| 318 |
-
- Precision: `default`
|
| 319 |
- BF16 execution: `static_parameters`
|
| 320 |
- Generation contract: `not_applicable`
|
| 321 |
- Dependencies: `core`
|
|
@@ -324,7 +299,7 @@ and
|
|
| 324 |
- Redistributable: `true`
|
| 325 |
- Complete weight publication required: `false`
|
| 326 |
|
| 327 |
-
## Validation and
|
| 328 |
|
| 329 |
FastPLMs pins the checkpoint, upstream source revisions, state transformation,
|
| 330 |
and required files in `models.toml`. Built artifacts record exact source
|
|
|
|
| 267 |
only, not MLP-output SAEs. FastPLMs does not copy SAE weights or add SAE
|
| 268 |
checkpoints to its model manifest.
|
| 269 |
|
| 270 |
+
FP8 is restricted to ESMC-6B; smaller ESM++ models use BF16.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 271 |
|
| 272 |
| Backend | Support | Measurement status |
|
| 273 |
| --- | --- | --- |
|
|
|
|
| 290 |
- Transformers classes: `AutoConfig`, `AutoModel`, `AutoModelForMaskedLM`, `AutoModelForSequenceClassification`, `AutoModelForTokenClassification`
|
| 291 |
- Checkpoint weights: `AutoConfig` = `FastPLMs extension`, `AutoModel` = `pretrained`, `AutoModelForMaskedLM` = `pretrained`, `AutoModelForSequenceClassification` = `base weights + untrained task head`, `AutoModelForTokenClassification` = `base weights + untrained task head`
|
| 292 |
- Attention backends: `eager`, `sdpa`, `flex_attention`, `flash_attention_2`, `flash_attention_3`
|
| 293 |
+
- Precision: `default`
|
| 294 |
- BF16 execution: `static_parameters`
|
| 295 |
- Generation contract: `not_applicable`
|
| 296 |
- Dependencies: `core`
|
|
|
|
| 299 |
- Redistributable: `true`
|
| 300 |
- Complete weight publication required: `false`
|
| 301 |
|
| 302 |
+
## Validation and sources
|
| 303 |
|
| 304 |
FastPLMs pins the checkpoint, upstream source revisions, state transformation,
|
| 305 |
and required files in `models.toml`. Built artifacts record exact source
|
fastplms/models.toml
CHANGED
|
@@ -392,7 +392,7 @@ checkpoint_license = "MIT"
|
|
| 392 |
hub_license = "mit"
|
| 393 |
weights_publication_allowed = true
|
| 394 |
state_transform = "identity"
|
| 395 |
-
conversion_provenance = "Input: each pinned Biohub ESMFold2 checkpoint and its separately pinned ESMC checkpoint. Transformation: apply identity to preserve the folding checkpoint exactly, load its parameters in FP32 for CUDA BF16-autocast execution, retain canonical BF16 ESMC weights, and optionally rebuild exactly 80 ESMC attention output projections as transient Transformer Engine linears. Output: the corresponding pinned Synthyra ESMFold2 checkpoint plus its declared ESMC precision policy. Validation: release parity covers exact canonical state, learned projection, prepared features, and seeded BF16 folding; experimental FP8 validation covers strict unavailable-device behavior,
|
| 396 |
representative = "esmfold2"
|
| 397 |
documentation = "docs/esmfold2.md"
|
| 398 |
test_tiers = ["check", "compliance", "structure", "feature", "artifact", "benchmark"]
|
|
@@ -1237,3 +1237,39 @@ official_files = [
|
|
| 1237 |
"model.safetensors=sha256:4e903b740ad6ad704ec60881bfd593e0d6c874a630ffa0f0838276e0b665088f",
|
| 1238 |
]
|
| 1239 |
auto_map = { AutoConfig = "fastplms.models.esmfold2.configuration_esmfold2.ESMFold2Config", AutoModel = "fastplms.models.esmfold2.modeling_esmfold2_experimental.ESMFold2ExperimentalModel", AutoModelForSequenceClassification = "fastplms.models.esmfold2.modeling_esmfold2_classification.ESMFold2ExperimentalForSequenceClassification", AutoModelForTokenClassification = "fastplms.models.esmfold2.modeling_esmfold2_classification.ESMFold2ExperimentalForTokenClassification" }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 392 |
hub_license = "mit"
|
| 393 |
weights_publication_allowed = true
|
| 394 |
state_transform = "identity"
|
| 395 |
+
conversion_provenance = "Input: each pinned Biohub ESMFold2 checkpoint and its separately pinned ESMC checkpoint. Transformation: apply identity to preserve the folding checkpoint exactly, load its parameters in FP32 for CUDA BF16-autocast execution, retain canonical BF16 ESMC weights, and optionally rebuild exactly 80 ESMC attention output projections as transient Transformer Engine linears. Output: the corresponding pinned Synthyra ESMFold2 checkpoint plus its declared ESMC precision policy. Validation: release parity covers exact canonical state, learned projection, prepared features, and seeded BF16 folding; experimental FP8 validation covers strict unavailable-device behavior, the four 6B-backbone variants, and three BF16-to-FP8 reload cycles on the standard variant. Limitation: only the six manifest-listed ESMFold2 variants are supported; FP8 is experimental, applies only to inference-time ESMC execution, and requires direct CUDA loading with Transformer Engine availability."
|
| 396 |
representative = "esmfold2"
|
| 397 |
documentation = "docs/esmfold2.md"
|
| 398 |
test_tiers = ["check", "compliance", "structure", "feature", "artifact", "benchmark"]
|
|
|
|
| 1237 |
"model.safetensors=sha256:4e903b740ad6ad704ec60881bfd593e0d6c874a630ffa0f0838276e0b665088f",
|
| 1238 |
]
|
| 1239 |
auto_map = { AutoConfig = "fastplms.models.esmfold2.configuration_esmfold2.ESMFold2Config", AutoModel = "fastplms.models.esmfold2.modeling_esmfold2_experimental.ESMFold2ExperimentalModel", AutoModelForSequenceClassification = "fastplms.models.esmfold2.modeling_esmfold2_classification.ESMFold2ExperimentalForSequenceClassification", AutoModelForTokenClassification = "fastplms.models.esmfold2.modeling_esmfold2_classification.ESMFold2ExperimentalForTokenClassification" }
|
| 1240 |
+
|
| 1241 |
+
[[models]]
|
| 1242 |
+
id = "esmfold2_300"
|
| 1243 |
+
family = "esmfold2"
|
| 1244 |
+
size_category = "structure"
|
| 1245 |
+
generation_contract = "not_applicable"
|
| 1246 |
+
msa_conditioning = false
|
| 1247 |
+
publication_status = "published"
|
| 1248 |
+
fast_repo = "Synthyra/ESMFold2-300"
|
| 1249 |
+
fast_revision = "a38a62ae930d157484b331c2bf4241684573adba"
|
| 1250 |
+
fast_files = ["config.json=git-sha1:47ec20cf8b234c3b41d6f3ae1bdfe95d4eb4849e", "model.safetensors=sha256:44d6797c5efebf24753d502b40950e0874871c96ceea14f2d7f7e39cebac67fd"]
|
| 1251 |
+
official_repo = "biohub/ESMFold2-Experimental-Fast-base300M-step1500k"
|
| 1252 |
+
official_revision = "21531e59002c9205284715e28ee802dafb430637"
|
| 1253 |
+
official_files = ["config.json=git-sha1:8c9a04fe22b0e5fca77bc4e2861a12c9494ef4d4", "model.safetensors=sha256:44d6797c5efebf24753d502b40950e0874871c96ceea14f2d7f7e39cebac67fd"]
|
| 1254 |
+
notes = "Experimental Fast checkpoint with a frozen 300M ESM++ backbone, tensor-exact in BF16 with the pinned step-1500000 source, 24 folding blocks, no MSA conditioning, and no confidence head. BF16 execution uses FP32 folding parameters with CUDA autocast. FP8 is unsupported. Docker BF16 inference validation passed on the compact Protein G case."
|
| 1255 |
+
auto_map = { AutoConfig = "fastplms.models.esmfold2.configuration_esmfold2.ESMFold2Config", AutoModel = "fastplms.models.esmfold2.modeling_esmfold2_experimental.ESMFold2ExperimentalModel", AutoModelForSequenceClassification = "fastplms.models.esmfold2.modeling_esmfold2_classification.ESMFold2ExperimentalForSequenceClassification", AutoModelForTokenClassification = "fastplms.models.esmfold2.modeling_esmfold2_classification.ESMFold2ExperimentalForTokenClassification" }
|
| 1256 |
+
backbone_model = "esmc_small"
|
| 1257 |
+
backbone = { repo = "biohub/ESMC-300M-1500000", revision = "56803b6378b82e16c3b24aac49d1fce4445540b7", files = ["config.json=git-sha1:7fe728a0eb3fb81b24491d6cc1de816bf7797c27", "model.safetensors=sha256:8bd6cacf9b5a92d51954b64b20407f1f9f564a7e4849b8663470784d2a8b7ed2", "tokenizer.json=git-sha1:81c797f56768b22dec0301fa771f018b7e43e98c", "tokenizer_config.json=git-sha1:f49f57b24a1c93bd544974811e8ecbd61b7fae89", "special_tokens_map.json=git-sha1:c907ee1dc19b24241749b32d665c291c7e6e8e4b"] }
|
| 1258 |
+
|
| 1259 |
+
[[models]]
|
| 1260 |
+
id = "esmfold2_600"
|
| 1261 |
+
family = "esmfold2"
|
| 1262 |
+
size_category = "structure"
|
| 1263 |
+
generation_contract = "not_applicable"
|
| 1264 |
+
msa_conditioning = false
|
| 1265 |
+
publication_status = "published"
|
| 1266 |
+
fast_repo = "Synthyra/ESMFold2-600"
|
| 1267 |
+
fast_revision = "71c67d0b2b73dc245ea7c3cc0d0476439a882d08"
|
| 1268 |
+
fast_files = ["config.json=git-sha1:8e271837cbdada96c4974c8e543f84065e0f06f1", "model.safetensors=sha256:11a53c1b4700b6c62a5a464fc3ec7076160c19e8584157f88e13275116cfd602"]
|
| 1269 |
+
official_repo = "biohub/ESMFold2-Experimental-Fast-base600M-step1500k"
|
| 1270 |
+
official_revision = "15cf2d6648692f6c17cee1297d8a285476fffa9b"
|
| 1271 |
+
official_files = ["config.json=git-sha1:95517e555f17a1eca4b68866c89033a1f6916a5d", "model.safetensors=sha256:11a53c1b4700b6c62a5a464fc3ec7076160c19e8584157f88e13275116cfd602"]
|
| 1272 |
+
notes = "Experimental Fast checkpoint with a frozen 600M ESM++ backbone, tensor-exact in BF16 with the pinned step-1500000 source, 24 folding blocks, no MSA conditioning, and no confidence head. BF16 execution uses FP32 folding parameters with CUDA autocast. FP8 is unsupported. Configuration, weight identities, and artifact reload are verified; this model is not inference-validated."
|
| 1273 |
+
auto_map = { AutoConfig = "fastplms.models.esmfold2.configuration_esmfold2.ESMFold2Config", AutoModel = "fastplms.models.esmfold2.modeling_esmfold2_experimental.ESMFold2ExperimentalModel", AutoModelForSequenceClassification = "fastplms.models.esmfold2.modeling_esmfold2_classification.ESMFold2ExperimentalForSequenceClassification", AutoModelForTokenClassification = "fastplms.models.esmfold2.modeling_esmfold2_classification.ESMFold2ExperimentalForTokenClassification" }
|
| 1274 |
+
backbone_model = "esmc_large"
|
| 1275 |
+
backbone = { repo = "biohub/ESMC-600M-1500000", revision = "21af9cc429af76ebda6c48074fb624db4735aaaf", files = ["config.json=git-sha1:ec29f6009b21d710f64bf1c058f3a9710833d692", "model.safetensors=sha256:d6869f5ae0f11e5dc829b195e062e87cfcc2f851a08a5edbaf5d1083ae7f76cc", "tokenizer.json=git-sha1:81c797f56768b22dec0301fa771f018b7e43e98c", "tokenizer_config.json=git-sha1:f49f57b24a1c93bd544974811e8ecbd61b7fae89", "special_tokens_map.json=git-sha1:c907ee1dc19b24241749b32d665c291c7e6e8e4b"] }
|
fastplms/models/esm_plusplus/modeling_esm_plusplus.py
CHANGED
|
@@ -1076,6 +1076,8 @@ class PreTrainedESMplusplusModel(FastPLMsAttentionMixin, PreTrainedModel):
|
|
| 1076 |
all other operations and all SAE weights remain BF16.
|
| 1077 |
"""
|
| 1078 |
|
|
|
|
|
|
|
| 1079 |
if self._esmc_fp8:
|
| 1080 |
return self._esmc_precision_status
|
| 1081 |
if self.training:
|
|
|
|
| 1076 |
all other operations and all SAE weights remain BF16.
|
| 1077 |
"""
|
| 1078 |
|
| 1079 |
+
if self.config.hidden_size != 2560 or self.config.num_hidden_layers != 80:
|
| 1080 |
+
raise ValueError("FP8 is supported only for the ESMC-6B backbone.")
|
| 1081 |
if self._esmc_fp8:
|
| 1082 |
return self._esmc_precision_status
|
| 1083 |
if self.training:
|
fastplms/registry.py
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fastplms_bundle.py
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
modeling_fastplms.py
CHANGED
|
@@ -13,7 +13,7 @@ from zipfile import ZIP_DEFLATED, ZipFile
|
|
| 13 |
|
| 14 |
from .fastplms_bundle import RUNTIME_DATA, RUNTIME_HASH
|
| 15 |
|
| 16 |
-
if RUNTIME_HASH != "
|
| 17 |
raise RuntimeError("FastPLMs runtime identity differs from the bridge.")
|
| 18 |
|
| 19 |
_RUNTIME_TEMPORARIES = []
|
|
|
|
| 13 |
|
| 14 |
from .fastplms_bundle import RUNTIME_DATA, RUNTIME_HASH
|
| 15 |
|
| 16 |
+
if RUNTIME_HASH != "18a1768d1a03557ecd0fbc7ccf8f12cdb8d18d23b190e9d56ccf7c0c0225112e":
|
| 17 |
raise RuntimeError("FastPLMs runtime identity differs from the bridge.")
|
| 18 |
|
| 19 |
_RUNTIME_TEMPORARIES = []
|