fix: restore cross-sequence ban for n returns#1177
Open
Xavier2024P wants to merge 2 commits into
Open
Conversation
Collaborator
AI Code Review - PR #1177Status: BLOCKING Summary: P0/0 · P1/3 · P2/0 · P3/0 Blocking IssuesP1
Checklist Violations (4 fail / 91 total)General Principles Checklist
RTP-LLM Checklist
Strengths
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nthroughGenerateConfig.update()soenable_cross_sequence_banis revalidated and can be re-enabled afternum_return_sequencesis supplied.num_return_sequences > 1as a full-position token offset signal inRecommendationLogitsProcessor; only beam search uses offset reads.Why
When
n=4/num_return_sequences=4is used together withenable_cross_sequence_ban=true, the OpenAI path can leaveenable_cross_sequence_bandisabled becauserequest.nwas assigned directly instead of going throughGenerateConfig.update().Separately,
RecommendationLogitsProcessortreatednum_return_sequences > 1as requiring full-position token offset reads. In non-beam multi-return generation,new_tokensis incremental ([N, num_new_tokens]), so the offset path can read out of bounds and cause a core dump.Changes
config.update({"num_return_sequences": request.n})in the OpenAI endpoint.needs_token_offsetto depend only onconfig->hasNumBeams().num_return_sequences > 1uses incremental token tensors and keeps cross-sequence ban enabled;