FFFF Async trainers write `lora_name` into a private attribute that `RolloutWorkerProtocol` does not declare · Issue #8008 · huggingface/trl · GitHub
[go: up one dir, main page]

Skip to content

Async trainers write lora_name into a private attribute that RolloutWorkerProtocol does not declare #8008

Description

@albertvillanova

With PEFT adapter sync on, AsyncGRPOTrainer sets the adapter name on an injected rollout worker through self.rollout_worker._loop_kwargs["lora_name"]. #7984 ports the same write to AsyncDistillationTrainer.

RolloutWorkerProtocol declares only the queues and the lifecycle/version methods. _loop_kwargs is a private detail of AsyncRolloutWorker. Building the trainer fails with AttributeError when all of these hold:

  • the injected worker implements the protocol but is not an AsyncRolloutWorker,
  • the model is a PEFT model,
  • the vLLM server is started with --enable-lora,
  • no weight_transfer is injected.

Root cause: the protocol has no way to pass the adapter name. An injected worker is built before the trainer probes the server, so the trainer can only tell it the name afterwards, and the only place it can write it is AsyncRolloutWorker's private _loop_kwargs.

Raised in the review of #7984: #7984 (comment) and #7984 (comment)

Activity

  1. dundysm commented on Oct 31, 2026

    @dundysm

    hi @albertvillanova; i'd like to take this one. plan: add a set_lora_name(lora_name) method to RolloutWorkerProtocol in both async_grpo and async_distillation, implement it on both AsyncRolloutWorkers (it writes the name into the loop kwargs before start()), and have both trainers call it instead of touching _loop_kwargs. tests cover an injected worker that only implements the protocol. pr shortly unless you'd prefer a different shape.

  2. linked a pull request that will close this issueAsyncgrpo drop rollout worker #8107on Nov 5, 2026
  3. albertvillanova commented on Nov 5, 2026

    @albertvillanova
    MemberAuthor

    Thanks @dundysm for picking this up, but I'd hold off on the set_lora_name PR. #8066 and #8107 (both approved) remove the rollout_worker argument and RolloutWorkerProtocol from both async trainers, and this _loop_kwargs write goes away with them. Custom rollout logic moves to subclassing the rollout loop instead (see #7827). Linking this issue to those PRs so it closes when they land.

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

Metadata

Metadata

Assignees

No one assigned

    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

      0