BGE-M3, weight-only int8 ONNX
This is a weight-only int8 quantisation of
BAAI/bge-m3 at revision
5617a9f61b028005a4858fdac845db406aefb181. It outputs dense 1024-dimension
embeddings.
It is the embedding model the Remanence memory engine loads in process. The engine's full image carries these files: when the image is built, they are downloaded from a pinned revision of this repository and checked against the SHA-256 values below. The slim image carries none. When the engine runs this model in process (its default), it downloads any missing file from the same revision at start, unless it runs offline, and keeps a downloaded file only if its SHA-256 matches. With either image, each time the engine starts with this model enabled in process, it checks every file against the SHA-256 values below before loading it.
Source and licence
- Source:
BAAI/bge-m3@5617a9f61b028005a4858fdac845db406aefb181. The FP32 ONNX export it publishes isonnx/model.onnx+onnx/model.onnx_data;tokenizer.jsonis used unchanged. - Licence: MIT, as declared in the source's model card. The source
repository has no LICENSE file, so
LICENSEhere holds the standard MIT text, with a note naming the source and revision. This derivative is distributed under the same licence. - Training data: the source's model card cites its paper, Jianlv Chen, Shitao Xiao, Peitian Zhang, Kun Luo, Defu Lian and Zheng Liu, M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation (2024, https://arxiv.org/abs/2402.03216). The paper lists MS MARCO among the model's English fine-tuning datasets, and mMARCO-ZH, a machine translation of MS MARCO, among its Chinese ones (§3.1; Table 8 lists MS MARCO). Microsoft's terms for that dataset are reproduced under MS MARCO below.
How it was made
Fetch the source files at the pinned revision, and check each against its SHA-256 before use:
upstream file SHA-256 onnx/model.onnxf84251230831afb359ab26d9fd37d5936d4d9bb5d1d5410e66442f630f24435bonnx/model.onnx_data1eebfb28493f67bba03ce0ef64bfdc7fc5a3bd9d7493f818bb1d78cd798416b4tokenizer.json21106b6d7dab2952c1d496fb21d5dc9db75c28ed361a05f5020bbba27810dd08Quantise with onnxruntime's
MatMulNBitsQuantizer:bits=8,block_size=128,is_symmetric=True.- The MatMul weights become
MatMulNBitswith 8-bit weights. - Activations and compute stay FP32.
- Weights are saved as external data (
model.onnx.data). - The output for a text does not depend on what else is in the batch. Dynamic quantisation is not used, because its output does.
- The MatMul weights become
Environment, all pinned:
- the image
python@sha256:e697c81897302a4c4333bade000d98038fbb21eb064f8ee1fd42d02ebcd9d337; onnx==1.23.2,onnxruntime==1.31.1,numpy==2.5.4,onnx-ir==1.1.0andtokenizers==0.23.3.
- the image
Parity
Over 50 test strings, the cosine similarity between this model's embeddings and the FP32 model's is 0.9998 on average and 0.9997 at the lowest. The FP32 embeddings were served by Text Embeddings Inference 1.9.3 in float32.
Files
| file | bytes | SHA-256 |
|---|---|---|
model.onnx |
690697 | c383c2962c6408ff3d009845698ef2b73f1ba3e90233a3a066340352394858c9 |
model.onnx.data |
1370353680 | 7039a3b86a769763e1bf516fc008a7fd566495262b2243c5a45ebb899d23f9f5 |
tokenizer.json |
17098108 | 21106b6d7dab2952c1d496fb21d5dc9db75c28ed361a05f5020bbba27810dd08 |
model.onnx refers to its weights as model.onnx.data, so keep both in the
same directory. tokenizer.json is the source's file, byte for byte.
Use
- Inputs:
input_idsandattention_mask(int64,[batch, sequence]). - Output: Remanence takes the first output, CLS-pools it (if it is
[batch, sequence, 1024]) and L2-normalises it. That matches how Text Embeddings Inference serves BGE-M3. - Sequence length: Remanence bounds input at 512 tokens by default.
MS MARCO
This repository does not contain the MS MARCO dataset. The source model was fine-tuned on it, as stated above. Microsoft's terms for the dataset, verbatim from https://microsoft.github.io/msmarco/ ("Terms and Conditions"):
The MS MARCO datasets are intended for non-commercial research purposes only to promote advancement in the field of artificial intelligence and related areas, and is made available free of charge without extending any license or other intellectual property rights. The dataset is provided “as is” without warranty and usage of the data has risks since we may not own the underlying rights in the documents. We are not be liable for any damages related to use of the dataset. Feedback is voluntarily given and can be used as we see fit. Upon violation of any of these terms, your rights to use the dataset will end automatically.
Model tree for arnhemlabs/bge-m3-int8-weightonly
Base model
BAAI/bge-m3