Skip to content

feat: add SenseNova-Loop 9B (sensenova_loop) model support #4865

Closed

Description

@Qubitium

Summary

OpenSenseNova/SenseNova-Loop ships
sensenova/SenseNova-Loop-9B with model_type: "sensenova_loop" and remote code
(modeling_sensenova_loop.py). GPTQModel currently has no definition for it, so
GPTQModel.load(...) / GPTQModel.quantize(...) falls through to check_and_get_model_definition()
and raises Model definition not found.

The checkpoint reuses Qwen3.5's VL layout (model.language_model.layers.*, model.visual.*)
but adds two decoder features that the definition must describe correctly:

  1. Looped block (loop_settings = {start: 4, end: 28, eval_count: 2, counts: [2]}) — physical
    layers 4..27 execute twice. The same physical layer weights are shared by both visits, so a
    single quantized copy per physical layer is correct (and the calibration Hessian accumulates
    over both visits).
  2. mHC residual-stream routers (mhc = {start: 4, end: 28, streams: 2, iterations: 20, fixed_identity: false, pre_scale: 1.0}) — every layer in 4..27 gains mhc_attn / mhc_ffn
    submodules. They are not nn.Linear: each holds a raw FP32 weight ([2*streams + streams**2, streams*hidden]) plus bias, and the remote code forces them to stay FP32 via
    _keep_in_fp32_modules. They must be excluded from quantization and preserved verbatim.

Auxiliary mtp.* tensors (mtp.safetensors) are already ignored by the remote model
(_keys_to_ignore_on_load_unexpected) and must stay out of the saved checkpoint too.

Expected

  • sensenova_loop resolves to a definition that quantizes only the attention/MLP/linear_attn
    projections inside model.language_model.layers.
  • mhc_attn / mhc_ffn routers and mtp.* tensors are never quantized.
  • Loading requires trust_remote_code=True (the model has no in-tree transformers implementation).

Activity

  1. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Taking this.

    Agent claim: agent-root-4865-sensenova is working on this issue now.

    Started 2026-11-17T17:38:43Z. The claim expires 4.0h after this comment was last edited (heartbeat). Other agents: do not start this issue while the claim is live.

    claiming: add a sensenova_loop definition for SenseNova-Loop 9B that quantizes only the decoder projections and preserves the mHC FP32 routers and mtp.* tensors

  2. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Landed in #4897 (squash 93b8ef475).

    What shipped: gptqmodel/models/definitions/sensenova_loop.py (SenseNovaLoopQModel), MODEL_MAP["sensenova_loop"], 11 contracts in tests/test_sensenova_loop_support.py, registry/fusion fixtures, and docs rows.

    Notes for anyone picking this up:

    • sensenova/SenseNova-Loop-9B is gated, so no release weights were downloaded. The definition and tests are pinned to the public SenseNova-Loop-9B-Preview checkpoint (per-layer tensor suffix sets taken from its model.safetensors.index.json) and to the remote modeling_sensenova_loop.py.
    • mhc_attn / mhc_ffn are raw FP32 parameters, not nn.Linear. They stay out of the module tree and should_quantize_module() refuses any mhc_* path, so a checkpoint that shipped them as nn.Linear would still keep them dense.
    • Fusion (fusion=True) is explicitly withheld for this model type: the mHC decoder layer runs the remote forward, so qkv/gate-up admission needs its own native-forward qualification.
    • End-to-end was verified on a tiny random-weight checkpoint built from the Preview remote code: quantize (4-bit, gs=32) -> save -> reload -> forward, with the routers preserved as F32.
    • Still open: image/video calibration for the vision tower (the definition uses Qwen3.5's text-only calibration path; the tower stays dense, as for qwen3_5).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions