huggingface / optimum-neuron

Easy, fast and very cheap training and inference on AWS Trainium and Inferentia chips.
Apache License 2.0
177 stars 53 forks source link

Exporting mistral model to neuron fails with ModuleNotFoundError: No module named 'optimum.commands.env' #475

Closed thesyntaxinator closed 4 months ago

thesyntaxinator commented 4 months ago

System Info

optimum-neuron            0.0.18
optimum                   1.16.2
platform: amazon linux 2
Python 3.8.16

Traceback (most recent call last):
  File "[venv path]/optimum-cli", line 5, in <module>
    from optimum.commands.optimum_cli import main
  File "[venv path]/lib64/python3.8/site-packages/optimum/commands/__init__.py", line 16, in <module>
    from .env import EnvironmentCommand
ModuleNotFoundError: No module named 'optimum.commands.env'

Who can help?

No response

Information

Tasks

Reproduction (minimal, reproducible, runnable)

Install python, neuron, optimum, optimum neuron versions above on amazon linux 2. Try to export a local fine-tuned mistral model to neuron using any --task (I tried text-classification)

command I used: optimum-cli export neuron --model base_model --task text-classification --sequence_length 4096 --batch_size 1 pytorch_model_neuron/

Expected behavior

Model should export to neuron

chintanckg commented 4 months ago

Please specify the underlying hardware (inferentia2/inferentia1/trainium etc.)

thesyntaxinator commented 4 months ago

I trying to compile on AL2 non inferentia instance to inf1 or inf2

chintanckg commented 4 months ago

I am slightly confused by your reply, what do you mean by "non inferentia instance to inf1 or inf2"?

Basically, if you want to compile a neuron-supported model for inf1 or inf2, the compilation needs to happen on inf1 or inf2 or tranium.

thesyntaxinator commented 4 months ago

I see, will try compiling on inf1 or inf2 and post an update

thesyntaxinator commented 4 months ago

Compiling on inf2 worked, thanks