Skip to content

Feat spdiag logging - #36

Closed
ZhiningPan wants to merge 291 commits into
LinQuickDev:mainfrom
ZhiningPan:feat-spdiag-logging
Closed

Feat spdiag logging#36
ZhiningPan wants to merge 291 commits into
LinQuickDev:mainfrom
ZhiningPan:feat-spdiag-logging

Conversation

@ZhiningPan

@ZhiningPan ZhiningPan commented Aug 27, 2026

Copy link
Copy Markdown

Description

Module

  • Transfer Engine (mooncake-transfer-engine)
  • Mooncake Store (mooncake-store)
  • Reshard (mooncake-reshard)
  • Mooncake EP (mooncake-ep)
  • Mooncake PG (mooncake-pg)
  • Integration (mooncake-integration)
  • P2P Store (mooncake-p2p-store)
  • Python Wheel (mooncake-wheel)
  • Common (mooncake-common)
  • Mooncake RL (mooncake-rl)
  • CI/CD
  • Docs
  • Other

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change
  • Documentation update
  • Performance improvement
  • Other

How Has This Been Tested?

Test commands:

# Example: bash scripts/run_ci_test.sh

Test results:

  • Unit tests pass
  • Integration tests pass (if applicable)
  • Manual testing done (describe below)

Checklist

  • I have performed a self-review of my own code
  • I have formatted my code using ./scripts/code_format.sh
  • I have run pre-commit on the files changed in this PR and all hooks pass
  • I have updated the documentation (if applicable)
  • I have added tests to prove my changes are effective
  • For changes >500 LOC: I have filed an RFC issue

AI Assistance Disclosure

  • No AI tools were used
  • AI tools were used (specify below)

yuanhao-426 and others added 30 commits May 26, 2026 11:48
- 新增日志配置章节,说明环境变量 MC_LOG_LEVEL 和 MC_LOG_DIR 的用法
- 新增异步日志改造方案章节,提供 spdlog 和 glog 包装两种方案
- 详细对比两种方案的优缺点,为后续性能优化提供参考
- 新增 mooncake_common 日志库,提供 MC_LOG/MC_VLOG 宏,支持异步输出和 TraceId 跟踪
- 为 get/put 等读写操作自动生成唯一 TraceId,通过线程本地和 ScopedTraceId 在异步任务中传递
- 添加环境变量 MC_LOG_ENABLE 控制日志开关,支持 off/0/false/no 值关闭普通日志
- 在 transfer_task 中为 MemcpyTask 和 FilereadTask 添加 trace_id 字段,确保异步任务日志可追踪
- 新增性能监控日志:transfer_future_wait、open_segment_breakdown、submit_transfer_breakdown
- 更新 CMakeLists.txt 链接依赖,添加相关文档说明日志格式和 Trace 机制
- 在 UB/URMA 建连路径添加 UbDiag 性能监控点
- 为 RealClient 公开操作添加慢操作告警(阈值 3000us)
- 更新日志逻辑以支持 FLAGS_minloglevel
- 清理 Python binding 中的冗余日志
- 更新相关文档说明
- 在 real_client.cpp 中,将 replica_selected 日志的副本类型从 "memory" 和 "local_disk" 细化为 "memory_local"、"memory_remote"、"local_disk_local" 和 "local_disk_remote",以区分本地与远程副本
- 更新 docs/yh/log-reference.md 文档,补充新增的传输任务层、URMA 建连层及 Client 创建日志的详细说明,并同步其他日志格式的更新
- 在 OperationState 及其子类构造函数中增加 trace_id 参数,用于传递调用链追踪标识
- 在 TransferSubmitter 提交 MemcpyTask 和 FilereadTask 时捕获当前线程的 trace_id
- 在传输任务执行时通过 RestoreTraceIfMissing 恢复缺失的 trace 上下文
- 更新文档说明 trace_id 在同步/异步调用链中的传播机制
# Conflicts:
#	mooncake-store/benchmarks/CMakeLists.txt
#	mooncake-store/src/real_client.cpp
#	mooncake-store/src/utils.cpp
- 更新 build.sh 脚本,在 EXT_LDFLAGS 链接标志中增加 -lubdiag
- 更新 CMakeLists.txt,为 mooncake_master 和 mooncake_client 目标链接 UbDiag::ubdiag_lib 库
在传输层和元数据处理中添加 trace_id 字段,用于跨组件的请求追踪:
- 在 TransferMetadata 和 Transport::Slice 结构中添加 trace_id 字段
- 在 UB 传输提交任务时设置当前 trace_id
- 在握手过程中传递和恢复 trace_id
- 在 worker 处理时根据 slice 的 trace_id 恢复上下文
- 将相关日志输出从 LOG 更新为 MC_LOG
Yuchen Kou and others added 20 commits August 7, 2026 17:38
Remove the temporary pre-remount recovery lease and require memory replicas to be readable before ordinary eviction and offload. Keep oplog descriptor prediction aligned with the actual eviction predicate.
chore(spdiag): pin L0 source to v1.0.0 commit
fix(tracing): 添加缺失的 span 结束调用
依据 vllm_spdiag_logging_plan.md,按 Q1b/Q2A/Q3b 方案为 Mooncake Store
vLLM 调用链添加 SpDiag 性能打点与日志输出:

- mooncake_perf_points.def: 追加 25 个新 PerfKey,覆盖 store_py 入口
  层(STORE_PY_*)、RealClient 核心层(RC_*)、Client 服务层
  (CLIENT_BATCH_QUERY)。
- store_py.cpp: 为 setup/register_buffer/batch_put_from_multi_buffers/
  batch_get_into_multi_buffers/batchIsExist/remove_all/close 等 8 个
  Python 绑定方法添加 PerfPoint(KEY_MODULE),remove_all 与 close
  额外输出 MC_LOG 汇总行。
- real_client.cpp: 为 setup_real/batchIsExist/batch_put_from_multi_
  buffers/batch_get_into_multi_buffers 等 9 个方法添加 PerfPoint;
  下沉层 _internal 方法用 MODULE 级别,并按 Q1b 输出 MC_LOG 汇总行
  + per-key 多行(包含 success/key/size/replica/endpoint 字段,
  缺失字段不输出)。
- client_service.cpp: 在 L1117 BatchQuery 实际实现中添加
  CLIENT_BATCH_QUERY PerfPoint(Q3b,仅实际实现,避免重复统计)。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants