Skip to content

Add SenseNova-U1.5-8B-MoT (NEO-unify) unified any-to-any support - #533

Closed
justinchuby wants to merge 4 commits into
mainfrom
copilot/sensenova-u15-support
Closed

justinchuby wants to merge 4 commits into
mainfrom
copilot/sensenova-u15-support

Conversation

@justinchuby

@justinchuby justinchuby commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

Adds Mobius support for sensenova/SenseNova-U1.5-8B-MoT (model_type: neo_chat, architecture NEOChatModel) — a native unified any-to-any model doing multimodal understanding, text-to-image generation and image editing from one backbone.

Pinned revision 1f6ec60423d29939dde4202fd82ae340b144e280, Apache-2.0. 17,532,854,464 parameters (≈50.2 GB) despite the 8B in the name.

Upstream source: a Hub packaging gap, resolved

The HF repo declares remote code it does not ship — configuration_neo_chat.py and modeling_neo_chat.py both 404 at the pinned revision and at main, so trust_remote_code=True cannot work against the Hub repo alone. The model card resolves it: the reference implementation is the sensenova_u1 package at OpenSenseNova/SenseNova-U1 (branch feat/u1.5), under src/sensenova_u1/models/neo_unify/. That package is the authority used here — nothing was inferred from names.

Two further packaging quirks, both verified benign:

  • Shards model-000{02,03,04}-of-00016.safetensors are absent, but model.safetensors.index.json references no tensor in them. All 1116 tensors resolve; the checkpoint is complete. Numbering slack, not missing weights.
  • No preprocessor_config.json and no tokenizer.json — image preprocessing exists only in code, and the tokenizer must be built from vocab.json + merges.txt. This has a direct consequence for metadata (below).

Architecture, root-caused

Mixture of Transformers. All 42 Qwen3 layers carry two complete, disjoint weight sets. The understanding branch handles text and reference images; every module suffixed _mot_gen handles the noisy image tokens of the flow-matching sampler. There is no lm_head_mot_gen — the generation branch feeds the image head instead.

