[Bugfix][MiniCPM-o] Fix async-chunk snapshot replacement and prompt cleanup (#6406)
Signed-off-by: natureofnature <wzliu@connect.hku.hk> Co-authored-by: amy-why-3459 <wuhaiyan17@huawei.com>
This commit is contained in:
1 parent
ea0a24465b
commit
4f7c08c0eb
14 files changed
+458
-19
No files matched your search
@@ -9,6 +9,8 @@ import pytest
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
||||
pytest.importorskip("vllm_ascend")
|
||||
|
||||
from tests.helpers.mark import hardware_marks
|
||||
from vllm_omni.model_executor.models.minicpmo_4_5.batched_token2wav import (
|
||||
BatchedToken2Wav,
|
||||
@@ -21,6 +23,8 @@ from vllm_omni.platforms.npu.models.minicpmo_4_5_code2wav import (
|
||||
from vllm_omni.platforms.npu.models.step_audio2_token2wav import (
|
||||
npu_token2wav_sdpa_context,
|
||||
)
|
||||
from vllm_omni.platforms.npu.worker.npu_model_runner import OmniNPUModelRunner
|
||||
from vllm_omni.worker.gpu_model_runner import OmniGPUModelRunner
|
||||
|
||||
pytestmark = [
|
||||
pytest.mark.core_model,
|
||||
@@ -47,6 +51,25 @@ class _Token2Wav:
|
||||
self.speech_window = torch.ones(4, device="npu")
|
||||
|
||||
|
||||
def test_npu_runner_inherits_runtime_snapshot_replacement():
|
||||
assert issubclass(OmniNPUModelRunner, OmniGPUModelRunner)
|
||||
assert OmniNPUModelRunner._replace_intermediate_buffer is OmniGPUModelRunner._replace_intermediate_buffer
|
||||
runner = object.__new__(OmniNPUModelRunner)
|
||||
request = SimpleNamespace(additional_information_cpu=None)
|
||||
runner.requests = {"req": request}
|
||||
runner.model_intermediate_buffer = {
|
||||
"req": {
|
||||
"codes": {"audio": torch.tensor([1, 2])},
|
||||
"meta": {"last_chunk": True},
|
||||
}
|
||||
}
|
||||
|
||||
runner._replace_intermediate_buffer("req", {"meta": {"is_segment_finished": True}})
|
||||
|
||||
assert runner.model_intermediate_buffer["req"] == {"meta": {"is_segment_finished": True}}
|
||||
assert request.additional_information_cpu == runner.model_intermediate_buffer["req"]
|
||||
|
||||
|
||||
def test_minicpmo_cfm_estimator_npugraph_matches_eager():
|
||||
decoder_dit = pytest.importorskip("cosyvoice2.flow.decoder_dit")
|
||||
prepare_code2wav_graph_runtime()
|
||||
|
||||
Reference in new issue
Block a user