Skip to content

[Bugfix] 指标 endpoint 注册冲突时告警并继续启动 - #40

Merged
lihenga merged 1 commit into
feature/optimize_mainfrom
lihenga/fix-service-metrics-startup-warning-20261021
Oct 21, 2026
Merged

lihenga merged 1 commit into
feature/optimize_mainfrom
lihenga/fix-service-metrics-startup-warning-20261021

Conversation

@lihenga

@lihenga lihenga commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Motivation

处理 Mooncake #83 的第二条 review 意见。多个服务复用 standalone Mooncake client daemon,或服务业务端口变化而 daemon 未重启时,第二次 set_service_endpoint() 会返回错误。此前 SGLang 将可观测性注册错误转成 RuntimeError,导致缓存初始化、服务启动失败。

Modifications

endpoint 注册返回非零时记录告警并继续初始化缓存、执行 warmup;成功注册与 SDK 缺少该接口的路径保持原行为。

保留 Mooncake 的单 endpoint 归属校验,避免直接覆盖后把累计历史计数归到新服务。告警明确说明:共享 daemon 保留原 endpoint;需要准确区分不同服务指标时,应各用独立 daemon。本 PR 不提供共享 daemon 的多服务指标隔离,也不把注册失败描述成整个共享 daemon 的指标已禁用。

新增回归复用同一个 fake SDK 实例,依次注册两个服务端口,验证第二次注册失败只告警、两次 warmup 都完成、原 endpoint 保留。

Accuracy Tests

VERIFIED:在指定 10.211.10.10 / Docker sglang0518_0920_yb 的独立目录中,使用实际 Python/torch 导入和 fake Mooncake SDK:

PYTHONPATH=python python3 -m pytest \
  test/registered/unit/mem_cache/test_mooncake_tenant_config.py -q

旧代码运行新增回归:1 failed,第二个服务构造时抛出 RuntimeError;修复后相关文件 19 passed,2 subtests passed。未修改已安装包或重启业务服务。

VERIFIED:有界自审未发现本次改动的其他具体缺陷;定向 Ruff、git diff --check、测试文件 Black 检查通过。生产文件全文件 Black 检查在基线上也会失败,差异位于两处未修改区域,本 PR 不混入格式清理。

Speed Tests and Profiling

UNTESTED:未启动真实共享 daemon、GPU 模型推理或性能 benchmark。本次只改变初始化失败分支,不改变读写和模型计算代码。

Checklist

  • 已完成本次改动的 AI 自审
  • 已增加并运行相关回归,包含旧代码失败证据
  • 已说明共享 daemon 的指标归属限制
  • 完整 pre-commit(工具不可用)
  • 人工逐行审核及实际环境返测

AI 辅助说明

使用 Codex 主智能体实现、验证及自审;未委派子智能体,未声称已完成人工审核。此 PR 仅处理 HYGON-AI#83 配套调用方,不包含仍在审核的 T01 / PR #39 或 N10 / PR #38。

@lihenga
lihenga merged commit 8d5d2fd into feature/optimize_main Oct 21, 2026
0 of 4 checks passed
lihenga pushed a commit that referenced this pull request Nov 2, 2026
* [Unified Cache][7/N]  Support MTP, EAGLE, and DSpark draft KV caches in the external linker

Adapt upstream PR #37914: sgl-project/sglang#37914
Upstream commit: a7cf4a6

Preserve the current unified-KV/HiSparse rejection and FP4 indexer region handling while integrating packed draft KV transfers. Port draft mapping tests and cover the retained layout guards.

Validation: Python 3.10 syntax, diff check, focused dependency-free mapping/metadata/draft-plan checks passed. Full PyTorch tests not run: torch and pytest unavailable on the login node.

* [Unified Cache] Abort requests whose external linker load fails instead of crashing the scheduler

Backport upstream PR #40896: sgl-project/sglang#40896
Upstream commit: f92199b

Keep this branch's tensor-prefix/load-back API, SWA eviction fields, is_insert release API, and all-rank Mooncake reads. Load KV into request-owned slots, agree on failures after forward, discard failed outputs, and abort with 503 without publishing incomplete KV. Preserve the existing unified-KV/HiSparse restrictions.

Validation: 78 targeted pytest cases and 12 subtests passed in the existing HCU container; Python 3.10 syntax, selected Ruff checks and git diff --check passed. No model-level end-to-end workload was run.

* [feat]支持GLM5.3-flash l3直通

---------

Co-authored-by: Codex <codex@example.invalid>
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