AttributeError: 'LLM' object has no attribute 'engine_step' with Unsloth and vLLM
Opened this issue · 1 comments
Description
I am experiencing an AttributeError when attempting to run a script that uses Unsloth with vLLM. The traceback indicates that an LLM object from vLLM is being accessed for an attribute named engine_step, which does not exist in the current vLLM version.
This suggests a version incompatibility between Unsloth's code and the installed vLLM library.
Traceback Traceback (most recent call last): File "/home/ecs-user/ART_training/art_train.py", line 478, in <module> asyncio.run(model.register(backend)) File "/home/ecs-user/anaconda3/envs/ART/lib/python3.10/site-packages/nest_asyncio.py", line 30, in run return loop.run_until_complete(task) File "/home/ecs-user/anaconda3/envs/ART/lib/python3.10/site-packages/nest_asyncio.py", line 98, in run_until_complete return f.result() File "/home/ecs-user/anaconda3/envs/ART/lib/python3.10/asyncio/futures.py", line 201, in result raise self._exception.with_traceback(self._exception_tb) File "/home/ecs-user/anaconda3/envs/ART/lib/python3.10/asyncio/tasks.py", line 232, in __step result = coro.send(None) File "/home/ecs-user/ART/src/art/model.py", line 322, in register base_url, api_key = await backend._prepare_backend_for_training( File "/home/ecs-user/ART/src/art/local/backend.py", line 272, in _prepare_backend_for_training await service.start_openai_server(config=config) File "/home/ecs-user/ART/src/mp_actors/traceback.py", line 26, in async_wrapper raise e.with_traceback(streamlined_traceback()) File "/home/ecs-user/ART/src/art/unsloth/service.py", line 60, in start_openai_server self.state.trainer.save_model(lora_path) File "/home/ecs-user/anaconda3/envs/ART/lib/python3.10/functools.py", line 981, in __get__ val = self.func(instance) File "/home/ecs-user/ART/src/art/unsloth/service.py", line 45, in state return ModelState(self.config) File "/home/ecs-user/ART/src/art/unsloth/state.py", line 88, in __init__ self.vllm = vLLMState(self.model.vllm_engine, enable_sleep_mode) File "/home/ecs-user/ART/src/art/unsloth/state.py", line 140, in __init__ create_engine_pause_and_resume_functions(self.async_engine) File "/home/ecs-user/ART/src/art/vllm/engine.py", line 68, in create_engine_pause_and_resume_functions _engine_step = engine.engine_step AttributeError: 'LLM' object has no attribute 'engine_step' Steps to Reproduce Use Python 3.10 with an environment that has Unsloth and vLLM installed.
Expected Behavior
The script should initialize the vLLM engine and proceed with the training process without encountering any errors.
System Information
Operating System: [Ubuntu 22.04]
Python Version: 3.10
Unsloth Version: 2025.9.6
vLLM Version: 0.9.2
CUDA Version: 12.6
GPU: NVIDIA H20
Does it work with vLLM 0.10.0?
As you said, it is possible that Unsloth is not compatible with the old vLLM version.