@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 5f317530ec
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

fix(tests): Resolve late binding of loop variable in assert message lambda (#26249)

Signed-off-by: lyd1992 <liuyudong@iscas.ac.cn> Signed-off-by: ihb2032 <1355790728@qq.com

ihb2032 committed Oct 6, 2025 at 00:18 UTC 5f317530ec23444da83cc15c0d3a51c4c2239d5a
1 file changed +6 -6
tests/kernels/mamba/test_mamba_ssm_ssd.py
+6 -6
@@ -562,15 +562,15 @@ def test_mamba_chunk_scan_cont_batch_prefill_chunking(chunk_size, seqlens):
562 Y_ref_seq[: chunked_seqlens[i], ...],
563 atol=atol,
564 rtol=rtol,
565 - msg=lambda x: f"seq{i} output part1 " + x,
566 - ) # noqa: B023
565 + msg=lambda x, i=i: f"seq{i} output part1 " + x,
566 + )
567 torch.testing.assert_close(
568 Y_seq[chunked_seqlens[i] :, ...],
569 Y_ref_seq[chunked_seqlens[i] :, ...],
570 atol=atol,
571 rtol=rtol,
572 - msg=lambda x: f"seq{i} output part2 " + x,
573 - ) # noqa: B023
572 + msg=lambda x, i=i: f"seq{i} output part2 " + x,
573 + )
574
575 state_seq = state_chunked[i]
576 state_seq_ref = state_ref[i]
@@ -579,5 +579,5 @@ def test_mamba_chunk_scan_cont_batch_prefill_chunking(chunk_size, seqlens):
579 state_seq_ref,
580 atol=atol,
581 rtol=rtol,
582 - msg=lambda x: f"seq{i} state " + x,
583 - ) # noqa: B023
582 + msg=lambda x, i=i: f"seq{i} state " + x,
583 + )