OpenPipe/ART

typerror: unexpected kwarg `enable_prefix_caching`

Closed this issue · 3 comments

What happened

art==0.4.11 fails to register Qwen3-30B-A3B-Instruct-2507 (MOE)

What I did

import asyncio
import json
from datetime import datetime
from os import environ
from typing import List
from zoneinfo import ZoneInfo

import art
from art.local.backend import LocalBackend
from art.types import MessageOrChoice, Messages
from exa_py import Exa
from openai import OpenAI
from openai.types.chat import ChatCompletionToolParam
import pandas as pd

EXA_API_KEY = environ.get("EXA_API_KEY")
MAX_TURNS = 25
STEPS = 25
COST_COEFF = 1.0

model = art.TrainableModel(
    name="atreya-01",
    project="think-a-tron",
    base_model="Qwen/Qwen3-30B-A3B-Instruct-2507",
)

async def main():
    backend = LocalBackend()
    await model.register(backend)
    # ... train loop elided (this fails before training starts) ...

if __name__ == "__main__":
    asyncio.run(main())

Error

Traceback (most recent call last):

  File "/root/atreya-01/main.py", line 259, in <module>

    asyncio.run(main())

  File "/root/atreya-01/.venv/lib/python3.10/site-packages/nest_asyncio.py", line 30, in run

    return loop.run_until_complete(task)

  File "/root/atreya-01/.venv/lib/python3.10/site-packages/nest_asyncio.py", line 98, in run_until_complete

    return f.result()

  File "/usr/lib/python3.10/asyncio/futures.py", line 201, in result

    raise self._exception.with_traceback(self._exception_tb)

  File "/usr/lib/python3.10/asyncio/tasks.py", line 232, in __step

    result = coro.send(None)

  File "/root/atreya-01/main.py", line 31, in main

    await model.register(backend)

  File "/root/atreya-01/.venv/lib/python3.10/site-packages/art/model.py", line 322, in register

    base_url, api_key = await backend._prepare_backend_for_training(

  File "/root/atreya-01/.venv/lib/python3.10/site-packages/art/local/backend.py", line 272, in _prepare_backend_for_training

    await service.start_openai_server(config=config)

  File "/root/atreya-01/.venv/lib/python3.10/site-packages/mp_actors/traceback.py", line 26, in async_wrapper

    raise e.with_traceback(streamlined_traceback())

  File "/root/atreya-01/.venv/lib/python3.10/site-packages/art/unsloth/service.py", line 60, in start_openai_server

    self.state.trainer.save_model(lora_path)

  File "/usr/lib/python3.10/functools.py", line 981, in __get__

    val = self.func(instance)

  File "/root/atreya-01/.venv/lib/python3.10/site-packages/art/unsloth/service.py", line 45, in state

    return ModelState(self.config)

  File "/root/atreya-01/.venv/lib/python3.10/site-packages/art/unsloth/state.py", line 82, in __init__

    unsloth.FastLanguageModel.from_pretrained(**config.get("init_args", {})),

  File "/root/atreya-01/.venv/lib/python3.10/site-packages/unsloth/models/loader.py", line 348, in from_pretrained

    return FastModel.from_pretrained(

  File "/root/atreya-01/.venv/lib/python3.10/site-packages/unsloth/models/loader.py", line 840, in from_pretrained

    model, tokenizer = FastBaseModel.from_pretrained(

  File "/root/atreya-01/.venv/lib/python3.10/site-packages/unsloth/models/vision.py", line 444, in from_pretrained

    model = auto_model.from_pretrained(

  File "/root/atreya-01/.venv/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 600, in from_pretrained

    return model_class.from_pretrained(

  File "/root/atreya-01/.venv/lib/python3.10/site-packages/transformers/modeling_utils.py", line 311, in _wrapper

    return func(*args, **kwargs)

  File "/root/atreya-01/.venv/lib/python3.10/site-packages/transformers/modeling_utils.py", line 4766, in from_pretrained

    model = cls(config, *model_args, **model_kwargs)

TypeError: Qwen3MoeForCausalLM.__init__() got an unexpected keyword argument 'enable_prefix_caching'

We don’t currently support MOE models due to certain dependencies, but we definitely plan to add support in the future!

sorry @Kovbo , my issue description is incomplete, i pass

_config=art.dev.TrainConfig(
    importance_sampling_level="sequence",
)

in model.train(), since qwen3-a3b is an MOE model. It still didn't work.

Yes, unfortunately, it's still not supported even with importance_sampling_level set to sequence.