vllm.model_executor.models.iquest_loopcoder
¶
Inference-only LoopCoder model compatible with HuggingFace weights.
Classes:
-
LoopGateProjection–Gate projection for mixed attention in Loop 2+.
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.
Source code in vllm/model_executor/models/iquest_loopcoder.py
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | |
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)