mirror of
https://github.com/deepseek-ai/DeepInfer.git
synced 2026-10-31 00:36:20 +08:00
store_kv_cache and load_paged_kv_cache, both byte-for-byte identical to the TileLang baseline on the layouts SM90 uses: main/SWA KV (e4m3 values, ue8m0 scale bytes, 528 B per token) and index KV (128 fp8 + one fp32 scale, 132 B per token). The store also covers fp32 scales, because the index layout uses them. FP4 caches and the packed-ue8m0 index layout are refused instead of approximated. Store cases compare the whole cache buffer, including the `-1` invalid-slot path and a block size (134) that is not a power of two. Load cases cover dequantising to BF16, the index passthrough, and holes expressed as `src_block_id == -1`. Two traps worth recording: The load kernel's `other=` default has to be a float literal. With an fp8 source pointer, `other=0` fails to type-check with a message about casting an int32 tile to fp8e4nv, which points at the wrong line. The load cases originally filled the cache with random bytes. Random bytes decode as fp8 NaN and as NaN scale factors, and NaN compares unequal to itself, so the harness reported mismatches that said nothing about the kernel. The cases now build the cache with `store_kv_cache` and compare index outputs as raw bytes, where a NaN bit pattern is just a byte pattern. 15 kernels and 62 cases agree. |
||
|---|---|---|
| .. | ||
| _C | ||
| distributed | ||
| engine | ||
| entrypoints | ||
| h20_ops | ||
| hugging_face | ||
| model_executor | ||
| npu_ops | ||
| structure_output | ||
| ve | ||
| worker | ||
| __init__.py | ||
| attrdict.py | ||
| config.py | ||
| debug_dump.py | ||
| environ.py | ||
| load_class.py | ||
| logger.py | ||
| model_config_loader.py | ||
| multimodal_tokens.py | ||
| platform.py | ||
| py.typed | ||
| sampling_params.py | ||
| sequence.py | ||
| shared_memory.py | ||
| testing.py | ||
| timer.py | ||
| utils.py | ||