Skip to content

vllm.model_executor.models.iquest_loopcoder

Inference-only LoopCoder model compatible with HuggingFace weights.

Classes:

LoopGateProjection

Bases: Module

Gate projection for mixed attention in Loop 2+.

Computes: g = sigmoid(linear(Q)) for each head independently. This gate determines how much to use Loop1's KV (global) vs current loop's KV (local).

Supports tensor parallelism: each GPU handles a subset of heads. The weight matrix has shape [num_heads, head_dim] and is split along the head dimension.

Methods:

  • forward –

    Compute gate values from query tensor.

forward(query)

Compute gate values from query tensor.

Parameters:

  • query

    (Tensor) –

    [num_heads, num_tokens, head_dim] (vLLM flattened format) where num_heads is the number of heads on this TP rank and num_tokens = batch * seq_len

Returns:

  • gate ( Tensor ) –

    [num_tokens, num_heads * head_dim] (flattened format matching q shape)