add input embedding for pg#956
Open
parkerpang wants to merge 2 commits intoalibaba:mainfrom
Open
Conversation
parkerpang
commented
Apr 30, 2026
- 支持 generate input 携带 input_embeddings,允许用户传入额外的 embedding 向量替换指定位置的 token embedding
- 完整数据通路:Proto 定义 → RPC 序列化/反序列化 → GenerateStream 访问器 → NormalModelInputGatherer 收集
- 在 setReuseLength 中增加保护,将 reuseLength cap 到 min(embedding_locs),防止 gather 时产生负索引
- Cap reuseLength to min(input_embeddings_locs) in setReuseLength to prevent negative adjusted locations during gather - Fix test compilation: replace nonexistent setRunning()/batch_block_id with correct APIs matching existing test patterns - Add testInputEmbeddingsReuseLengthCapped test case Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
AI Code Review - PR #956Status: LGTM Summary: P0/0 · P1/0 · P2/2 · P3/2 lgtm ready to ci Non-blocking SuggestionsP2
P3
Review Checklist: 5 pass / 5 failGeneral Principles ChecklistFailed
Passed
RTP-LLM ChecklistPassed
Python Static-First ChecklistFailed
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.