commit 57bc882b1d9c7602d1706f6c8832b95757c55f9c Author: ModelHub XC Date: Fri Jul 17 02:00:06 2026 +0800 初始化项目,由ModelHub XC社区提供模型 Model: bartowski/Qwen_Qwen3-4B-GGUF Source: Original Platform diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..53d7257 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,47 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bin.* filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zstandard filter=lfs diff=lfs merge=lfs -text +*.tfevents* filter=lfs diff=lfs merge=lfs -text +*.db* filter=lfs diff=lfs merge=lfs -text +*.ark* filter=lfs diff=lfs merge=lfs -text +**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text +**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text +**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +*.ckpt filter=lfs diff=lfs merge=lfs -text +*.gguf* filter=lfs diff=lfs merge=lfs -text +*.ggml filter=lfs diff=lfs merge=lfs -text +*.llamafile* filter=lfs diff=lfs merge=lfs -text +*.pt2 filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text \ No newline at end of file diff --git a/Qwen_Qwen3-4B-IQ2_M.gguf b/Qwen_Qwen3-4B-IQ2_M.gguf new file mode 100644 index 0000000..2148d08 --- /dev/null +++ b/Qwen_Qwen3-4B-IQ2_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0aa56060b35246fb4f826e9242843b7f2faae20e771c193e0b7216c63f4dff9d +size 1512984000 diff --git a/Qwen_Qwen3-4B-IQ3_M.gguf b/Qwen_Qwen3-4B-IQ3_M.gguf new file mode 100644 index 0000000..d46c337 --- /dev/null +++ b/Qwen_Qwen3-4B-IQ3_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2746853ef81b0ca0f7f7f4594c2c3c776fa3fe777e1d0c396985faa1348e9070 +size 1962896320 diff --git a/Qwen_Qwen3-4B-IQ3_XS.gguf b/Qwen_Qwen3-4B-IQ3_XS.gguf new file mode 100644 index 0000000..d0478df --- /dev/null +++ b/Qwen_Qwen3-4B-IQ3_XS.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb202b1f40122747aa3d4dca6cd49e0b12143abb1f67f10021683206eba9064c +size 1814375360 diff --git a/Qwen_Qwen3-4B-IQ3_XXS.gguf b/Qwen_Qwen3-4B-IQ3_XXS.gguf new file mode 100644 index 0000000..22f3f86 --- /dev/null +++ b/Qwen_Qwen3-4B-IQ3_XXS.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3a62afc93ed01cd4787ec58479b639c956367965eb874abdab42a612dad90c5 +size 1670188480 diff --git a/Qwen_Qwen3-4B-IQ4_NL.gguf b/Qwen_Qwen3-4B-IQ4_NL.gguf new file mode 100644 index 0000000..caf9e39 --- /dev/null +++ b/Qwen_Qwen3-4B-IQ4_NL.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9a9b81bf610e8fd94e70862b2af153ea9582b1137e5836f4ee818d0db12796d +size 2381343680 diff --git a/Qwen_Qwen3-4B-IQ4_XS.gguf b/Qwen_Qwen3-4B-IQ4_XS.gguf new file mode 100644 index 0000000..89e7d94 --- /dev/null +++ b/Qwen_Qwen3-4B-IQ4_XS.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa5c45f0899a41d33eaeeeebdc88a95c56adaf45d199dae2d2a8fcdbcce177fa +size 2270751680 diff --git a/Qwen_Qwen3-4B-Q2_K.gguf b/Qwen_Qwen3-4B-Q2_K.gguf new file mode 100644 index 0000000..f8be63f --- /dev/null +++ b/Qwen_Qwen3-4B-Q2_K.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebdb400de15507a3ac524785929464e7b7d1df9677b0387a3977958a56bd38bb +size 1669499840 diff --git a/Qwen_Qwen3-4B-Q2_K_L.gguf b/Qwen_Qwen3-4B-Q2_K_L.gguf new file mode 100644 index 0000000..008845b --- /dev/null +++ b/Qwen_Qwen3-4B-Q2_K_L.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd70ca1631029e39fd34c813dabe76f2217ebc1a8e914eeccae659623b5f352b +size 1763700160 diff --git a/Qwen_Qwen3-4B-Q3_K_L.gguf b/Qwen_Qwen3-4B-Q3_K_L.gguf new file mode 100644 index 0000000..dab372b --- /dev/null +++ b/Qwen_Qwen3-4B-Q3_K_L.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ff01b989e5a7cf87100f07248d00e8566fb711669f5bfb5d7dd916e170931d6 +size 2239785920 diff --git a/Qwen_Qwen3-4B-Q3_K_M.gguf b/Qwen_Qwen3-4B-Q3_K_M.gguf new file mode 100644 index 0000000..a5f82cb --- /dev/null +++ b/Qwen_Qwen3-4B-Q3_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29183d72b1b4e9666287d82acb9aea189512c99cb3bf6d9c77c4a43ebcb30414 +size 2075618240 diff --git a/Qwen_Qwen3-4B-Q3_K_S.gguf b/Qwen_Qwen3-4B-Q3_K_S.gguf new file mode 100644 index 0000000..c290920 --- /dev/null +++ b/Qwen_Qwen3-4B-Q3_K_S.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a8cde953fd268fee5fcca36523b303cace78c1a648e974608517d47340e5560 +size 1886997440 diff --git a/Qwen_Qwen3-4B-Q3_K_XL.gguf b/Qwen_Qwen3-4B-Q3_K_XL.gguf new file mode 100644 index 0000000..8e2f037 --- /dev/null +++ b/Qwen_Qwen3-4B-Q3_K_XL.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d5d27bdb7bc50eb8aa57ee360f6f53b29883d14675c69de7e87d312c48f2a04 +size 2333986240 diff --git a/Qwen_Qwen3-4B-Q4_0.gguf b/Qwen_Qwen3-4B-Q4_0.gguf new file mode 100644 index 0000000..d863c19 --- /dev/null +++ b/Qwen_Qwen3-4B-Q4_0.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:003e104a544c3cdb008db07acb07b8f6feeb62e50c4eca3cfff14fc59e62e5b7 +size 2375773120 diff --git a/Qwen_Qwen3-4B-Q4_1.gguf b/Qwen_Qwen3-4B-Q4_1.gguf new file mode 100644 index 0000000..de299d6 --- /dev/null +++ b/Qwen_Qwen3-4B-Q4_1.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18ddb04d07bf0ec89854c1177e5c2f490c7b294c02ad720359d94310c6d426b7 +size 2596629440 diff --git a/Qwen_Qwen3-4B-Q4_K_L.gguf b/Qwen_Qwen3-4B-Q4_K_L.gguf new file mode 100644 index 0000000..587f49f --- /dev/null +++ b/Qwen_Qwen3-4B-Q4_K_L.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:003d53604195c99061836ac7d74350d6714c8587f3a838aca5c7e22b94b7dcee +size 2591481280 diff --git a/Qwen_Qwen3-4B-Q4_K_M.gguf b/Qwen_Qwen3-4B-Q4_K_M.gguf new file mode 100644 index 0000000..922ecac --- /dev/null +++ b/Qwen_Qwen3-4B-Q4_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fbe1d5edd4ce802ae3ae7c7e4ab7d09789d697fdac1fc7929f8df4ca3c41bae3 +size 2497280960 diff --git a/Qwen_Qwen3-4B-Q4_K_S.gguf b/Qwen_Qwen3-4B-Q4_K_S.gguf new file mode 100644 index 0000000..f2fda6b --- /dev/null +++ b/Qwen_Qwen3-4B-Q4_K_S.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3c7f6eab31e251a15e7b2d19a7fe3efc8c27d11175e878583867015b5d42177 +size 2383309760 diff --git a/Qwen_Qwen3-4B-Q5_K_L.gguf b/Qwen_Qwen3-4B-Q5_K_L.gguf new file mode 100644 index 0000000..20e88a4 --- /dev/null +++ b/Qwen_Qwen3-4B-Q5_K_L.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce850bd72c59835cd6e4158fc6462c4f25e0fd64d43b71fc2b53e19f600ff0ba +size 2983714240 diff --git a/Qwen_Qwen3-4B-Q5_K_M.gguf b/Qwen_Qwen3-4B-Q5_K_M.gguf new file mode 100644 index 0000000..fc86121 --- /dev/null +++ b/Qwen_Qwen3-4B-Q5_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e6002bee4457c8061c04bfb742c3b23aca976606dfe0e0963cbfd434a370eac +size 2889513920 diff --git a/Qwen_Qwen3-4B-Q5_K_S.gguf b/Qwen_Qwen3-4B-Q5_K_S.gguf new file mode 100644 index 0000000..6ee5702 --- /dev/null +++ b/Qwen_Qwen3-4B-Q5_K_S.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a2057469d1852626ac5899f971879a68a359ff05a6b5323236a2459274e2f07 +size 2823711680 diff --git a/Qwen_Qwen3-4B-Q6_K.gguf b/Qwen_Qwen3-4B-Q6_K.gguf new file mode 100644 index 0000000..ed7eb7a --- /dev/null +++ b/Qwen_Qwen3-4B-Q6_K.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12b0913feed83232737d860e299ca410d3b2bbf8d33e156ba594f3b44ba17ef1 +size 3306261440 diff --git a/Qwen_Qwen3-4B-Q6_K_L.gguf b/Qwen_Qwen3-4B-Q6_K_L.gguf new file mode 100644 index 0000000..bfcde52 --- /dev/null +++ b/Qwen_Qwen3-4B-Q6_K_L.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6df12a327862a55f98165953795d51b94f147bfbe327dcda5a8e02e393f9bc65 +size 3400461760 diff --git a/Qwen_Qwen3-4B-Q8_0.gguf b/Qwen_Qwen3-4B-Q8_0.gguf new file mode 100644 index 0000000..12478bb --- /dev/null +++ b/Qwen_Qwen3-4B-Q8_0.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4050871d20fa939e88e83b1a86060061bdeff01e0d9e5d000d374766f0caf7d7 +size 4280405440 diff --git a/Qwen_Qwen3-4B-bf16.gguf b/Qwen_Qwen3-4B-bf16.gguf new file mode 100644 index 0000000..aac2ab1 --- /dev/null +++ b/Qwen_Qwen3-4B-bf16.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52486602bdca589fd1507962537b4fc7fa2f1fc57222fa36a960cf691d4960c8 +size 8051285184 diff --git a/Qwen_Qwen3-4B.imatrix b/Qwen_Qwen3-4B.imatrix new file mode 100644 index 0000000..56cc1f0 Binary files /dev/null and b/Qwen_Qwen3-4B.imatrix differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..a1ca433 --- /dev/null +++ b/README.md @@ -0,0 +1,170 @@ +--- +quantized_by: bartowski +pipeline_tag: text-generation +base_model: Qwen/Qwen3-4B +base_model_relation: quantized +--- + +## Llamacpp imatrix Quantizations of Qwen3-4B by Qwen + +Using llama.cpp release b5200 for quantization. + +Original model: https://huggingface.co/Qwen/Qwen3-4B + +All quants made using imatrix option with dataset from [here](https://gist.github.com/bartowski1182/eb213dccb3571f863da82e99418f81e8) + +Run them in [LM Studio](https://lmstudio.ai/) + +Run them directly with [llama.cpp](https://github.com/ggerganov/llama.cpp), or any other llama.cpp based project + +## Prompt format + +``` +<|im_start|>system +{system_prompt}<|im_end|> +<|im_start|>user +{prompt}<|im_end|> +<|im_start|>assistant +``` + +## Download a file (not the whole branch) from below: + +| Filename | Quant type | File Size | Split | Description | +| -------- | ---------- | --------- | ----- | ----------- | +| [Qwen3-4B-bf16.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-bf16.gguf) | bf16 | 8.05GB | false | Full BF16 weights. | +| [Qwen3-4B-Q8_0.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q8_0.gguf) | Q8_0 | 4.28GB | false | Extremely high quality, generally unneeded but max available quant. | +| [Qwen3-4B-Q6_K_L.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q6_K_L.gguf) | Q6_K_L | 3.40GB | false | Uses Q8_0 for embed and output weights. Very high quality, near perfect, *recommended*. | +| [Qwen3-4B-Q6_K.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q6_K.gguf) | Q6_K | 3.31GB | false | Very high quality, near perfect, *recommended*. | +| [Qwen3-4B-Q5_K_L.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q5_K_L.gguf) | Q5_K_L | 2.98GB | false | Uses Q8_0 for embed and output weights. High quality, *recommended*. | +| [Qwen3-4B-Q5_K_M.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q5_K_M.gguf) | Q5_K_M | 2.89GB | false | High quality, *recommended*. | +| [Qwen3-4B-Q5_K_S.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q5_K_S.gguf) | Q5_K_S | 2.82GB | false | High quality, *recommended*. | +| [Qwen3-4B-Q4_1.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q4_1.gguf) | Q4_1 | 2.60GB | false | Legacy format, similar performance to Q4_K_S but with improved tokens/watt on Apple silicon. | +| [Qwen3-4B-Q4_K_L.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q4_K_L.gguf) | Q4_K_L | 2.59GB | false | Uses Q8_0 for embed and output weights. Good quality, *recommended*. | +| [Qwen3-4B-Q4_K_M.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q4_K_M.gguf) | Q4_K_M | 2.50GB | false | Good quality, default size for most use cases, *recommended*. | +| [Qwen3-4B-Q4_K_S.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q4_K_S.gguf) | Q4_K_S | 2.38GB | false | Slightly lower quality with more space savings, *recommended*. | +| [Qwen3-4B-Q4_0.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q4_0.gguf) | Q4_0 | 2.38GB | false | Legacy format, offers online repacking for ARM and AVX CPU inference. | +| [Qwen3-4B-IQ4_NL.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-IQ4_NL.gguf) | IQ4_NL | 2.38GB | false | Similar to IQ4_XS, but slightly larger. Offers online repacking for ARM CPU inference. | +| [Qwen3-4B-Q3_K_XL.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q3_K_XL.gguf) | Q3_K_XL | 2.33GB | false | Uses Q8_0 for embed and output weights. Lower quality but usable, good for low RAM availability. | +| [Qwen3-4B-IQ4_XS.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-IQ4_XS.gguf) | IQ4_XS | 2.27GB | false | Decent quality, smaller than Q4_K_S with similar performance, *recommended*. | +| [Qwen3-4B-Q3_K_L.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q3_K_L.gguf) | Q3_K_L | 2.24GB | false | Lower quality but usable, good for low RAM availability. | +| [Qwen3-4B-Q3_K_M.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q3_K_M.gguf) | Q3_K_M | 2.08GB | false | Low quality. | +| [Qwen3-4B-IQ3_M.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-IQ3_M.gguf) | IQ3_M | 1.96GB | false | Medium-low quality, new method with decent performance comparable to Q3_K_M. | +| [Qwen3-4B-Q3_K_S.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q3_K_S.gguf) | Q3_K_S | 1.89GB | false | Low quality, not recommended. | +| [Qwen3-4B-IQ3_XS.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-IQ3_XS.gguf) | IQ3_XS | 1.81GB | false | Lower quality, new method with decent performance, slightly better than Q3_K_S. | +| [Qwen3-4B-Q2_K_L.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q2_K_L.gguf) | Q2_K_L | 1.76GB | false | Uses Q8_0 for embed and output weights. Very low quality but surprisingly usable. | +| [Qwen3-4B-IQ3_XXS.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-IQ3_XXS.gguf) | IQ3_XXS | 1.67GB | false | Lower quality, new method with decent performance, comparable to Q3 quants. | +| [Qwen3-4B-Q2_K.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-Q2_K.gguf) | Q2_K | 1.67GB | false | Very low quality but surprisingly usable. | +| [Qwen3-4B-IQ2_M.gguf](https://huggingface.co/bartowski/Qwen_Qwen3-4B-GGUF/blob/main/Qwen_Qwen3-4B-IQ2_M.gguf) | IQ2_M | 1.51GB | false | Relatively low quality, uses SOTA techniques to be surprisingly usable. | + +## Embed/output weights + +Some of these quants (Q3_K_XL, Q4_K_L etc) are the standard quantization method with the embeddings and output weights quantized to Q8_0 instead of what they would normally default to. + +## Downloading using huggingface-cli + +
+ Click to view download instructions + +First, make sure you have hugginface-cli installed: + +``` +pip install -U "huggingface_hub[cli]" +``` + +Then, you can target the specific file you want: + +``` +huggingface-cli download bartowski/Qwen_Qwen3-4B-GGUF --include "Qwen_Qwen3-4B-Q4_K_M.gguf" --local-dir ./ +``` + +If the model is bigger than 50GB, it will have been split into multiple files. In order to download them all to a local folder, run: + +``` +huggingface-cli download bartowski/Qwen_Qwen3-4B-GGUF --include "Qwen_Qwen3-4B-Q8_0/*" --local-dir ./ +``` + +You can either specify a new local-dir (Qwen_Qwen3-4B-Q8_0) or download them all in place (./) + +
+ +## ARM/AVX information + +Previously, you would download Q4_0_4_4/4_8/8_8, and these would have their weights interleaved in memory in order to improve performance on ARM and AVX machines by loading up more data in one pass. + +Now, however, there is something called "online repacking" for weights. details in [this PR](https://github.com/ggerganov/llama.cpp/pull/9921). If you use Q4_0 and your hardware would benefit from repacking weights, it will do it automatically on the fly. + +As of llama.cpp build [b4282](https://github.com/ggerganov/llama.cpp/releases/tag/b4282) you will not be able to run the Q4_0_X_X files and will instead need to use Q4_0. + +Additionally, if you want to get slightly better quality for , you can use IQ4_NL thanks to [this PR](https://github.com/ggerganov/llama.cpp/pull/10541) which will also repack the weights for ARM, though only the 4_4 for now. The loading time may be slower but it will result in an overall speed incrase. + +
+ Click to view Q4_0_X_X information (deprecated + +I'm keeping this section to show the potential theoretical uplift in performance from using the Q4_0 with online repacking. + +
+ Click to view benchmarks on an AVX2 system (EPYC7702) + +| model | size | params | backend | threads | test | t/s | % (vs Q4_0) | +| ------------------------------ | ---------: | ---------: | ---------- | ------: | ------------: | -------------------: |-------------: | +| qwen2 3B Q4_0 | 1.70 GiB | 3.09 B | CPU | 64 | pp512 | 204.03 ± 1.03 | 100% | +| qwen2 3B Q4_0 | 1.70 GiB | 3.09 B | CPU | 64 | pp1024 | 282.92 ± 0.19 | 100% | +| qwen2 3B Q4_0 | 1.70 GiB | 3.09 B | CPU | 64 | pp2048 | 259.49 ± 0.44 | 100% | +| qwen2 3B Q4_0 | 1.70 GiB | 3.09 B | CPU | 64 | tg128 | 39.12 ± 0.27 | 100% | +| qwen2 3B Q4_0 | 1.70 GiB | 3.09 B | CPU | 64 | tg256 | 39.31 ± 0.69 | 100% | +| qwen2 3B Q4_0 | 1.70 GiB | 3.09 B | CPU | 64 | tg512 | 40.52 ± 0.03 | 100% | +| qwen2 3B Q4_K_M | 1.79 GiB | 3.09 B | CPU | 64 | pp512 | 301.02 ± 1.74 | 147% | +| qwen2 3B Q4_K_M | 1.79 GiB | 3.09 B | CPU | 64 | pp1024 | 287.23 ± 0.20 | 101% | +| qwen2 3B Q4_K_M | 1.79 GiB | 3.09 B | CPU | 64 | pp2048 | 262.77 ± 1.81 | 101% | +| qwen2 3B Q4_K_M | 1.79 GiB | 3.09 B | CPU | 64 | tg128 | 18.80 ± 0.99 | 48% | +| qwen2 3B Q4_K_M | 1.79 GiB | 3.09 B | CPU | 64 | tg256 | 24.46 ± 3.04 | 83% | +| qwen2 3B Q4_K_M | 1.79 GiB | 3.09 B | CPU | 64 | tg512 | 36.32 ± 3.59 | 90% | +| qwen2 3B Q4_0_8_8 | 1.69 GiB | 3.09 B | CPU | 64 | pp512 | 271.71 ± 3.53 | 133% | +| qwen2 3B Q4_0_8_8 | 1.69 GiB | 3.09 B | CPU | 64 | pp1024 | 279.86 ± 45.63 | 100% | +| qwen2 3B Q4_0_8_8 | 1.69 GiB | 3.09 B | CPU | 64 | pp2048 | 320.77 ± 5.00 | 124% | +| qwen2 3B Q4_0_8_8 | 1.69 GiB | 3.09 B | CPU | 64 | tg128 | 43.51 ± 0.05 | 111% | +| qwen2 3B Q4_0_8_8 | 1.69 GiB | 3.09 B | CPU | 64 | tg256 | 43.35 ± 0.09 | 110% | +| qwen2 3B Q4_0_8_8 | 1.69 GiB | 3.09 B | CPU | 64 | tg512 | 42.60 ± 0.31 | 105% | + +Q4_0_8_8 offers a nice bump to prompt processing and a small bump to text generation + +
+ +
+ +## Which file should I choose? + +
+ Click here for details + +A great write up with charts showing various performances is provided by Artefact2 [here](https://gist.github.com/Artefact2/b5f810600771265fc1e39442288e8ec9) + +The first thing to figure out is how big a model you can run. To do this, you'll need to figure out how much RAM and/or VRAM you have. + +If you want your model running as FAST as possible, you'll want to fit the whole thing on your GPU's VRAM. Aim for a quant with a file size 1-2GB smaller than your GPU's total VRAM. + +If you want the absolute maximum quality, add both your system RAM and your GPU's VRAM together, then similarly grab a quant with a file size 1-2GB Smaller than that total. + +Next, you'll need to decide if you want to use an 'I-quant' or a 'K-quant'. + +If you don't want to think too much, grab one of the K-quants. These are in format 'QX_K_X', like Q5_K_M. + +If you want to get more into the weeds, you can check out this extremely useful feature chart: + +[llama.cpp feature matrix](https://github.com/ggerganov/llama.cpp/wiki/Feature-matrix) + +But basically, if you're aiming for below Q4, and you're running cuBLAS (Nvidia) or rocBLAS (AMD), you should look towards the I-quants. These are in format IQX_X, like IQ3_M. These are newer and offer better performance for their size. + +These I-quants can also be used on CPU, but will be slower than their K-quant equivalent, so speed vs performance is a tradeoff you'll have to decide. + +
+ +## Credits + +Thank you kalomaze and Dampf for assistance in creating the imatrix calibration dataset. + +Thank you ZeroWw for the inspiration to experiment with embed/output. + +Thank you to LM Studio for sponsoring my work. + +Want to support my work? Visit my ko-fi page here: https://ko-fi.com/bartowski diff --git a/configuration.json b/configuration.json new file mode 100644 index 0000000..bbeeda1 --- /dev/null +++ b/configuration.json @@ -0,0 +1 @@ +{"framework": "pytorch", "task": "text-generation", "allow_remote": true} \ No newline at end of file