THUDM / THUDM/slime

[Bug] Fully-async multi-agent rollout crashes on nested groups

Open
#2,344 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
8.5k
Forks
1.3k
Avg merge
5h 36m
Merged PRs (30d)
22

Description

Bug Description

The fully-async multi-agent demo crashes when a custom generation function returns multiple samples for one input sample.

Affected configuration in examples/multi_agent/run-qwen3-8B-multi-agent.sh:

--rollout-function-path slime.rollout.fully_async_rollout.generate_rollout_fully_async
--custom-generate-function-path examples.multi_agent.rollout_with_multi_agents.generate_with_multi_agents

The custom generation result becomes a nested group (list[list[Sample]]), but fully_async_rollout.py expects a flat group and treats Python's list.index method as Sample.index.

Steps to Reproduce
cd slime
bash examples/multi_agent/run-qwen3-8B-multi-agent.sh

The relevant settings are:

--rollout-batch-size 16
--n-samples-per-prompt 4
--sglang-server-concurrency 16

A minimal reproduction is:

from slime.utils.types import Sample

nested_group = [[Sample(index=7)]]

for item in nested_group:
    index = getattr(item, "index", None)
    if index is not None:
        int(index)
Expected Behavior

The rollout should handle nested groups and continue training. It should find the leaf Sample.index and sort groups by that value.

Actual Behavior

The rollout crashes while sorting completed groups with:

TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'

For a nested group, getattr(item, "index", None) returns Python's built-in list.index method instead of a sample index.

Environment
- Python: 3.12.13
- PyTorch: 2.9.1+cu128
- CUDA: 12.8
- GPU: NVIDIA H20, 8 GPUs
- OS: Linux
- SGLang: 0.5.10.post1
Logs

Additional Context

No response

Pre-submission Checklist
  • I have read the CONTRIBUTING.md and understand the collaboration scope.
  • I have read the documentation and my issue is not addressed there.
  • I have searched for existing issues and this is not a duplicate.
  • I have provided a minimal, reproducible example.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with examples/multi_agent/run-qwen3-8B-multi-agent.sh and the fully_async_rollout.py sorting path named in the report, then compare its expected group shape with examples/multi_agent/rollout_with_multi_agents.generate_with_multi_agents. Reproduce with the provided nested Sample example or the demo command. Done means nested groups locate the leaf Sample.index, sort successfully, and the multi-agent rollout continues training.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.