Routing is per forward call, not per token, and upstream Qwen3Attention.forward / Qwen3DecoderLayer.forward raise NotImplementedError for a mixed pass (upstream issue #207). Production always splits at token-type boundaries: an understanding pass writes a KV cache, then the generation pass reads that frozen cache once per denoise step. Exporting two decoder graphs is therefore the only faithful decomposition, not a convenience.

Three rotary axes inside head_dim 128 — temporal [0:64) at rope_theta 5e6, height [64:96) and width [96:128) at rope_theta_hw 1e4. QK-norm applies per half (q_norm over the 64 temporal dims, q_norm_hw over the 64 spatial dims), which is why the checkpoint's norm tensors are shape [64], not [128].

Block-causal attention: allow[i][j] = (t[j] == t[i]) or (j <= i). All patches of one image share a temporal index, so they attend bidirectionally. For pure text every index is distinct and this degenerates to plain causal — which is exactly why text-only parity passes even with a naive causal mask and image parity does not.

Vision tower has no transformer blocks at all — Conv2d(3,1024,k16,s16) → GELU → interleaved 2-D RoPE → Conv2d(1024,4096,k2,s2). One LLM token covers a 32×32 pixel tile.

No VAE. use_pixel_head drives a pixel-shuffle ConvDecoder (ONNX DepthToSpace mode="CRD") straight to RGB. It predicts x0, and the sampler converts via v = (x0 - z) / max(1 - t, t_eps).

Full write-up, including the upstream code paths that are dead for inference, in docs/design/sensenova-u1-neo-unify.md.

What's added

SenseNovaU1Config (lifts text fields from the nested llm_config), a bare vision extractor hook, SenseNovaU1Model, SenseNovaU1Task, and registry wiring for neo_chat. Five components:

Component Contents
embedding embed_tokens + reference-image scatter
vision_encoder understanding-branch patchify tower
decoder 42 MoT layers + norm + lm_head
image_gen_embedding vision_model_mot_gen + timestep / noise-scale embedders
image_gen_denoiser 42 _mot_gen layers + norm_mot_gen + pixel head

decoder and image_gen_denoiser share the KV-cache layout, which is what lets the denoiser consume the prefill cache.

Validation

Weight alignment — all 1116/1116 checkpoint tensors map onto ONNX initializers: 0 unmapped, 0 missing, 0 shape mismatches. The only initializers without a checkpoint source are derived RoPE/timestep tables.

L1/L2 — 24 co-located tests: graph build for f32/f16/bf16, I/O contracts, config extraction, weight routing, and executable CPU checks including batch=2 with ragged padding and a test that image tokens sharing a temporal index really do attend bidirectionally.

L3 synthetic parity vs upstream PyTorch, component by component (fp32, tiny config):

Component max_abs notes
Vision tower 7.5e-08 grids 4×4, 6×2, 2×8
Understanding decoder 7.2e-07 text-only and text+image t/h/w
Timestep embedder 6.0e-08 t = 0.0 / 0.37 / 1.0
fm_head ConvDecoder 6.6e-07 square and non-square
Generation denoiser + head 2.8e-07 with a real KV prefix

L4/L5 real 17.5 B weights on an H200 — exported with mobius.build(..., load_weights=True) (35.16 GB fp16 + 31 GB fp32 generation branch) and run through onnxruntime CUDA.

Modality Result Performance
Text coherent multi-sentence output TTFT 0.225 s, 53.1 tok/s
Text→image 512×512 photoreal image prefill 0.34 s, 7.7 steps/s (3 passes/step incl. CFG)
Image edit sky replaced, structure preserved vision 0.19 s, 7.1 steps/s

Upstream PyTorch reference for comparison: 35.07 GB bf16, 35.41 GB CUDA peak, 2.52 steps/s.

Stage-by-stage vs upstream, shared initial latent (so every delta is attributable to the export, not sampling randomness):

Stage rel L2 Pearson r
Prefill KV, layer 0 0.0036 0.999994
Prefill KV, layer 41 0.0207 0.999786
image_embeds, step 0 0.0037 0.999995
x0 prediction, step 0 0.0165 0.999834
x0 prediction, step 7 0.0306 0.998934
Final image 0.0338 0.998606

Final-image PSNR 36.42 dB — consistent with fp16-vs-bf16 drift, not architectural error. The two images are visually indistinguishable (below).

Precision finding

The two branches must be exported at different precisions, matching how the checkpoint itself stores them:

  • The understanding branch is BF16 upstream and exports cleanly to float16.
  • The generation branch is stored F32 and its activations exceed fp16 range. At float16 the flow-matching loop overflows and produces NaN part-way through sampling (reproducibly at step 15 of 20 at 512×512). It needs float32.

Mixing works end to end — the sampler casts the fp16 KV cache once after prefill.

Known gaps (deliberate, documented, test-pinned)

Canonical inference metadata is not emissible yet. Export and execution are complete; the blockers are elsewhere and are separated precisely by TestInferenceMetadataStatus so the docs cannot drift:

  1. Image-processor contract — the emitter dispatches on the vision graph's input signature. The NEO tower takes a plain (1, 3, H, W) image and the Hub ships no preprocessor_config.json, so no processor program binds and no image_mean/image_std are declared.
  2. No contract shape — current emitters cover diffusion, audio codec, VLM and speech-to-text. A text decoder plus a flow-matching branch sharing one KV cache matches none; emitting plain VLM metadata would describe only half the model.
  3. Runtime — ORT GenAI has no pipeline that alternates two weight branches over one KV cache with a sampler loop between them.

GQA fusion does not fire for either decoder graph on CUDA/fp16 (Mobius warns at export). Three independent guards each decline correctly: the block-causal bias contains an Or; the denoiser has no attention_mask input; the three-axis RoPE is not op.RotaryEmbedding. Correctness is unaffected; documented so it isn't misdiagnosed later.

Waivers

The fast suite reports 23 pre-existing failures, all TypeError: save() got an unexpected keyword argument 'max_shard_size_bytes'. These come from the installed onnx_ir 0.2.1 lacking that kwarg while origin/main's _model_package.py already passes it. That file is untouched by this branch (git diff --name-only origin/main...HEAD confirms). Excluding them: 4218 passed, ruff check and format clean.

Test commands

python -m pytest src/mobius/models/sensenova_u1_test.py -q          # 24 passed
python -m pytest tests/build_graph_test.py tests/cli_test.py src/ -q \
  -k "not phi4mm and not apply_weights_unknown" -n auto             # 4218 passed

Real outputs

Controlled comparison — identical initial latent, 8 steps, 512×512

Upstream PyTorch (bf16) vs Mobius ONNX (fp16 understanding + fp32 generation). Pearson r = 0.998606, PSNR 36.42 dB.

Upstream reference Mobius ONNX

Text-to-image, 20 steps, cfg 4.0

"A cinematic mountain lake at sunrise, realistic photography."

Independently sampled (numpy vs torch RNG), so these are different draws of the same prompt — both photoreal, confirming the exported model is not merely close to the reference but genuinely generative.

Upstream PyTorch — 2.52 steps/s Mobius ONNX — 7.75 steps/s

Image editing through ONNX

Input: the upstream image above. Prompt: "Change the sky to a dramatic starry night. Keep the mountains, lake and rocks unchanged."

The reference image is encoded by the vision_encoder tower (32×32 patches → 256 tokens), scattered into the prompt by the embedding graph, and conditions the _mot_gen branch. Mountains, shoreline, reflection and foreground rocks are preserved while the sky is replaced — end-to-end proof that the understanding image path, get_thw_indexes position derivation and edit conditioning are all correct.

Text decoding through ONNX

TTFT 0.225 s, 53.06 tok/s, fp16 on H200:

<think>
The user is asking me to describe the colours of a sunrise over a mountain lake.
This is a descriptive, creative writing task. I should write a vivid, sensory-rich
description that captures the beauty and atmosphere of this scene.

Let me plan this:

1. **Writing Type**: Creative descriptive prose / nature writing

justinchuby and others added 4 commits August 21, 2026 15:06
Adds full Mobius support for sensenova/SenseNova-U1.5-8B-MoT, a native
unified multimodal model (understanding + image generation + editing).

Architecture (root-caused from the upstream reference implementation at
github.com/OpenSenseNova/SenseNova-U1 @ feat/u1.5 — the HF repo declares
auto_map entries for configuration_neo_chat.py / modeling_neo_chat.py but
does not ship those files, so the GitHub package is the only source):

* Mixture of Transformers (MoT): all 42 Qwen3 decoder layers carry two
  complete, disjoint weight sets. The understanding branch handles text
  and reference images; every module suffixed `_mot_gen` handles the
  noisy image tokens of the flow-matching sampler. Attention is shared —
  the generation pass reads the KV cache written by the understanding
  pass, which is how text conditioning reaches image tokens. Upstream
  raises NotImplementedError for a mixed forward, so exporting the two
  branches as two graphs is the only faithful decomposition.
* Three rotary axes inside head_dim 128: temporal [0:64) at rope_theta,
  image height [64:96) and width [96:128) at rope_theta_hw. QK-norm is
  applied per half (q_norm over 64 temporal dims, q_norm_hw over 64
  spatial dims), matching the checkpoint's [64]-shaped norm tensors.
* Block-causal attention: allow[i][j] = (t[j] == t[i]) or (j <= i), so
  patches of one image attend bidirectionally.
* Vision tower has no transformer blocks — Conv2d patchify, GELU,
  interleaved 2-D RoPE, Conv2d 2x2 merge into the LLM width.
* No VAE: use_pixel_head drives a pixel-shuffle ConvDecoder that decodes
  generation hidden states straight to RGB.

Ships SenseNovaU1Config (lifts text fields from the nested llm_config),
a bare vision extractor hook, SenseNovaU1Model, SenseNovaU1Task building
five graphs (model / vision / embedding / image_gen_embedding /
image_gen_denoiser), and registry wiring for model_type `neo_chat`.

All 1116 checkpoint tensors map onto ONNX initializers with zero
unmapped keys and zero shape mismatches; the only initializers without a
checkpoint source are derived RoPE and timestep-frequency tables.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
Two defects surfaced only when running the real 17.5B checkpoint through
onnxruntime on CUDA; both are fixed here:

* `_TimestepEmbedder` built its sinusoidal basis in float32 but read the
  frequency table after `_cast_module_dtype` had demoted it to the model
  dtype, producing a `Mul` with mismatched operand types that made the
  `image_gen_embedding` graph unloadable in fp16. The table is now cast up
  explicitly, keeping the basis in float32 as upstream does.
* The denoiser graph dropped its `present_key`/`present_value` outputs.
  ORT's CUDA Attention kernel requires them whenever `past_key`/`past_value`
  are supplied, so every denoise step failed at layer 0. They are now
  registered; the sampler still discards them, which preserves upstream's
  `update_cache=False` semantics (the understanding prefix stays frozen
  across flow-matching steps).

`_ConvDecoder` also derives its upsample factor from `pixels_per_token`
instead of hardcoding 32x. That is exactly `patch_size * merge_size` for
the released checkpoint (so `conv2` keeps its 192 = 3*8*8 channels), but
it no longer silently produces wrongly-sized images for other geometries.

Adds docs/design/sensenova-u1-neo-unify.md recording what was verified
against the checkpoint and the reference implementation: the Hub
packaging gap (declared-but-absent remote code, shard-numbering slack),
the parameter budget, MoT routing, the three rotary axes, block-causal
masking, the transformer-free vision tower, the VAE-free pixel head, and
the upstream code paths that are dead for inference.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
Renames the package components from `model`/`vision` to `decoder`/
`vision_encoder`, matching VisionLanguageTask, VisionLanguage3ModelTask
and HunYuanVLMoTTask. Beyond consistency this makes the package
recognisable to `is_native_vlm_package`, so the metadata emitter now
reports a specific, actionable failure instead of the generic
"unrecognised multi-component package shape".

Records `neo_chat` in `_SPECIALIZED_TEST_MODEL_TYPES`: the co-located
test module covers it, and the generic VLM harness cannot -- the package
carries an image-generation branch the harness has no notion of.

Adds TestInferenceMetadataStatus, which pins the exact current blocker so
the documented status cannot drift from reality:

* Export and execution are complete for all five graphs.
* Metadata emission blocks in the image-processor contract: the NEO
  vision tower takes a plain (1, 3, H, W) image and the Hub repo ships no
  preprocessor_config.json, so no processor program binds and no
  image_mean/image_std are declared.
* No emitter shape describes a unified any-to-any package (a text decoder
  plus a flow-matching branch sharing one KV cache), and ORT GenAI has no
  runtime pipeline for one, so a contract alone would not be executable.

The design doc gains the runtime/metadata status section and the
precision finding that the `_mot_gen` branch -- stored F32 upstream --
overflows fp16 during sampling and must be exported at float32, while the
BF16 understanding branch exports cleanly to float16.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
* `preprocess_weights` now honours `tie_word_embeddings`. Only an
  explicit `language_model.lm_head.weight` populated `decoder.lm_head`
  before, so a tied `neo_chat` variant would leave that initializer
  unfilled. The released 8B checkpoint is untied, so this was latent, but
  the registry declares a family/variant pair that anticipates siblings.
  Mirrors the existing HunYuan VL-MoT handling. Covered by two new tests.

* Drops the `update_cache` parameter from `_MoTAttention`,
  `_MoTDecoderLayer` and `_SenseNovaU1DecoderBody`. It was declared,
  threaded through three modules, and never read: ONNX `Attention` always
  emits `present = concat(past, new)`. The understanding prefix stays
  frozen because the *caller* discards the denoiser's present outputs,
  which is documented at that contract boundary in the task. Keeping a
  flag that implied graph-level behaviour it did not have was a trap.

* Removes the unused expanded `mask` in the embedding model. `op.*` calls
  emit IR nodes, so `del mask` dropped only the Python name — the
  Unsqueeze/Expand survived until DCE. Also drops the vestigial
  `num_heads` argument from `_rotate_half_axis`.

* Documents why GQA fusion cannot fire for either decoder graph (the
  block-causal bias contains an `Or`, the denoiser has no attention_mask
  input, and the three-axis RoPE is not `op.RotaryEmbedding`), so the
  CUDA/fp16 export warning is not misdiagnosed later.

Verified graph-identical to the exported artifacts: all five components
match the on-disk node counts exactly, and the end-to-end image is
bit-identical to the pre-refactor run.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 21, 2026 16:42
@github-actions

Copy link
Copy Markdown

Performance Comparison

Comparing 4097572 → a65a78d

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0% ⚪
bert (feature-extraction) num_nodes 60 60 +0.0% ⚪
falcon model_size_bytes 364 KB 364 KB +0.0% ⚪
falcon num_nodes 66 66 +0.0% ⚪
gemma2 model_size_bytes 428 KB 428 KB +0.0% ⚪
gemma2 num_nodes 105 105 +0.0% ⚪
gpt2 model_size_bytes 388 KB 388 KB +0.0% ⚪
gpt2 num_nodes 54 54 +0.0% ⚪
llama model_size_bytes 425 KB 425 KB +0.0% ⚪
llama num_nodes 60 60 +0.0% ⚪
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
llama (static-cache) num_nodes 56 56 +0.0% ⚪
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0% ⚪
mamba (ssm-text-generation) num_nodes 94 94 +0.0% ⚪
phi3 model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 num_nodes 58 58 +0.0% ⚪
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 (static-cache) num_nodes 54 54 +0.0% ⚪
qwen2 model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 num_nodes 60 60 +0.0% ⚪
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 (static-cache) num_nodes 56 56 +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) num_nodes 264 264 +0.0% ⚪
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0% ⚪
qwen3_5_text (hybrid-text-generation) num_nodes 126 126 +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) num_nodes 428 428 +0.0% ⚪
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0% ⚪
t5 (seq2seq) num_nodes 166 166 +0.0% ⚪
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0% ⚪
whisper (speech-to-text) num_nodes 128 128 +0.0% ⚪

