Skip to content

Add F16 and I2_S GGUF conversion for bitnet-embeddings 0.6B and 270M models#584

Open
isHuangXin wants to merge 6 commits into
microsoft:mainfrom
isHuangXin:release-bitnet-embedding-0.6b-270m
Open

Add F16 and I2_S GGUF conversion for bitnet-embeddings 0.6B and 270M models#584
isHuangXin wants to merge 6 commits into
microsoft:mainfrom
isHuangXin:release-bitnet-embedding-0.6b-270m

Conversation

@isHuangXin

Copy link
Copy Markdown

Summary

  • Add model adaptation support for bitnet-embeddings-0.6b and bitnet-embeddings-270m, including F16 and I2_S GGUF
    conversion scripts
  • Add I2_S GGUF conversion for bitnet-b1.58-2B-4T and refactor T-MAC LUT path
  • Update llama.cpp submodule to include SafetensorRemote and SafetensorsLocal utility classes
  • Update submodule branch tracking to release-bitnet-embedding-0.6b-270m

Changes

  • utils/: Added GGUF conversion scripts for bitnet-embeddings-0.6b and bitnet-embeddings-270m (F16 and I2_S
    quantization)
  • 3rdparty/llama.cpp: Updated submodule with SafetensorRemote/SafetensorsLocal utilities and workflow fixes
  • .gitmodules: Updated submodule branch reference

Test Plan

  • Successfully converted bitnet-embeddings-0.6b model to F16 and I2_S GGUF format
  • Successfully converted bitnet-embeddings-270m model to F16 and I2_S GGUF format
  • Verified inference with llama-embedding using the converted models

…nversion

- Add GGUF conversion tool for bitnet-embeddings-0.6b (safetensors -> F16/I2_S GGUF)
- Add Qwen3 architecture support in llama.cpp submodule with per-projection RMSNorm
- Add I2_S ternary quantization (2-bit packed -1/0/+1) for lossless precision
- Add f16 norm weight support for correct embedding inference
- Guard bitnet-lut-kernels.h include with TL1/TL2 preprocessor checks
- Update llama.cpp submodule to dev-bitnet-embedding-0.6b branch
- Document F16 (from multilingual-e5-0.6b) and I2_S (from bitnet-embeddings-0.6b) conversion process
…MAC LUT path

- Add quantize_to_i2_s() for direct ternary-to-I2_S packing in conversion script
- Support offline-quantized models (uint8 packed weights + weight_scale)
- Fix weight_quant double-quantization bug for offline-quantized models
- Fix I2_S scale computation to use first nonzero absolute value
- Add I2_S ftype mapping and BitNetForCausalLM registration
- Refactor ggml-bitnet-lut T-MAC wrapper with proper mul_mat implementation
- Update llama.cpp submodule with I2_S ftype and 2B model type support
…nversion

- Add LLM_ARCH_GEMMA3 in llama.cpp for gemma3_text model type
  (embedding scaling, GELU, post-attn/post-FFN norms, GQA)
- Add GGUF conversion support for Gemma3-based 270m models
  (SPM tokenizer, RMSNorm w+1 offset, arch-specific tensor mapping)
- Add tokenizer hash for multilingual-e5-0.6b-260311
- Add conversion documentation
@isHuangXin isHuangXin changed the title Add F16 and I2_S GGUF conversion for bitnet-embeddings models Add F16 and I2_S GGUF conversion for bitnet-embeddings 0.6B and 270M models Jul 15, 2026
@isHuangXin isHuangXin force-pushed the release-bitnet-embedding-0.6b-270m branch from b706654 to 636bd86 Compare July 15, 2026 08:25
@isHuangXin isHuangXin force-pushed the release-bitnet-embedding-0.6b-270m branch from 636bd86 to 425fbbc Compare July 15, 2026 08:30
@isHuangXin

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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