Skip to content

MOSS-Image fused family, fused single projections, optional GPTQ rounding (0.14.0) - #20

Merged
iamwavecut merged 1 commit into
mainfrom
feat/moss-image-family
Oct 16, 2026
Merged

iamwavecut merged 1 commit into
mainfrom
feat/moss-image-family

Conversation

@iamwavecut

Copy link
Copy Markdown
Owner

Changes

  • MOSS-Image fused family (orbitquant.fused.families.moss_image) for OpenMOSS MOSSImageTransformer:
    • both RMSNorms and the shared AdaLN modulation run in the activation prologue;
    • Q|K|V is one GEMM, and Q/K RMSNorm with rotate-half RoPE is one kernel;
    • gate|up is one GEMM with the new SiTU epilogue (EPILOGUE_SITU);
    • the gated residuals run in the output GEMM epilogues.
  • fused.fuse_linears(model) runs the OrbitQuant projections of a component without a block family (for example a text encoder) as single INT8 GEMMs (FusedLinear). Activations are 8-bit absmax by default.
  • orbitquant.gptq is opt-in calibration:
    • it chooses GPTQ codes in the same codebook, bit width, row-norm scale and packed layout, so artifacts load unchanged;
    • groups of one shape round in a batch on the GPU;
    • Hessians and updates run in full FP32 (TF32 noise broke the Cholesky factorization of a Qwen3.5 text encoder).
  • README: a GPTQ section, fuse_linears usage, MOSS-Image in the fused-family table, and a Method Conformance note that GPTQ is outside the paper's method.
  • Version: 0.14.0.

Verification

  • macOS: ruff check, the full pytest suite, run_paper_methodology_checks.sh and run_hf_compat_checks.sh --mode all pass.
  • RTX 5090 (Torch 2.12.1, CUDA 13.0): the full suite gives 746 passed, 37 skipped, 3 failed. All 3 failures come from the test setup:
    • 2 tests run git ls-files, and the copy on the pod was not a git checkout;
    • 1 test needs the native packed-matmul package, which was not provisioned; with ORBITQUANT_KERNELS_AUTOFETCH=1 the file passes (5 passed).
  • MOSS-Image 4-bit transformer with GPTQ rounding, 8 images at 1024×1024 with 50 steps: mean LPIPS against BF16 is 0.209 (0.371 with nearest rounding).

…l GPTQ rounding (0.14.0)

- orbitquant.fused.families.moss_image fuses OpenMOSS MOSSImageTransformer blocks: both
  RMSNorms and the shared AdaLN modulation in the activation prologue, one Q|K|V GEMM, Q/K
  RMSNorm with rotate-half RoPE in one kernel, gate|up in one GEMM with the new SiTU epilogue
  (4 tanh(g/4) sigmoid(g) * 25 tanh(u/25), rounded where the eager bf16 ops round), and gated
  residuals in the output GEMM epilogues.
- fused.fuse_linears(model) runs every loaded OrbitQuantLinear of a component without a block
  family as one INT8 GEMM over its packed rows (FusedLinear), with 8-bit absmax activations by
  default. Text encoders that run once per prompt use it.
- orbitquant.gptq is opt-in calibration: HessianCollector gathers X^T X of each projection's
  rotated inputs, round_groups chooses GPTQ codes (act-order, lazy blocks, damping retries) in
  the same codebook, bit width, row-norm scale and packed layout, batched on the GPU for groups
  of one shape, and load_rounded_codes / update_state_dict write them into a model or an
  artifact state dict. Hessians and updates run in full FP32. On the MOSS-Image 4-bit
  transformer the mean LPIPS of 8 images against BF16 fell from 0.371 to 0.209.
- README: GPTQ section, fuse_linears usage, MOSS-Image in the fused-family table, and a
  Method Conformance note that GPTQ rounding is outside the paper's method.
@iamwavecut
iamwavecut merged commit 895789d into main Oct 16, 2026
3 checks passed
@iamwavecut
iamwavecut deleted the feat/moss-image-family branch October 16, 2026 18:35
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.

1 participant