verl icon indicating copy to clipboard operation
verl copied to clipboard

Tool call prase Error in slang_rollout

Open Nidryen-zh opened this issue 3 months ago • 1 comments

System Info

When running examples/sglang_multiturn/run_qwen2.5-3b_gsm8k_multiturn.sh, the model used is Qwen/Qwen2.5-3B-Instruct. However, when get tool call parser, the function returns Glm4MoeDetector. Since Glm4MoeDetector.bot_token.strip() and Glm4MoeDetector.eot_token.strip() also in Qwen2.5's vocab.

Env:
torch: 2.8.0
sglang: 0.5.5.post3
transformers: 5.0.0.dev0
# In verl/workers/rollout/sglang_rollout/sglang_rollout.py, line 230 - 257

def get_tool_call_parser_type(
    processing_class: PreTrainedTokenizer | PreTrainedTokenizerFast | ProcessorMixin,
) -> str:
    breakpoint()

    items = FunctionCallParser.ToolCallParserEnum.items()
    if "gpt-oss" in getattr(processing_class, "name_or_path", "").lower():
        logger.debug(f"gpt-oss model detected from name_or_path: {processing_class.name_or_path}")
        logger.debug("Using 'gpt-oss' tool call parser.")
        return "gpt-oss"
    for parser_type, parser_cls in items:
        parser = parser_cls()
        try:
            # This is when processing_class is a tokenizer
            tokenizer_vocab = processing_class.get_vocab()
        except AttributeError:
            try:
                # This is when processing_class is a processor
                tokenizer_vocab = processing_class.tokenizer.get_vocab()
            except AttributeError as e:
                raise ValueError(f"Cannot get vocab from processing_class {processing_class}") from e

        if parser.bot_token.strip() in tokenizer_vocab and (
            parser.eot_token == "" or parser.eot_token.strip() in tokenizer_vocab
        ):
            return parser_type
    else:
        raise ValueError(f"No tool call parser found for processing_class {processing_class}")``

Information

  • [x] The official example scripts
  • [ ] My own modified scripts

Tasks

  • [x] An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • [ ] My own task or dataset (give details below)

Reproduction

Reproduction:

  1. cd root dir
  2. bash examples/sglang_multiturn/run_qwen2.5-3b_gsm8k_multiturn.sh
  3. You can print the returned parser_type in function get_tool_call_parser_type in verl/workers/rollout/sglang_rollout/sglang_rollout.py, line 230 - 257

Expected behavior

The parser type should be Qwen25Detector (from sglang.srt.function_call.qwen25_detector import Qwen25Detector) when using Qwen2.5 model

Nidryen-zh avatar Nov 20 '25 07:11 Nidryen-zh

Closed my PR because SPMD will be deprecated https://github.com/volcengine/verl/pull/4106

JobQiu avatar Nov 23 '25 11:11 JobQiu