No performance regressions.

@github-actions

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 4097572 → a65a78d

Model Sub-model Changes Status
bert (feature-extraction) model 0 ⚪
falcon model 0 ⚪
gemma2 model 0 ⚪
gemma4 (gemma4) decoder 0 ⚪
gemma4 (gemma4) embedding 0 ⚪
gemma4 (gemma4) vision_encoder 0 ⚪
gemma4_text model 0 ⚪
gpt2 model 0 ⚪
llama model 0 ⚪
llama (static-cache) model 0 ⚪
mamba (ssm-text-generation) model 0 ⚪
phi3 model 0 ⚪
phi3 (static-cache) model 0 ⚪
qwen model 0 ⚪
qwen (static-cache) model 0 ⚪
qwen2 model 0 ⚪
qwen2 (static-cache) model 0 ⚪
qwen2_moe model 0 ⚪
qwen2_moe (static-cache) model 0 ⚪
qwen3 model 0 ⚪
qwen3 (static-cache) model 0 ⚪
qwen3_5_moe (hybrid-text-generation) model 0 ⚪
qwen3_5_text (hybrid-text-generation) model 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) decoder 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) embedding 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) vision_encoder 0 ⚪
qwen3_moe model 0 ⚪
qwen3_moe (static-cache) model 0 ⚪
qwen3_next (hybrid-text-generation) model 0 ⚪
t5 (seq2seq) decoder 0 ⚪
t5 (seq2seq) encoder 0 ⚪
whisper (speech-to-text) decoder 0 ⚪
whisper (speech-to-text) encoder 0 ⚪

