# Supported models

**URL:** <https://discuss.huggingface.co/t/supported-models/135072>\
**Category:** 🤗Optimum\
**Created:** [January 9, 2025, 8:44pm UTC](https://discuss.huggingface.co/t/supported-models/135072 "2025-01-09T20:44:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ES-CONVERGE](https://avatars.discourse-cdn.com/v4/letter/e/65b543/32.png) [@ES-CONVERGE](https://discuss.huggingface.co/u/ES-CONVERGE)\
**Post date:** [January 9, 2025, 8:44pm UTC](https://discuss.huggingface.co/t/supported-models/135072/1 "2025-01-09T20:44:36Z")

</div>

Trying to compile a transformers model I’m using  
Getting

```auto
KeyError: "hyenadna is not supported yet for transformers. Only ['...'] 
are supported for the library transformers. 
If you want to support hyenadna please propose a PR or open up an issue."

```

how/who decides which new models will be supported ?

---

<div class="post-metadata">

**Author:** ![regisss](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/regisss/32/22467_2.png) [@regisss](https://discuss.huggingface.co/u/regisss)\
**Post date:** [January 9, 2025, 10:06pm UTC](https://discuss.huggingface.co/t/supported-models/135072/2 "2025-01-09T22:06:18Z")

</div>

Hi @ES-CONVERGE, what is the command/script you used to perform this conversion?

---

<div class="post-metadata">

**Author:** ![Jingya](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/jingya/32/29444_2.png) [@Jingya](https://discuss.huggingface.co/u/Jingya)\
**Post date:** [January 9, 2025, 10:32pm UTC](https://discuss.huggingface.co/t/supported-models/135072/3 "2025-01-09T22:32:06Z")

</div>

@ES-CONVERGE hyenadna uses remote code, it should be compatible with the APIs in Optimum in general, but as it’s not native citizen in the Transformers libraries. The best approach IMO would be creating a custom backend config and register it to the task manager of Optimum. WDYT @regisss?

---

<div class="post-metadata">

**Author:** ![ES-CONVERGE](https://avatars.discourse-cdn.com/v4/letter/e/65b543/32.png) [@ES-CONVERGE](https://discuss.huggingface.co/u/ES-CONVERGE)\
**Post date:** [January 10, 2025, 11:09am UTC](https://discuss.huggingface.co/t/supported-models/135072/4 "2025-01-10T11:09:13Z")

</div>

@regisss  
Tried running the following, note that `model_dir` Is just a local path to my model directory

```auto
optimum-cli export neuron \
--model ./model_dir \
--batch_size 128 \
--sequence_length 8000 \  
model_dir_neuron/

```

---

<div class="post-metadata">

**Author:** ![ES-CONVERGE](https://avatars.discourse-cdn.com/v4/letter/e/65b543/32.png) [@ES-CONVERGE](https://discuss.huggingface.co/u/ES-CONVERGE)\
**Post date:** [January 10, 2025, 12:18pm UTC](https://discuss.huggingface.co/t/supported-models/135072/5 "2025-01-10T12:18:41Z")

</div>

@regisss @Jingya  
worth mentioning I also tried with the `torch_neuronx` SDK on a `inf2` EC2  
Got the following error

```auto
2025-01-10 12:05:29.000929: 9138 ERROR ||NEURON_CC_WRAPPER||: Failed compilation with ['neuronx-cc', 'compile', '--framework=XLA', '/tmp/ec2-user/neuroncc_compile_workdir/d15d4161-30e4-4141-81b3-1028ce49c523/model.MODULE_15049036111489798686+e30acd3a.hlo_module.pb', '--output', '/tmp/ec2-user/neuroncc_compile_workdir/d15d4161-30e4-4141-81b3-1028ce49c523/model.MODULE_15049036111489798686+e30acd3a.neff', '--target=trn1', '--verbose=35']: Process Process-1:
Traceback (most recent call last):
  ...
neuronxcc.driver.Exceptions.CompilerInvalidInputException: ERROR: Failed command /home/ec2-user/.local/lib/python3.9/site-packages/neuronxcc/starfish/bin/hlo2penguin --input /tmp/ec2-user/neuroncc_compile_workdir/d15d4161-30e4-4141-81b3-1028ce49c523/model.MODULE_15049036111489798686+e30acd3a.hlo_module.pb --out-dir ./ --output penguin.py --layers-per-module=1 --emit-tensor-level-dropout-ops --emit-tensor-level-rng-ops
------------ 
Reported stdout: 
DEBUG: needsModular? No. macCnt 0
INFO: Switching to single-module compile. PrePartitionPipe skipped.
INFO: Found memory bound graph
Replaced 0 dropout sequences with OffloadedDropout
INFO: HloMacCount has found 0
INFO: Traffic has found 49158152
INFO: AIF 0
HLO Ops used in computation: broadcast divide multiply parameter reshape tuple 
Invoking RemoveOptimizationBarriers pass
2025-01-10 12:05:28.050391: F hilo/MLIRPasses/Transforms/MhloToPythonPrinter.cc:732] ERROR: Unsupported type: complex<f32>

```

my code

```auto
import torch
import torch_neuronx
from transformers import AutoModelForSequenceClassification, AutoTokenizer

HF_TOKEN = "x"

model_id = "x/x"

print("Loading model + tokenizer")
tokenizer = AutoTokenizer.from_pretrained(
    model_id,
    trust_remote_code=True,
    token=HF_TOKEN
)

model = AutoModelForSequenceClassification.from_pretrained(
    model_id,
    trust_remote_code=True,
    token=HF_TOKEN,
    num_labels=1
)
model.eval()

example_input = tokenizer("ACGTACGT", return_tensors="pt", truncation=True, padding="max_length", max_length=8000)["input_ids"]

print("Tracing the model with torch_neuronx...")
neuron_model = torch_neuronx.trace(model, example_input)

# Save the compiled model
neuron_model.save("x.pt")
print("Saved compiled neuron model: x.pt")

```

---

<div class="post-metadata">

**Author:** ![Jingya](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/jingya/32/29444_2.png) [@Jingya](https://discuss.huggingface.co/u/Jingya)\
**Post date:** [January 13, 2025, 10:53pm UTC](https://discuss.huggingface.co/t/supported-models/135072/6 "2025-01-13T22:53:55Z")

</div>

Hi @ES-CONVERGE, I got the same compilation issue when exporting hyenadna, it seems that the tracing failed since the complex type _complex_ \<_f32_ \> is not yet supported by the neuron compiler. I would suggest you to open a ticket in [GitHub - aws-neuron/aws-neuron-sdk: Powering AWS purpose-built machine learning chips. Blazing fast and cost effective, natively integrated into PyTorch and TensorFlow and integrated with your favorite AWS services](https://github.com/aws-neuron/aws-neuron-sdk) to report to the Annapurna team.

---

<div class="post-metadata">

**Author:** ![ES-CONVERGE](https://avatars.discourse-cdn.com/v4/letter/e/65b543/32.png) [@ES-CONVERGE](https://discuss.huggingface.co/u/ES-CONVERGE)\
**Post date:** [January 14, 2025, 8:49am UTC](https://discuss.huggingface.co/t/supported-models/135072/7 "2025-01-14T08:49:28Z")

</div>

Thanks for the update - will do so
