Skip to content

[BugFix] Fix AttributeError in eagle speculative decoding when bs != len(sampling_info)#23790

Open
lingebeng wants to merge 2 commits intosgl-project:mainfrom
lingebeng:linhaifeng/bugfix_00
Open

[BugFix] Fix AttributeError in eagle speculative decoding when bs != len(sampling_info)#23790
lingebeng wants to merge 2 commits intosgl-project:mainfrom
lingebeng:linhaifeng/bugfix_00

Conversation

@lingebeng
Copy link
Copy Markdown
Contributor

@lingebeng lingebeng commented Apr 27, 2026

Motivation

When I read the sglang's source code about speculative, I found something belows:

if bs != len(sampling_info):
sampling_info = copy.deepcopy(sampling_info)
# NOTE: retrieve_index are the indices of the requests that are kept.
sampling_info.filter_batch(
self.retrieve_index.tolist(), self.retrieve_index
)

from copy import copy shadowed the copy module, causing copy.deepcopy() to raise AttributeError. Changed to import copy to fix.

AttributeError: 'function' object has no attribute 'deepcopy'

Modifications

Only change from copy import copy to import copy, and I have found that no other copy in this file.
So the change is safe.

cc @Ying1123 @merrymercy @hnyls2002 @Qiaolin-Yu

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the import statement in eagle_info.py from from copy import copy to import copy to prevent shadowing the copy module. I have no further feedback to provide.

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

Successfully merging this pull request may close these issues.

1 participant