No architecture changes detected. ✅


Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Mobius support for the SenseNova-U1.5 NEO-unify unified any-to-any model (model_type: neo_chat) by introducing a new 5-component task/model split (understanding + generation branches) plus config extraction, registry wiring, tests, and architecture documentation.

Changes:

  • Introduces SenseNovaU1Model and SenseNovaU1Task to export five ONNX components (decoder, vision_encoder, embedding, image_gen_embedding, image_gen_denoiser).
  • Adds SenseNovaU1Config with composite config extraction (lift text fields from llm_config) and a per-model vision hook for neo_chat.
  • Wires the new model into the registry and adds co-located unit/execution/contract tests and a design write-up.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/build_graph_test.py Marks neo_chat as a specialized model type (outside generic VLM harness).
src/mobius/tasks/_sensenova_u1.py New 5-component task building the understanding + generation graphs.
src/mobius/tasks/init.py Exposes SenseNovaU1Task and registers task name sensenova-u1.
src/mobius/models/sensenova_u1.py New NEO-unify model implementation (MoT branches, 3-axis RoPE, block-causal mask, pixel head) + weight routing.
src/mobius/models/sensenova_u1_test.py Co-located tests for graph contracts, config extraction, weight routing, and CPU execution.
src/mobius/models/init.py Exports SenseNovaU1Model.
src/mobius/_registry.py Registers neo_chat → SenseNovaU1Model + default model ID mapping.
src/mobius/_configs/per_model/_sensenova_u1_vision.py Adds a neo_chat vision-config extractor hook handling upstream quirks.
src/mobius/_configs/per_model/init.py Imports the new per-model vision hook module.
src/mobius/_configs/_base.py Adds SenseNovaU1Config and composite extraction logic.
src/mobius/_configs/init.py Exports SenseNovaU1Config.
docs/design/sensenova-u1-neo-unify.md Adds architecture/source-of-truth documentation for the model.
docs/design/index.md Adds the new design doc to the index.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +193 to +197
latent = builder.input(
"latent",
dtype=config.dtype,
shape=[1, 3, height, width],
)
Comment on lines +152 to +172
batch = ir.SymbolicDim("batch")
seq_len = ir.SymbolicDim("sequence_len")
num_features = ir.SymbolicDim("num_image_tokens")

