Skip to content

Add JANGT expert pipeline and mflux image quantization scripts - #28

Open
jjang-ai wants to merge 1 commit into
mainfrom
jangt-and-image-quant-scripts
Open

jjang-ai wants to merge 1 commit into
mainfrom
jangt-and-image-quant-scripts

Conversation

@jjang-ai

@jjang-ai jjang-ai commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • jang_tools.jangt: the JANGT pipeline (trellis-coded MoE experts). It covers the encoder (moe_encode), the reference decode kernels and MoE module (moe_kernels, switch), error curves, routing-flip sensitivity (n05_sens), byte-budget allocation, streamed KL/NLL evaluation from stage files (n05_streval), and mixed JANGT/JANGH bundle assembly (n05_pick_downs, n05_assemble). Imports resolve to jang_tools.jangh, and every input path is a required argument.
  • jang_tools.mflux_image: mflux bundle builders for Qwen-Image-2.1 / -Turbo and Ideogram 4. Also a reference generate/edit script that samples Turbo on the sample_sigmas grid from model_index.json, and the mflux scheduler patch that Turbo generation needs (stock mflux main has no Turbo grid support).
  • Fix: in minitest.JANGTLinear, inputs of 8 rows or fewer went to the 16-bit-state v2core.gemv even at L=12, which gave a 1.38 output relative error. The materialized path gives 0.30.
  • Package README entries plus package-data for the two new READMEs and the patch.

Validation

  • Every module imports, and every lazy from … import name resolves (AST walk; MLX 0.32.3 with scipy/mlx-lm). The public jangh.n05 / jangh function signatures match the modules this code was developed against.
  • JANGT encode smoke on a random 256×512 matrix: rel-H error 0.099, output rel error 0.30 (≈ √0.099), on both the decode and the prefill path.
  • All 9 JANGT CLIs parse --help.
  • quantize_qwen_image21 --bits 4 on Qwen-Image-2.1-Turbo produces a bundle byte-identical (sha256, all 18 files) to the published 4-bit bundle. generate_qwen_image21 with that bundle renders the requested sign text correctly in 8 steps.
  • quantize_ideogram4: imports and CLI checked only; the source was not available to rerun.
  • Public document boundary check: PASS.

jang_tools.jangt: trellis-coded MoE expert encoder, decode kernels, error
curves, routing-flip sensitivity, byte-budget allocation, streamed KL
evaluation and mixed JANGT/JANGH bundle assembly (Naive-N0.5-Flash).
Imports point at jang_tools.jangh; every path is an argument. Fixes the
dense JANGTLinear decode path, which sent <=8-row inputs to the 16-bit-state
GEMV at L=12.

jang_tools.mflux_image: Qwen-Image-2.1 / -Turbo and Ideogram 4 mflux bundle
builders, a reference generate/edit script that samples Turbo on its
model_index.json sigma grid, and the mflux scheduler patch Turbo generation
needs.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant