Repository navigation
MOSS-Image fused family, fused single projections, optional GPTQ rounding (0.14.0) - #20
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
orbitquant.fused.families.moss_image) for OpenMOSSMOSSImageTransformer:EPILOGUE_SITU);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.gptqis opt-in calibration:fuse_linearsusage, MOSS-Image in the fused-family table, and a Method Conformance note that GPTQ is outside the paper's method.Verification
ruff check, the fullpytestsuite,run_paper_methodology_checks.shandrun_hf_compat_checks.sh --mode allpass.git ls-files, and the copy on the pod was not a git checkout;ORBITQUANT_KERNELS_AUTOFETCH=1the file passes (5 passed).