graph, builder = _make_graph(name="embedding")
op = builder.op
input_ids = builder.input(
"input_ids",
dtype=ir.DataType.INT64,
shape=[batch, seq_len],
)
image_features = builder.input(
"image_features",
dtype=config.dtype,
shape=[1, num_features, config.hidden_size],
)
image_mask = builder.input(
"image_mask",
dtype=ir.DataType.BOOL,
shape=[batch, seq_len],
)
@justinchuby

Copy link
Copy Markdown
Member Author

Canonical hashless metadata and executable generic shared-state workflow validation are now implemented in #540, with the runtime contract in justinchuby/onnx-genai#1700. #540 carries this branch's model implementation rebased onto current main and preserves the existing L4/L5 evidence; ordinary CI uses only deterministic tiny graphs.

justinchuby added a commit that referenced this pull request Aug 22, 2026
## Summary
This rebases the existing SenseNova U1.5 implementation from #533 onto
current `main` and removes its canonical-metadata waiver.

- structurally detect a generic five-component shared-state pixel-flow
package
- emit hashless canonical metadata for embedding, vision encoder,
understanding decoder, generation embedding, and generation denoiser
- synthesize the exact missing processor asset: DecodeImage/RGB,
pixel-area resize aligned to 32 (512²–2048²), Lanczos, `1/255`, ImageNet
normalization
- express conditional/unconditional frozen KV groups, fp16→fp32
boundaries, per-step embedding, CFG, x0 prediction,
`v=(x0-z)/max(1-t,t_eps)`, Euler update, and pixel output using generic
workflow IR
- add a deterministic no-network five-component conformance package and
committed reviewable fixture
- replace `TestInferenceMetadataStatus` negative coverage with positive
hashless metadata and processor assertions

