AReaLite vllm 同步场景 改造+精度对齐 - #3
Open
Bruce-rl-hw wants to merge 10 commits into
Open
Conversation
|
This pull request has been automatically marked as stale because it has not had recent activity within the last 14 days. Please add a comment or push new commits to keep it active. Thank you for your contribution! |
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.
详细差异
vllm_remote.py(类型:实质逻辑重写 / 热更新 + 生成路径)关键改动
agenerate:while循环分批追加生成(迭代拼接input_ids+ 已生成 tokens)。result['choices'][0]['logprobs']['tokens']+convert_tokens_to_ids替代直接tokenizer.encode。output_tokens/logprobs/versions(仍以-1占位)。stop_reason,降低噪音。update_weights(disk):CMD_REMAINED,定位--model路径并替换为新的meta.path。psutil基于 根进程 + 子孙进程 构建expanded_pids(移除端口/关键字扫描与LISTEN扩展)。SIGTERM(等待 5s)→SIGKILL(等待 2s),降低残留概率。GET_ALL_PID并写回环境变量;适当放宽setup_timeout。cuda.empty_cache/gc.collect注释块作为可选优化。logprob 截断修正
生成循环内改为直接使用 vLLM 返回的
logprobs["tokens"]与token_logprobs,弃用旧的tokenizer.encode+ 长度对齐截断方式,避免原实现中 logprobs 数组 与 输出 token 序列 长度不一致的问题(去掉手工 slice / FIXME 截断)。效果:对齐精确、去除隐式截断带来的统计偏差;便于跨后端(HF / SGLang / vLLM)一致性对比。
权重更新顺序调整
重构 “upload(写出/同步权重) → update(服务侧热替换)” 的依赖关系,移除 vLLM 侧对
update_weights/0目录层级的读取假设;重启时动态替换命令行中的--model为新路径,避免固定从.../update_weights/0抓取的硬编码耦合。效果:目录结构解耦、更新路径更灵活;支持多版本/多位置权重切换与回滚。
潜在合并阻塞点
/home/b84412626、/data/b84412626、/home/.../datasets--)需恢复为占位符或变量化。