| 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | # SPDX-FileCopyrightText: Copyright contributors to the vLLM project |
| 3 | |
| 4 | import torch |
| 5 | from torch import nn |
| 6 | |
| 7 | from vllm.models.inkling.amd.sconv_swa_attn import InklingConvState |
| 8 | |
| 9 | |
| 10 | def test_runtime_sconv_block_size_tracks_unified_cache_page(): |
| 11 | """The cache planner may enlarge W=4 blocks to match attention pages.""" |
| 12 | owner = InklingConvState.__new__(InklingConvState) |
| 13 | nn.Module.__init__(owner) |
| 14 | owner.block_size = 4 |
| 15 | |
| 16 | owner.kv_cache = torch.tensor([]) |
| 17 | assert owner.cache_block_size == 4 |
| 18 | |
| 19 | owner.kv_cache = torch.empty(2, 1, 32, 1024) |
| 20 | assert owner.cache_block_size == 32 |