No model implementation, weight mapping, or existing L4/L5 evidence is
changed. No model-family fields, hashes/fingerprints, IR version, or
ONNX opsets are added to canonical metadata.

## Validation split
### Ordinary PR CI
- tiny graph construction and producer tests
- schema/admission validation
- executable synthetic text-only path
- executable two-step text-to-image CFG/flow loop
- executable reference-image edit path
- shared frozen KV and mixed fp16-understanding/fp32-generation
boundaries

### Pinned real H200 validation
The existing #533 evidence remains authoritative and is documented
rather than downloaded in CI:
- model revision `1f6ec60423d29939dde4202fd82ae340b144e280`
- 17.5B parameters / ~50 GB checkpoint
- L4 stage parity for prefix KV, image embedding, step-0/step-7 x0, and
final image
- L5 coherent text, 512x512 text-to-image, and reference-image edit
outputs

## Local validation
- `PYTHONPATH=src python -m pytest
src/mobius/models/sensenova_u1_test.py -q` — 25 passed
- generate + compare all ONNX GenAI workflow fixtures — pass
- ONNX GenAI schema/admission of `shared_state_pixel_flow` — pass
- ONNX GenAI executable conformance matrix — text, generation, edit all
pass

Depends on justinchuby/onnx-genai#1700 for generic `read_only` state
aliases and dynamic image-adapter dimensions.

