Embeddings
Use this sub-skill for ESMEmbedWrapper, MSAEmbedWrapper,
ProtTranEmbedWrapper, external sequence/MSA features, precomputed
representations, projection-width checks, or failures involving model assets,
torch.hub, Hugging Face, transformers, Apex, fused operations, caches, and
memory pressure.
Route the task
- For exact wrapper signatures, tensor contracts, masks, projection rules, and
disable_token_embed, read API reference.
- Before constructing any pretrained wrapper, read
External models. Construction can resolve
code and large weights; never trigger that acquisition without approval.
- For missing assets, network/cache errors, source-shape defects, Apex/fused
failures, width mismatch, or OOM, use
Troubleshooting.
- For a safe CPU-default check, run
embedding_input_smoke.py. It creates a
synthetic (B, M, N, 1280) tensor, checks the core projection, and consumes
projected representations without constructing or downloading a pretrained
model.
Operating sequence
- Decide between a live pretrained wrapper and already available
representations. Prefer precomputed inputs when model source, weights,
cache, network policy, fused kernels, or memory have not been approved and
validated.
- Validate
seq: (B, N), msa: (B, M, N), boolean masks on the same residue
axes, and the external feature width before allocating a model.
- Match the external width to the correct projection: wrapper projections end
at
Alphafold2.dim; the core embedd_project accepts num_embedds
channels (1280 by default) and also ends at Alphafold2.dim.
- Review the 0.4.32 source limitations before relying on a wrapper or on the
core argument spelled
embedds. The README describes the intended workflow,
but several wrapper/helper paths and the direct embedds branch drift from
that description.
- Run only a bounded, explicit device check. The pretrained wrapper paths are
not offline merely because
alphafold2_pytorch imports successfully.
Boundaries
A wrapper computes seq_embed and msa_embed and forwards them to the trunk.
The lower-level embedds argument is a different interface; in 0.4.32 its
branch is shadowed by MSA initialization. Do not describe a successful wrapper
or functional direct-embedds inference unless that exact path was validated.
1---2name: embeddings3description: "Guides ESM, MSA Transformer, ProtTrans/ProtBERT, and precomputed4 sequence/MSA representations for Alphafold2, including projection, masks,5 caches, downloads, Apex, and OOM diagnosis."6disable-model-invocation: true7metadata:8 source: https://skillmd.com/skills/vectorspacelab/embeddings9 disco-role: operating10license: MIT11---1213# Embeddings1415Use this sub-skill for `ESMEmbedWrapper`, `MSAEmbedWrapper`,16`ProtTranEmbedWrapper`, external sequence/MSA features, precomputed17representations, projection-width checks, or failures involving model assets,18`torch.hub`, Hugging Face, `transformers`, Apex, fused operations, caches, and19memory pressure.2021## Route the task2223- For exact wrapper signatures, tensor contracts, masks, projection rules, and24 `disable_token_embed`, read [API reference](references/api-reference.md).25- Before constructing any pretrained wrapper, read26 [External models](references/external-models.md). Construction can resolve27 code and large weights; never trigger that acquisition without approval.28- For missing assets, network/cache errors, source-shape defects, Apex/fused29 failures, width mismatch, or OOM, use30 [Troubleshooting](references/troubleshooting.md).31- For a safe CPU-default check, run32 [`embedding_input_smoke.py`](scripts/embedding_input_smoke.py). It creates a33 synthetic `(B, M, N, 1280)` tensor, checks the core projection, and consumes34 projected representations without constructing or downloading a pretrained35 model.3637## Operating sequence38391. Decide between a live pretrained wrapper and already available40 representations. Prefer precomputed inputs when model source, weights,41 cache, network policy, fused kernels, or memory have not been approved and42 validated.432. Validate `seq: (B, N)`, `msa: (B, M, N)`, boolean masks on the same residue44 axes, and the external feature width before allocating a model.453. Match the external width to the correct projection: wrapper projections end46 at `Alphafold2.dim`; the core `embedd_project` accepts `num_embedds`47 channels (1280 by default) and also ends at `Alphafold2.dim`.484. Review the 0.4.32 source limitations before relying on a wrapper or on the49 core argument spelled `embedds`. The README describes the intended workflow,50 but several wrapper/helper paths and the direct `embedds` branch drift from51 that description.525. Run only a bounded, explicit device check. The pretrained wrapper paths are53 not offline merely because `alphafold2_pytorch` imports successfully.5455## Boundaries5657- General `Alphafold2` trunk construction, attention, and output contracts:58 [core-model](../core-model/SKILL.md).59- Coordinates, confidence, refinement, and recycling:60 [structure-and-recycling](../structure-and-recycling/SKILL.md).61- Metrics and unrelated utilities: [utilities](../utilities/SKILL.md).6263A wrapper computes `seq_embed` and `msa_embed` and forwards them to the trunk.64The lower-level `embedds` argument is a different interface; in 0.4.32 its65branch is shadowed by MSA initialization. Do not describe a successful wrapper66or functional direct-`embedds` inference unless that exact path was validated.