Skip to content

The inference results are not in the same order as the inputs #1887

Closed as not planned

Description

@LEON-gittech

When I use model.fast_generate, the results are not in the same order as the inputs.

Activity

  1. self-assigned this
    on Oct 8, 2026
  2. danielhanchen commented on Oct 8, 2026

    @danielhanchen
    Member

    Sorry on the delay. I could not reproduce this on the current release. model.fast_generate is vLLM's LLM.generate itself, and vLLM collects finished requests and sorts them by request id before returning (source, still the case in the latest vLLM). So outputs[i] always lines up with prompts[i], even when later prompts finish first.

    I checked this with unsloth/Qwen3-0.6B and fast_inference = True on 48 prompts with a different max_tokens per prompt, so later prompts finish first. I also tried sampling with n = 2, fast_generate_batches, a LoRA request and chat templated prompts. In every case outputs[i].prompt == prompts[i].

    A quick way to check your own run is [o.prompt for o in outputs] == prompts. If that prints False, please reopen with a small script and your unsloth, unsloth_zoo and vllm versions, and we will take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions