Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vllm grpo trainer inputs_ids bug #134

Open
tcy6 opened this issue Feb 24, 2025 · 0 comments
Open

vllm grpo trainer inputs_ids bug #134

tcy6 opened this issue Feb 24, 2025 · 0 comments

Comments

@tcy6
Copy link

tcy6 commented Feb 24, 2025

setting: 卡0_5用于训练,卡6部署vllm
当我尝试在_prepare_inputs函数中打印inputs_ids的size时

prompt_inputs = self.processing_class(
            # prompts_text, return_tensors="pt", padding=True, padding_side="left", add_special_tokens=False
            text=prompts_text,
            images=images,
            return_tensors="pt",
            padding=True,
            padding_side="left",
            add_special_tokens=False,
        )
        prompt_ids, prompt_mask = (
            prompt_inputs["input_ids"].to(device),
            prompt_inputs["attention_mask"].to(device),
        )
        print(f"{prompt_inputs['input_ids'].size()}")
        if self.max_prompt_length is not None:
            prompt_ids = prompt_ids[:, -self.max_prompt_length :]
            prompt_mask = prompt_mask[:, -self.max_prompt_length :]

我发现打印结果总是这样的

torch.Size([1, 1598])
torch.Size([1, 1598])
torch.Size([1, 1598])
torch.Size([1, 1598])
torch.Size([1, 1598])
torch.Size([1, 1614])

即总是存在一张卡上的input_ids的size和其他卡不一样,原因目前还在寻找中,但是应该是一个bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant