Skip to content

docs: remove response anomaly design document from docs tree - #485

Closed
Libotry wants to merge 43 commits into
AISBench:masterfrom
Libotry:br_response_anomaly
Closed

Libotry wants to merge 43 commits into
AISBench:masterfrom
Libotry:br_response_anomaly

Conversation

@Libotry

@Libotry Libotry commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

PR Type / PR类型

  • Feature(功能新增)
  • Bugfix(Bug 修复)
  • Docs(文档更新)
  • CI/CD(持续集成/持续部署)
  • Refactor(代码重构)
  • Perf(性能优化)
  • Dependency(依赖项更新)
  • Test-Cases(测试用例更新)
  • Other(其他)

Related Issue | 关联 Issue
Relates to #468

🔍 Motivation / 变更动机

响应异常检测模块的设计文档《AISBench推理响应异常检测模块设计.md》随 PR #468 合入,但它属于内部设计资料,与面向用户的工具文档体系不匹配:

  • design/ 目录不在 docs/source_zh_cn/index.rst 的任何 toctree 中,文档导航里不可见,读者只能通过直接 URL 访问
  • 设计文档中的配置示例与用户工具文档(get_started/install.md、base_tutorials/all_params/*.md)存在职责重叠,容易造成读者困惑
  • 该特性的用户侧说明已完整覆盖在 toctree 内的四个页面中(安装指南、CLI 参数、模式说明、模型配置),移除设计文档不影响用户文档完整性

因此本 PR 将其从文档目录中清理,保持用户文档体系的整洁。

📝 Modification / 修改内容

删除文件 docs/source_zh_cn/design/AISBench推理响应异常检测模块设计.md(372 行)。

  • 纯文档变更,不涉及任何代码逻辑
  • 无其他文件改动
  • 分支已同步 upstream master(merge commit 在分支历史中),无合并冲突

📐 Associated Test Results / 关联测试结果

纯文档删除,不涉及代码与测试。文档构建验证可通过 /readthedocs build CI 命令触发。

⚠️ BC-breaking (Optional) / 向后不兼容变更(可选)

无。仅删除一份未纳入 toctree 的设计文档,不影响任何 API、配置或下游使用。

⚠️ Performance degradation (Optional) / 性能下降(可选)

无。

🌟 Use cases (Optional) / 使用案例(可选)

不适用(纯文档清理)。

✅ Checklist / 检查列表

Before PR:

  • Pre-commit or other linting tools are used to fix the potential lint issues. / 使用预提交或其他 lint 工具来修复潜在的 lint 问题。(纯 Markdown 文件删除,无 lint 对象)
  • Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests. / 修复的 Bug 已完全由单元测试覆盖,导致 Bug 的情况应在单元测试中添加。(不适用:非 Bugfix)
  • The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness. / 此拉取请求中的修改已完全由单元测试覆盖。如果不是,请添加更多单元测试以确保正确性。(不适用:纯文档变更)
  • All relevant documentation (API docs, docstrings, example tutorials) has been updated to reflect these changes. / 所有相关文档(API 文档、文档字符串、示例教程)已更新以反映这些更改。(用户文档不受影响,该文档不在任何导航或引用链中)

After PR:

  • If the modification has potential influence on downstream or other related projects, this PR should be tested with those projects. / 如果此拉取请求对下游或其他相关项目有潜在影响,应在那些项目中测试此 PR。(无潜在影响:删除的文档无任何文件引用它)
  • CLA has been signed and all committers have signed the CLA in this PR. / CLA 已签署,且本 PR 中的所有提交者均已签署 CLA。

👥 Collaboration Info / 协作信息

🌟 Useful CI Command / 实用的CI命令

Command / 命令 Introduction / 介绍
/gemini review Performs a code review for the current pull request in its current state by Gemini. / 对当前拉取请求在当前状态下由 Gemini 执行代码审核。
/gemini summary Provides a summary of the current pull request in its current state by Gemini. / 对当前拉取请求在当前状态下由 Gemini 提供摘要。
/gemini help Displays a list of available commands of Gemini. / 显示 Gemini 可用命令的列表。
/readthedocs build Triggers a build of the documentation for the current pull request in its current state by Read the Docs. / 触发当前拉取请求在当前状态下由 Read the Docs 构建文档。
/pr_check 手动重新触发 PR 合入质量检查工作流(PR Quality Check),并在 PR 上评论即可生效。 / Manually re-runs the PR Quality Check workflow by commenting on the pull request.

Libotry added 30 commits August 15, 2026 17:59
- Move model-specific msProbe settings into model-level response_anomaly config
- Use ILLDetector with configurable config.yaml/mtype_config.json/token2category paths
- Add ais_bench-gen-response-anomaly-config tool wrapping the official msProbe generator
- Auto-generate model configs from model_path when custom paths are absent
- Make status board, resume inheritance and unsupported-mode gating robust
- Replace same-length non-prefix snapshots instead of dropping them
- Reuse ResponseAnomalyCoordinator.STATUS_FILE_NAME in all call sites
- Keep gen_model_config tools dir on failure and add tests
- Remove redundant model_name fallback and simplify status file read
- Force logprobs/top_logprobs when response anomaly is enabled and validate
- Extend monitor progress total for auxiliary tasks
- Handle mixed full-token/current-topk stream chunks and ignore misaligned ones
…match id+uuid on resume

- Run the official msProbe generator inside an isolated temp directory so a
  partial failure never clobbers the target mtype_config.json; merge
  generated files into the target only on success
- Overwrite None-valued msprobe_config_path (set by ConfigManager) with the
  auto-generated path so user-tuned config.yaml thresholds take effect
- Match inherited results on id+uuid instead of id alone so a re-inferred
  response is not assigned a stale anomaly result
- Add tests for all three fixes
- Change the full-snapshot branch from >= to > so that a single-token
  chunk equal to the current state (two consecutive identical tokens in
  an incremental stream) falls through to the incremental-append branch
  instead of being silently dropped as a no-op snapshot
- Cache the per-model anomaly config and ILLDetector so that a model
  with multiple datasets only generates its msProbe config and loads
  token2category once instead of once per dataset
- Add test_stream_consecutive_identical_tokens_are_not_dropped
- Log a debug message when a misaligned streaming response chunk is
  dropped so payload misalignment is not silently ignored
- Warn per model/dataset group when predictions are missing, and warn
  once when no service model/dataset groups are configured at all,
  instead of silently finishing with zero analyzed cases
- Hoist the result directory mkdir out of the per-prediction loop
- Add end-to-end tests for the _detect loop, the empty-prediction
  warning, and misaligned chunk logging
The normalized model name is written by AISBench and looked up by msProbe
using the same split+join algorithm, so consecutive separators produce
double dashes on both sides (foo__bar -> foo--bar). Lock this behavior
with tests so a future cleanup cannot silently break the msProbe sync.
Avoid writing payloads that are already retained in the seeded archive
when resuming in all-retention mode, and stop recording transient
payload shard references in detection results.
Document the new msProbe response anomaly detection feature in install,
mode, models, and cli_args docs (zh + en). Cover:
- Optional dependencies (mindstudio-probe + zstandard) via
  requirements/response_anomaly.txt or response_anomaly extra
- Mode support: all/infer/infer_judge only; perf/viz/Agent unsupported
- Service model-level response_anomaly config fields
- Full CLI args and retention semantics mirrored from zh to en
The manual merge of the spec-decode wrapper and the response anomaly
startup in Infer.do_work dropped the method-level indentation of the
spec decode snapshot call during rebase conflict resolution.
- tests: use pytest.importorskip('zstandard') so the UT modules skip
  instead of failing collection when the response_anomaly extra is not
  installed (CI installs api.txt + extra.txt only)
- base_handler: a response anomaly payload staging failure no longer
  aborts inference/eval; warn once, disable staging, and keep payloads
  inline in predictions
- add regression test for graceful staging degradation
Mirror the response_anomaly template block from vllm_api_general_chat
into the streaming chat config. VLLMCustomAPIChat already injects
return_token_ids request params and base_api handles streaming payload
accumulation, so no code change is required.
- Bind detection to the inference stage: log when the coordinator starts
  right after the runner finishes, and pin the ordering with tests
- Enforce msProbe model resources: model_path falls back to the model
  'path' (tokenizer dir); missing resources now fail fast with fix
  guidance instead of silently falling back to msProbe built-ins, and
  auto-generated config paths are logged
- Reject unsupported model classes (only VLLMCustomAPIChat backends can
  return token ids + top-k logprobs) at config init
- Expose per-task anomaly report and print result/payload/log paths
  whenever anomalies are detected
…robe paths

- TasksMonitor only reads the response anomaly status file when opted in;
  eval/judge boards no longer mix the detection task into their table,
  and the dedicated anomaly board keeps rendering it
- Validate that explicitly configured msprobe resources (config/mtype/
  token2category) and model_path exist at config time; missing files now
  abort startup with the offending paths instead of failing every case
  at runtime
- Drop placeholder msprobe paths from the vllm chat config templates so
  the auto-generation fallback (model path -> tokenizer dir) is the
  documented default
- ResponseAnomalyWait now also warns when cases ended up failed/
  unavailable, pointing at the task log for the root cause
Restore msprobe_config_path/msprobe_mtype_path/msprobe_token2category_dir
keys in the response_anomaly template blocks so the config surface stays
discoverable; empty-string values keep them inert (treated as unset by
the existence validation) while placeholder '/path/to/...' values are
gone.
When model_path (local tokenizer) is provided, explicitly configured
msprobe_config_path / msprobe_mtype_path / msprobe_token2category_dir
now act as generation outputs: the generated resources are placed there,
reusing existing files untouched. An empty msprobe_config_path keeps the
msProbe built-in default. Without model_path the configured paths must
already exist (unchanged).
The dedicated board only started while detection was still running, but
detection usually finishes before the workflow reaches ResponseAnomalyWait
(it runs in parallel with eval and is much faster). Combined with
evaluation boards no longer rendering detection status, the final
detection table disappeared from the console entirely. Start the board
whenever a detection status file exists so the final table is always
printed; keep skipping it when no status was ever written to avoid the
board waiting forever on tasks that never started.
Libotry added 13 commits August 18, 2026 15:04
Detection now starts and completes inside the Infer worker: the
dedicated status board renders right after the inference board and
before any evaluation board starts, so the detection table finally
appears between infer and eval as requested. ResponseAnomalyWait and
its WORK_FLOW entries are removed (no longer needed), and the design
doc is updated accordingly. Trade-off: detection no longer overlaps
with eval; total runtime grows by the detection duration.
test_write_to_json_stages_payload_separately exercises the zstd staging
writer, which imports zstandard lazily. In environments without the
response_anomaly extra the graceful staging degradation keeps payloads
inline, failing the assertNotIn. Skip the test there, matching the guard
already used by the other response anomaly test modules.
Copilot AI lite review requested due to automatic review settings August 25, 2026 02:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

✅ PR 合入质量五项检查全部通过,允许合入。

@Libotry

Libotry commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

关闭此 PR:原分支包含较多历史提交(fork 未同步时的旧基线)。已改用基于最新 master 的干净单提交分支重新提交,见 #486。变更内容完全一致:删除设计文档 docs/source_zh_cn/design/AISBench推理响应异常检测模块设计.md。

@Libotry Libotry closed this Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants