Skip to content

[Feat] sensenova_loop: Add multimodal inference and AWQ support - #47281

Open
WANDY666 wants to merge 21 commits into
sgl-project:mainfrom
WANDY666:feat/sensenova-loop
Open

WANDY666 wants to merge 21 commits into
sgl-project:mainfrom
WANDY666:feat/sensenova-loop

Conversation

@WANDY666

@WANDY666 WANDY666 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Add native text, image, and video inference for SenseNova Loop (sensenova_loop), including the official AWQ checkpoint.

Modifications

  • Reuse Qwen3.5 decoders and multimodal processing. Loop visits share weights and keep separate KV/GDN states.
  • Add mHC routing with log-space Sinkhorn.
  • Add row-major INT4 embedding lookup to the AWQ backend, selected by checkpoint metadata. A Triton kernel fuses gather, unpacking, and dequantization on CUDA. The model forwards quant_config and reuses AWQ/Marlin for decoder layers and the LM head. Fix Marlin's LM-head shape check.
  • Add regression and text/image serving tests, and update the model lists and launch instructions.

Accuracy Tests

One H200, BF16, TP=1. 183 tests and 30 subtests passed, including a text/image server test without diagnostic hooks. Pre-commit passed. Four concurrent chat requests also passed smoke checks.

Before fusing the embedding lookup, we compared AWQ final-prefill outputs against the official HF implementation, using independently dequantized checkpoint weights with BF16, SDPA and Torch GDN. SGLang uses AWQ-Marlin, FA3 and FlashInfer GDN.

Input Vision cosine Logits cosine
4 text prompts — 0.999552–0.999959
Image 0.982055 0.999110

First-token IDs match for all five prompts. With the fused lookup, sampled embedding rows from the official checkpoint match the previous Torch implementation bit for bit. Cosines cover complete tensors. The vision implementation is unchanged. Earlier BF16 checks used different fixtures and reached minimum vision/logits cosines of 0.989706/0.984661; task-level accuracy remains unmeasured.

Local serving tests used Torch 2.13.0, Transformers 5.12.1 and sglang-kernel 0.4.6.post1 with SGLANG_SKIP_SGL_KERNEL_VERSION_CHECK=1. CI with the required dependency versions is still pending.

Speed Tests and Profiling

H200, BF16, CUDA Graph replay with the official AWQ embedding weights. Timings are for the embedding operation.

Token IDs Torch Fused Triton
1 17.0 µs 1.2 µs
128 24.5 µs 1.7 µs
8192 533.7 µs 42.4 µs

Checklist

  • Format code with pre-commit.
  • Add unit and serving tests.
  • Update supported-model documentation.
  • Provide task-level accuracy and speed benchmarks.

CI States

Latest PR Test (Base): ⊘ Skipped -- add the run-ci label to run CI tests.
Latest PR Test (Extra): ⊘ Skipped -- add the run-ci label to run CI tests.
Latest PR Test (AMD ROCm 10): ➖ No AMD PR run found for this commit.

Tip

Base CI only covers the core cases, and its workload may not exercise your change. Use /rerun-test to run the tests your change touches, or copy this prompt for an agent:

Find the registered tests this PR affects and run them with /rerun-test, following https://github.com/sgl-project/sglang/blob/main/.agents/skills/rerun-test/SKILL.md

@mintlify

mintlify Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit c339aa2.

Approve preview

@github-actions github-actions Bot added documentation Improvements or additions to documentation Multi-modal multi-modal language model labels Oct 29, 2026
@WANDY666
WANDY666 marked this pull request as ready for review October 30, 2026 01:56

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@WANDY666 WANDY666 changed the title [Feat] sensenova_loop: Add multimodal Loop and mHC inference [Feat] sensenova_loop: Add multimodal inference and AWQ support Nov 19, 2026
@dg1kjd

dg1kjd commented Nov 19, 2026

Copy link
Copy Markdown

Just to spare others hours of work, the terminal-looping behaviour that occurs e.g. on HLE problems has been analyzed and traced by us in a whole day session yesterday. It also occurs with the reference inference code in fp32 and therefore appears not to be a numeric/algorithmic issue so is not caused by the inference code but is intrinsic in the model weight. Full, very detailed report at https://github.com/dg1kjd/sglang-sxm2/blob/main/docs/v100/Known-Issues.md .

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation jit-kernel Multi-modal multi-modal language model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants