feat(sortformer): optional 6-bit head palettization + variant build driver#73
Open
Alex-Wengg wants to merge 2 commits into
Open
feat(sortformer): optional 6-bit head palettization + variant build driver#73Alex-Wengg wants to merge 2 commits into
Alex-Wengg wants to merge 2 commits into
Conversation
…river - convert_to_coreml.py: add --palettize_head_nbits N. Palettizes the head (conformer+ transformer, ~98% of model size) to N-bit kmeans LUT before make_pipeline. 6-bit cuts the model ~2.5x (matches Argmax speakerkit), no measurable speed change, preserves speaker-argmax decisions. LUT palettization is GPU-safe — int8 linear quantization crashes MPSGraph. Helps the FluidAudio #726 RAM crash on older devices. - build_all_variants.py: driver that rebuilds all 7 Sortformer variants (Default/NvidiaLow/ NvidiaHigh x v2/v2.1 + Efficient cl=25), verifies no BNNS input==output alias + ANE load. Env PALETTIZE_NBITS / OUT_DIR select fp16 vs palettized output sets.
… faster) Reproducible interleaved A/B: FluidAudio fused offline Sortformer vs Argmax's 3-model chain, same 30.72s window, ComputeUnit.ALL. Backs the numbers in FluidAudio Documentation/Diarization/Sortformer.md#benchmarks (issue #726).
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.
Summary
Adds optional 6-bit weight palettization to the Sortformer head conversion, plus a driver to rebuild all variants. Motivated by FluidInference/FluidAudio#726 (BNNS crash + RAM crash on older devices).
Changes
convert_to_coreml.py: new--palettize_head_nbits N. Palettizes the head (conformer + transformer, ~98% of model size) to an N-bit kmeans LUT (constexpr_lut_to_dense) beforemake_pipeline.speakerkit-prorecipe.linear_quantize_weights(int8) crashes MPSGraph (MLIR pass manager failed), palettization does not.build_all_variants.py: rebuilds all 7 variants (Default / NvidiaLow / NvidiaHigh × v2/v2.1, plus Efficient cl=25), compiles to.mlmodelc, and verifies each has no BNNSinput==outputalias and loads onComputeUnit.ALL.PALETTIZE_NBITS/OUT_DIRenv vars select fp16 vs palettized output sets.Validation
FluidInference/diar-streaming-sortformer-coreml/v3/{fp16,palettized}/.