Skip to content

vllm.utils.b12x

Accessors for the b12x package shipped with flashinfer-python.

Functions:

has_b12x()

Return whether the b12x package is available.

Source code in vllm/utils/b12x.py
def has_b12x() -> bool:
    """Return whether the b12x package is available."""
    return _HAS_B12X

reuse_packed_weight_storage(current, replacement)

Reuse packed tensor addresses when a compatible weight is reloaded.

Source code in vllm/utils/b12x.py
@torch.no_grad()
def reuse_packed_weight_storage(current: Any, replacement: Any) -> Any:
    """Reuse packed tensor addresses when a compatible weight is reloaded."""
    if current is None or not _same_packed_layout(current, replacement):
        return replacement
    _copy_packed_tensors(current, replacement)
    return current