Skip to content

Kyojin: open-source engine that runs 100 GB-class open models (GLM-5.3, Qwen3.8, DeepSeek V4.1) on one desktop machine. AMD Strix Halo, NVIDIA RTX and Apple Mac. OpenAI API, built on ExLlamaV3.

1.1 KB
Raw Blame
"""CPU gate: which decode steps take the R-row exact paths (params["dflash_verify"]) without drafting."""
from hardware import require
require("ext")
from exllamav3.generator.row_groups import PLAIN_ROWS, plain_rows_verify
from exllamav3.util.row_inv import ROW_INV, ROW_INV_MAX_ROWS


def test_off_by_default_state_is_respected():
    old = PLAIN_ROWS["on"]
    try:
        PLAIN_ROWS["on"] = False
        assert not any(plain_rows_verify(r, False) for r in range(0, ROW_INV_MAX_ROWS + 4))
    finally:
        PLAIN_ROWS["on"] = old


def test_on_covers_rows_two_to_max_only():
    old, old_inv = PLAIN_ROWS["on"], ROW_INV["on"]
    try:
        PLAIN_ROWS["on"] = True
        ROW_INV["on"] = True
        got = [r for r in range(0, ROW_INV_MAX_ROWS + 4) if plain_rows_verify(r, False)]
        assert got == list(range(2, ROW_INV_MAX_ROWS + 1))
        assert not plain_rows_verify(4, True)            # a drafted step is already marked by its caller
        ROW_INV["on"] = False
        assert not plain_rows_verify(4, False)           # the exact paths need row invariance on
    finally:
        PLAIN_ROWS["on"], ROW_INV["on"] = old, old_inv