Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions vllm_ascend/patch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,26 @@
# Future Plan:
# Remove this patch after the upcoming KV cache spec refactor.
#
# ** 9. File: platform/patch_minimax_usage_accounting.py**
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1. `vllm.entrypoints.openai.chat_completion.serving.OpenAIServingChat`
# `vllm.entrypoints.openai.engine.protocol.UsageInfo`
# `vllm.reasoning.minimax_m2_reasoning_parser`
# Why:
# MiniMax M2 reasoning outputs use `</think>` as the only boundary token,
# but the runtime usage accounting path either omits reasoning token
# details entirely or counts them incorrectly.
# How:
# Monkey-patch the MiniMax reasoning token counters, extend `UsageInfo`
# with `completion_tokens_details.reasoning_tokens`, and update chat
# streaming/non-streaming usage generation to propagate the corrected
# counts.
# Related PR (if no, explain why):
# https://github.com/vllm-project/vllm/pull/37955
# Future Plan:
# Remove this patch once the upstream MiniMax usage-accounting fix is in
# the runtime vLLM version used by vllm-ascend.
#
# * Worker Patch:
# ===============
#
Expand Down
1 change: 1 addition & 0 deletions vllm_ascend/patch/platform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import vllm_ascend.patch.platform.patch_minimax_m2_config # noqa
import vllm_ascend.patch.platform.patch_sched_yield # noqa
import vllm_ascend.patch.platform.patch_torch_accelerator # noqa
import vllm_ascend.patch.platform.patch_minimax_usage_accounting # noqa

if os.getenv("DYNAMIC_EPLB", "false").lower() in ("true", "1") or os.getenv("EXPERT_MAP_RECORD", "false") == "true":
import vllm_ascend.patch.platform.patch_multiproc_executor # noqa
Expand Down
Loading
Loading