from vllm import LLM

model = "/data/vllm-ascend-smoke/models/Qwen/Qwen2.5-0.5B-Instruct"
try:
    LLM(
        model=model,
        trust_remote_code=True,
        dtype="float16",
        max_model_len=128,
        max_num_seqs=1,
        max_num_batched_tokens=128,
        tensor_parallel_size=1,
        enforce_eager=True,
        gpu_memory_utilization=0.6,
        offload_group_size=2,
        offload_num_in_group=3,
    )
except ValueError as exc:
    text = str(exc)
    print("SMOKE_INVALID_ERROR", text, flush=True)
    if "offload_num_in_group" in text and "offload_group_size" in text:
        print("SMOKE_INVALID_OK", flush=True)
        raise SystemExit(0)
    raise
raise RuntimeError("invalid offload config unexpectedly succeeded")
