Skip to content

Library trl==0.11.4 is missing in the latest Hugging Face Neuron Deep Learning AMI (Ubuntu 22.04) #968

@jianyinglangaws

Description

@jianyinglangaws

System Info

The missing library leads to compilation error of the Qwen3 Lora finetuning tutorial example https://huggingface.co/docs/optimum-neuron/en/training_tutorials/finetune_qwen3.


[rank26]: Traceback (most recent call last):                                                                                                                                                                       
[rank26]:   File "/home/ubuntu/optimum-neuron/examples/training/qwen3/finetune_qwen3.py", line 128, in <module>                                                                                                    
[rank26]:     train(                                                                                                                                                                                               
[rank26]:   File "/home/ubuntu/optimum-neuron/examples/training/qwen3/finetune_qwen3.py", line 86, in train                                                                                                        
[rank26]:     sft_config = NeuronSFTConfig(                                                                                                                                                                        
[rank26]: TypeError: NeuronSFTConfig.__init__() got an unexpected keyword argument 'max_seq_length'                                                                                                                    
[rank8]: Traceback (most recent call last):                                                                                                                                                                        
[rank8]:   File "/home/ubuntu/optimum-neuron/examples/training/qwen3/finetune_qwen3.py", line 128, in <module>                                                                                                     
[rank8]:     train(                                                                                                                                                                                                
[rank8]:   File "/home/ubuntu/optimum-neuron/examples/training/qwen3/finetune_qwen3.py", line 86, in train                                                                                                         
[rank8]:     sft_config = NeuronSFTConfig(                                                                                                                                                                         
[rank8]: TypeError: NeuronSFTConfig.__init__() got an unexpected keyword argument 'max_seq_length'               

Can someone please help fix this?

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction (minimal, reproducible, runnable)

  1. Launch the instance trn1.32xlarge with Huggingface DLAMI huggingface-neuron-2025-07-18T12-25-10Z-692efe1a-8d5c-4033-bcbc-5d99f2d4ae6a This DLAMI is based on Neuron SDK 2.24

    Neuron Library List:

(aws_neuronx_venv_pytorch_2_7) ubuntu@ip-172-31-45-102:~/optimum-neuron$ pip list | grep neuron 
libneuronxla 2.2.4410.0+835a67fb 
neuronx-cc 2.19.8089.0+8ab9f450 
neuronx-distributed 0.13.14393+b8569585 
optimum-neuron 0.3.0 
tensorboard-plugin-neuronx 2.6.117.0 
torch-neuronx 2.7.0.2.8.6734+ac864f72 
(aws_neuronx_venv_pytorch_2_7) ubuntu@ip-172-31-45-102:~/optimum-neuron$ pip list | grep optimum 
optimum 1.24.0 
optimum-neuron 0.3.0
  1. Download the optimum-neuron source code
    git clone https://github.com/huggingface/optimum-neuron.git
    cd ~/[optimum-neuron](https://github.com/huggingface/optimum-neuron/tree/main)/[examples](https://github.com/huggingface/optimum-neuron/tree/main/examples)/[training](https://github.com/huggingface/optimum-neuron/tree/main/examples/training)/qwen3
  1. Compile neuron_parallel_compile ./finetune_qwen3.sh and you would encounter the error.

Expected behavior

The compilation should complete without error messages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions