Run this model with HF Jobs
Run nvidia/esm2_t36_3B_UR50D on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/nvidia/esm2_t36_3B_UR50D. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/nvidia/esm2_t36_3B_UR50D on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use nvidia/esm2_t36_3B_UR50D with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/esm2_t36_3B_UR50D with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="nvidia/esm2_t36_3B_UR50D", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("nvidia/esm2_t36_3B_UR50D", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse filesFiles changed (3)
- README.md+218-16
- config.json+3-2
- esm_nv.py+5-2
4 unmodified lines56789101112131415161718192021222324252627283 unmodified lines3233344 unmodified lines- text: MQIFVKTLTGKTITLEVEPS<mask>TIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLVLRLRGG---## ESM-2 (TransformerEngine-optimized)This version of the ESM-2 model is optimized with NVIDIA's[TransformerEngine](https://github.com/NVIDIA/TransformerEngine) library. It is based on the[original ESM-2 model](https://huggingface.co/facebook/esm2_t48_15B_UR50D) from Facebook Research,and (within numerical precision) has identical weights and outputs.ESM-2 is a state-of-the-art protein model trained on a masked language modelling objective. It issuitable for fine-tuning on a wide range of tasks that take protein sequences as input. For detailedinformation on the model architecture and training data, please refer to the [accompanyingpaper](https://www.biorxiv.org/content/10.1101/2022.07.20.500902v2). You may also be interested insome demo notebooks([PyTorch](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/protein_language_modeling.ipynb),[TensorFlow](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/protein_language_modeling-tf.ipynb))which demonstrate how to fine-tune ESM-2 models on your tasks of interest.Several ESM-2 checkpoints are available in the Hub with varying sizes. Larger sizes generally havesomewhat better accuracy, but require much more memory and time to train:| Checkpoint name | Num layers | Num parameters || ------------------------------------------------------------------------ | ---------- | -------------- |3 unmodified lines| [esm2_t30_150M_UR50D](https://huggingface.co/nvidia/esm2_t30_150M_UR50D) | 30 | 150M || [esm2_t12_35M_UR50D](https://huggingface.co/nvidia/esm2_t12_35M_UR50D) | 12 | 35M || [esm2_t6_8M_UR50D](https://huggingface.co/nvidia/esm2_t6_8M_UR50D) | 6 | 8M |4 unmodified lines567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151163 unmodified lines1201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352364 unmodified lines- text: MQIFVKTLTGKTITLEVEPS<mask>TIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLVLRLRGG---> [!NOTE]> This model has been optimized using NVIDIA's [TransformerEngine](https://github.com/NVIDIA/TransformerEngine)> library. Slight numerical differences may be observed between the original model and the optimized> version. For instructions on how to install TransformerEngine, please refer to the> [official documentation](https://github.com/NVIDIA/TransformerEngine?tab=readme-ov-file#installation).# ESM-2 (TransformerEngine-Optimized) Overview## Description:ESM-2 is a state-of-the-art protein model trained on a masked language modelling objective. It predicts proteinstructures from amino acid sequences, leveraging a transformer-based architecture for accurate 3D modeling. It issuitable for fine-tuning on a wide range of tasks that take protein sequences as input.This version of the ESM-2 model is optimized with NVIDIA's[TransformerEngine](https://github.com/NVIDIA/TransformerEngine) library. It is based on the original ESM-2 model fromFacebook Research, and (within numerical precision) has identical weights and outputs.This model is ready for commercial/non-commercial use.## Third-Party Community ConsiderationThis model is not owned or developed by NVIDIA. This model has been developed and built to a third-party's requirementsfor this application and use case; see link to Non-NVIDIA Model Card [ESM-2 ModelCard](https://huggingface.co/facebook/esm2_t33_650M_UR50D).### License/Terms of Use:ESM-2 is licensed under the [MIT license](https://github.com/facebookresearch/esm/blob/main/LICENSE).### Deployment Geography:Global### Use Case:Protein structure prediction, specifically predicting 3D protein structures from amino acid sequences.### Release Date:Hugging Face 07/29/2025 via [https://huggingface.co/nvidia/esm2_t36_3B_UR50D](https://huggingface.co/nvidia/esm2_t36_3B_UR50D)## Reference(s):- [Evolutionary-scale prediction of atomic level protein structure with a languagemodel](https://www.biorxiv.org/content/10.1101/2022.07.20.500902v2) - detailed information on the model architectureand training data, please refer to the accompanying [paper].- Demo notebooks([PyTorch](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/protein_language_modeling.ipynb),[TensorFlow](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/protein_language_modeling-tf.ipynb))which demonstrate how to fine-tune ESM-2 models on your tasks of interest.## Model Architecture:**Architecture Type:** Transformer**Network Architecture:** ESM-2**This model was developed based on:** [ESM-2](https://huggingface.co/facebook/esm2_t33_650M_UR50D) <br>**Number of model parameters:** 2.8 x 10^9## Input:**Input Type:** Text (Protein Sequences) <br>**Input Format:** String <br>**Input Parameters:** One-Dimensional (1D) <br>**Other Properties Related to Input:** Protein sequence represented as a string of canonical amino acids, of maximumlength 1022. Longer sequences are automatically truncated to this length.## Output:**Output Type:** Embeddings (Amino acid and sequence-level) <br>**Output Format:** Vector <br>**Output Parameters:** One-Dimensional (1D) <br>**Other Properties Related to Output:** Numeric vector with floating-point values corresponding to an embedding for eachamino acid in the input protein sequence. Maximum output length is 1022 embeddings - one embedding vector per aminoacid.Our AI models are designed and/or optimized to run on NVIDIA GPU-accelerated systems. By leveraging NVIDIA’s hardware(e.g. GPU cores) and software frameworks (e.g., CUDA libraries), the model achieves faster training and inference timescompared to CPU-only solutions.## Software Integration:**Runtime Engine(s):**- Hugging Face Transformers**Supported Hardware Microarchitecture Compatibility:**- NVIDIA Ampere- NVIDIA Blackwell- NVIDIA Hopper**[Preferred/Supported] Operating System(s):**- LinuxThe integration of foundation and fine-tuned models into AI systems requires additional testing using use-case-specificdata to ensure safe and effective deployment. Following the V-model methodology, iterative testing and validation atboth unit and system levels are essential to mitigate risks, meet technical and functional requirements, and ensurecompliance with safety and ethical standards before deployment.## Model Version: This model features the following version/checkpoints:Several ESM-2 checkpoints are available with varying sizes. Larger sizes have better accuracy, but require more memoryand time to train:| Checkpoint name | Num layers | Num parameters || ------------------------------------------------------------------------ | ---------- | -------------- |3 unmodified lines| [esm2_t30_150M_UR50D](https://huggingface.co/nvidia/esm2_t30_150M_UR50D) | 30 | 150M || [esm2_t12_35M_UR50D](https://huggingface.co/nvidia/esm2_t12_35M_UR50D) | 12 | 35M || [esm2_t6_8M_UR50D](https://huggingface.co/nvidia/esm2_t6_8M_UR50D) | 6 | 8M |## Training and Evaluation Datasets:## Training Datasets:**Link:** [UniRef90](https://www.uniprot.org/uniref?query=%28identity%3A0.9%29)**Data Modality:**- Text (Protein Sequences)**Text Training Data Size:**- 1 Billion to 10 Trillion Tokens**Data Collection Method:**- Human**Labeling Method:**- N/A**Properties (Quantity, Dataset Descriptions, Sensor(s)):** UniRef90 clusters are generated from the UniRef100 seedsequences with a 90% sequence identity threshold using the MMseqs2 algorithm. The seed sequences are the longest membersof the UniRef100 cluster. However, the longest sequence is not always the most informative. There is often morebiologically relevant information and annotation (name, function, cross-references) available on other cluster members.All the proteins in each cluster are ranked to facilitate the selection of a biologically relevant representative forthe cluster.**Link:** [UniRef50](https://www.uniprot.org/uniref?query=%28identity%3A0.5%29)**Data Modality:**- Text (Protein Sequences)**Text Training Data Size:**- 1 Billion to 10 Trillion Tokens**Data Collection Method:**- Human**Labeling Method:**- N/A**Properties:** UniRef50 clusters are generated from the UniRef90 seed sequences with a 50% sequence identity thresholdusing the MMseqs2 algorithm. The seed sequences are the longest members of the UniRef90 cluster. However, the longestsequence is not always the most informative. There is often more biologically relevant information and annotation (name,function, cross-references) available on other cluster members. All the proteins in each cluster are ranked tofacilitate the selection of a biologically relevant representative for the cluster.## Evaluation Datasets:**Link:** [Continuous Automated Model Evaluation (CAMEO)](https://pmc.ncbi.nlm.nih.gov/articles/PMC8673552/)**Benchmark Score:** 0.72**Data Collection Method:**- Human**Labeling Method:**- N/A**Properties:** The data is collected by taking sequences of protein structures that are about to be released weekly bythe Protein Data Bank (PDB). These sequences are sent as "blind targets" to participating protein structure predictionservers, which then return their predictions.**Link:** [CASP14 (Critical Assessment of Methods of Protein Structure Prediction)](https://pubmed.ncbi.nlm.nih.gov/34533838/)**Benchmark Score:** 0.52**Data Collection Method:**- Human**Labeling Method:**- N/A**Properties:** The data for CASP14 targets is collected from protein structures that are newly solved by experimentalstructural biologists. The CASP organizers receive the amino acid sequences of these proteins before their full,three-dimensional structures are publicly released in the Protein Data Bank (PDB). They then provide these sequences toparticipating research groups and servers, who must submit their predicted structures within a specific time frame.## Inference:**Acceleration Engine:**- Hugging Face Transformers**Test Hardware:**- A100- H100- H200- GB200## Ethical Considerations:NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enabledevelopment for a wide array of AI applications. When downloaded or used in accordance with our terms of service,developers should work with their internal model team to ensure this model meets requirements for the relevant industryand use case and addresses unforeseen product misuse.Users are responsible for ensuring the physical properties of model-generated molecules are appropriately evaluated andcomply with applicable safety regulations and ethical standards.Please report model quality, risk, security vulnerabilities or NVIDIA AI Concerns[here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
3 unmodified lines45678910111213141517 unmodified lines33343536373839403 unmodified lines],"attention_probs_dropout_prob": 0.0,"attn_input_format": "bshd","auto_map": {"AutoConfig": "esm_nv.NVEsmConfig","AutoModel": "esm_nv.NVEsmModel","AutoModelForMaskedLM": "esm_nv.NVEsmForMaskedLM"},"classifier_dropout": null,"emb_layer_norm_before": false,"encoder_activation": "gelu","esmfold_config": null,17 unmodified lines"position_embedding_type": "rotary","qkv_weight_interleaved": true,"token_dropout": true,"torch_dtype": "float32","transformers_version": "4.55.4","use_cache": true,"vocab_list": null,"vocab_size": 333 unmodified lines456789101112131415161717 unmodified lines353637383940413 unmodified lines],"attention_probs_dropout_prob": 0.0,"attn_input_format": "bshd","attn_mask_type": "padding","auto_map": {"AutoConfig": "esm_nv.NVEsmConfig","AutoModel": "esm_nv.NVEsmModel","AutoModelForMaskedLM": "esm_nv.NVEsmForMaskedLM"},"classifier_dropout": null,"dtype": "float32","emb_layer_norm_before": false,"encoder_activation": "gelu","esmfold_config": null,17 unmodified lines"position_embedding_type": "rotary","qkv_weight_interleaved": true,"token_dropout": true,"transformers_version": "4.56.2","use_cache": true,"vocab_list": null,"vocab_size": 33
59 unmodified lines60616263646523 unmodified lines8990919293944 unmodified lines9910010110210310428 unmodified lines13313413513613713813914014114214314414514659 unmodified linesmicro_batch_size: Optional[int] = None,max_seq_length: Optional[int] = None,padded_vocab_size: Optional[int] = 64,**kwargs,):"""Initialize the NVEsmConfig with additional TE-related config options.23 unmodified linesensure same kernels are used for forward propogation and activation recompute phase.padded_vocab_size: The padded vocabulary size to support FP8. If not provided, defaultsto vocab_size. Must be greater than or equal to vocab_size.**kwargs: Additional config options to pass to EsmConfig."""super().__init__(**kwargs)4 unmodified linesself.fuse_qkv_params = fuse_qkv_paramsself.micro_batch_size = micro_batch_sizeself.max_seq_length = max_seq_length# Set padded_vocab_size with default fallback to vocab_sizeself.padded_vocab_size = padded_vocab_size if padded_vocab_size is not None else self.vocab_size28 unmodified linesqkv_weight_interleaved=config.qkv_weight_interleaved,layer_number=i + 1,layer_type="encoder",self_attn_mask_type="padding",activation=config.encoder_activation,attn_input_format=config.attn_input_format,seq_length=config.max_seq_length,micro_batch_size=config.micro_batch_size,num_gqa_groups=config.num_attention_heads,fuse_qkv_params=config.fuse_qkv_params,params_dtype=config.torch_dtype,window_size=(-1, -1),)for i in range(config.num_hidden_layers)59 unmodified lines6061626364656623 unmodified lines909192939495964 unmodified lines10110210310410510610728 unmodified lines13613713813914014114214314414514614714814959 unmodified linesmicro_batch_size: Optional[int] = None,max_seq_length: Optional[int] = None,padded_vocab_size: Optional[int] = 64,attn_mask_type: str = "padding",**kwargs,):"""Initialize the NVEsmConfig with additional TE-related config options.23 unmodified linesensure same kernels are used for forward propogation and activation recompute phase.padded_vocab_size: The padded vocabulary size to support FP8. If not provided, defaultsto vocab_size. Must be greater than or equal to vocab_size.attn_mask_type: The type of attention mask to use.**kwargs: Additional config options to pass to EsmConfig."""super().__init__(**kwargs)4 unmodified linesself.fuse_qkv_params = fuse_qkv_paramsself.micro_batch_size = micro_batch_sizeself.max_seq_length = max_seq_lengthself.attn_mask_type = attn_mask_type# Set padded_vocab_size with default fallback to vocab_sizeself.padded_vocab_size = padded_vocab_size if padded_vocab_size is not None else self.vocab_size28 unmodified linesqkv_weight_interleaved=config.qkv_weight_interleaved,layer_number=i + 1,layer_type="encoder",self_attn_mask_type=config.attn_mask_type,activation=config.encoder_activation,attn_input_format=config.attn_input_format,seq_length=config.max_seq_length,micro_batch_size=config.micro_batch_size,num_gqa_groups=config.num_attention_heads,fuse_qkv_params=config.fuse_qkv_params,params_dtype=config.dtype,window_size=(-1, -1),)for i in range(config.num_hidden_layers)
README.md+218-16
config.json+3-2
esm_nv.py+5-2