Skip to content

refactor: optimize beam search sequence reuse.#1223

Merged
RobbieLeung merged 1 commit intojd-opensource:mainfrom
RobbieLeung:feat/beam_optime
Apr 10, 2026
Merged

refactor: optimize beam search sequence reuse.#1223
RobbieLeung merged 1 commit intojd-opensource:mainfrom
RobbieLeung:feat/beam_optime

Conversation

@RobbieLeung
Copy link
Copy Markdown
Collaborator

  • snapshot generated suffix state for beam candidates instead of copying full sequences
  • reuse or replace sequence objects based on suffix shape before applying beam results
  • keep batch beam-search output updates aligned with source sequence state

- snapshot generated suffix state for beam candidates instead of copying full sequences
- reuse or replace sequence objects based on suffix shape before applying beam results
- keep batch beam-search output updates aligned with source sequence state
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 refactors the beam search implementation by introducing the BeamSourceInfo structure and updating BeamCandidate to optimize sequence management and token updates. The changes improve efficiency by avoiding unnecessary sequence re-allocations and refining the logic for updating generated tokens. Feedback focuses on ensuring that all new member variables in the BeamSourceInfo and BeamCandidate structures follow the repository's naming convention (Rule 16), which requires a trailing underscore for member variables.

Comment thread xllm/core/framework/batch/beam_search.h
Comment thread xllm/core/framework/request/sequences_group.cpp
Comment thread xllm/core/framework/request/sequences_group.cpp
Comment thread xllm/core/framework/request/sequences_group.cpp
Comment thread xllm/core/framework/request/sequences_group.cpp
Comment thread xllm/core/framework/request/sequences_group.cpp
Comment thread xllm/core/framework/request/sequences_group.cpp
@RobbieLeung RobbieLeung merged commit b98b9b9 into jd-opensource:main Apr 10, 2026
17 of 35 checks passed
@RobbieLeung RobbieLeung deleted the feat/beam_optime branch April 14, 2026 06:17
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.

3 participants