---------

Signed-off-by: justinchuby <[email protected]>
Signed-off-by: justinchuby <[email protected]>
Co-authored-by: Copilot <[email protected]>
@justinchuby

Copy link
Copy Markdown
Member Author

Superseded by #540, which rebased and merged the complete SenseNova U1.5 implementation and its existing L4/L5 evidence onto current main, then added the five-component hashless canonical producer metadata and tiny conformance package. I verified #540 contains every implementation/documentation path from this PR and adds the producer/runtime integration paths.

Post-merge corrections discovered by executing the real pinned 17.5B package through ONNX GenAI's canonical engine are in #545 (seeded noise, independent CFG prefix/KV symbols, forward x0 flow schedule, and bounded image output). Generic runtime support and synthetic execution are tracked in justinchuby/onnx-genai#1700.

Published validated package: https://huggingface.co/justinchuby/sensenova-u1.5-8b-mot-onnx-canonical

Closing this PR to avoid maintaining two divergent implementations; its evidence remains preserved here and in the merged design documentation.

justinchuby added a commit that referenced this pull request Aug 22, 2026
## Summary

Follow-up to merged #540 that incorporates findings from real
canonical-engine execution of the pinned SenseNova U1.5 package.

- derive deterministic image noise from generic `seed`/`width`/`height`
request roles; caller latent remains an optional override
- keep positive and negative CFG prefixes and their frozen KV sequence
symbols independent
- integrate the x0 flow from `t=0` to `t=1` using
`v=(x0-z)/max(1-t,t_eps)`
- clamp generic pixel output to the declared `[-1, 1]` range
- add reusable image-noise geometry and tensor-clamp policy components
- regenerate the hashless canonical fixture and document production H200
evidence

No SenseNova/NEO dispatch or family-specific metadata fields are added.

## Validation

- `python3 -m pytest src/mobius/models/sensenova_u1_test.py
src/mobius/generation/_policy_components_test.py -q --tb=short` — **78
passed**
- generated fixture exactly matches
`tests/fixtures/onnx_genai_workflows/shared_state_pixel_flow/inference_metadata.yaml`
- targeted Ruff format/check and `git diff --check` pass

## Real canonical runtime evidence

Executed by ONNX GenAI `Engine::from_pipeline_dir` on H200 using the
pinned 17.5B export (`1f6ec60423d29939dde4202fd82ae340b144e280`), not
custom orchestration:

- text understanding prefill: logits `[1, 28, 151936]`
- 512×512 text-to-image, 20 steps: **6.99 s**
- 512×512 reference-image edit, 20 steps: **16.68 s**
- peak observed VRAM: **91,256 MiB**
- final outputs finite and bounded exactly to `[-1, 1]`

Published package:
https://huggingface.co/justinchuby/sensenova-u1.5-8b-mot-onnx-canonical
Upload commit: `f3f2eaf79f4991febee107cdabd0b27f0161b06e`

A clean 24 MB selective download of metadata, policies, graph
descriptors, tokenizer, and processor assets passes canonical admission.

## Remaining runtime limitations

- text path currently validates understanding prefill, not full
autoregressive decode
- generic Images/A1111 bindings cannot yet select a path-specific image
chat template or construct reference-image placeholder masks for this
unified package
- portable counter RNG is deterministic but intentionally does not
reproduce PyTorch RNG, so final pixels are not directly comparable to
#533's controlled-latent reference

Runtime support and synthetic executable coverage are in
justinchuby/onnx-genai#1700.

---------

Signed-off-by: justinchuby <[email protected]>
Signed-off-by: justinchuby <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants