LeanQuant commited on
Commit
51a428b
·
verified ·
1 Parent(s): 2b13406

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. README.md +63 -0
  2. config.json +37 -0
  3. diffusion_pytorch_model.safetensors +3 -0
  4. single_transformer_blocks_0.safetensors +3 -0
  5. single_transformer_blocks_1.safetensors +3 -0
  6. single_transformer_blocks_10.safetensors +3 -0
  7. single_transformer_blocks_11.safetensors +3 -0
  8. single_transformer_blocks_12.safetensors +3 -0
  9. single_transformer_blocks_13.safetensors +3 -0
  10. single_transformer_blocks_14.safetensors +3 -0
  11. single_transformer_blocks_15.safetensors +3 -0
  12. single_transformer_blocks_16.safetensors +3 -0
  13. single_transformer_blocks_17.safetensors +3 -0
  14. single_transformer_blocks_18.safetensors +3 -0
  15. single_transformer_blocks_19.safetensors +3 -0
  16. single_transformer_blocks_2.safetensors +3 -0
  17. single_transformer_blocks_20.safetensors +3 -0
  18. single_transformer_blocks_21.safetensors +3 -0
  19. single_transformer_blocks_22.safetensors +3 -0
  20. single_transformer_blocks_23.safetensors +3 -0
  21. single_transformer_blocks_24.safetensors +3 -0
  22. single_transformer_blocks_25.safetensors +3 -0
  23. single_transformer_blocks_26.safetensors +3 -0
  24. single_transformer_blocks_27.safetensors +3 -0
  25. single_transformer_blocks_28.safetensors +3 -0
  26. single_transformer_blocks_29.safetensors +3 -0
  27. single_transformer_blocks_3.safetensors +3 -0
  28. single_transformer_blocks_30.safetensors +3 -0
  29. single_transformer_blocks_31.safetensors +3 -0
  30. single_transformer_blocks_32.safetensors +3 -0
  31. single_transformer_blocks_33.safetensors +3 -0
  32. single_transformer_blocks_34.safetensors +3 -0
  33. single_transformer_blocks_35.safetensors +3 -0
  34. single_transformer_blocks_36.safetensors +3 -0
  35. single_transformer_blocks_37.safetensors +3 -0
  36. single_transformer_blocks_4.safetensors +3 -0
  37. single_transformer_blocks_5.safetensors +3 -0
  38. single_transformer_blocks_6.safetensors +3 -0
  39. single_transformer_blocks_7.safetensors +3 -0
  40. single_transformer_blocks_8.safetensors +3 -0
  41. single_transformer_blocks_9.safetensors +3 -0
  42. transformer_blocks_0.safetensors +3 -0
  43. transformer_blocks_1.safetensors +3 -0
  44. transformer_blocks_10.safetensors +3 -0
  45. transformer_blocks_11.safetensors +3 -0
  46. transformer_blocks_12.safetensors +3 -0
  47. transformer_blocks_13.safetensors +3 -0
  48. transformer_blocks_14.safetensors +3 -0
  49. transformer_blocks_15.safetensors +3 -0
  50. transformer_blocks_16.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - black-forest-labs/FLUX.1-schnell
4
+ base_model_relation: quantized
5
+ pipeline_tag: text-to-image
6
+ tags:
7
+ - dfloat11
8
+ - df11
9
+ - lossless compression
10
+ - 70% size, 100% accuracy
11
+ ---
12
+
13
+ ## DFloat11 Compressed Model: `black-forest-labs/FLUX.1-schnell`
14
+
15
+ This is a **losslessly compressed** version of [`black-forest-labs/FLUX.1-schnell`](https://huggingface.co/black-forest-labs/FLUX.1-schnell) using our custom **DFloat11** format. The outputs of this compressed model are **bit-for-bit identical** to the original BFloat16 model, while reducing GPU memory consumption by approximately **30%**.
16
+
17
+ ### 🔍 How It Works
18
+
19
+ DFloat11 compresses model weights using **Huffman coding** of BFloat16 exponent bits, combined with **hardware-aware algorithmic designs** that enable efficient on-the-fly decompression directly on the GPU. During inference, the weights remain compressed in GPU memory and are **decompressed just before matrix multiplications**, then **immediately discarded after use** to minimize memory footprint.
20
+
21
+ Key benefits:
22
+
23
+ * **No CPU decompression or host-device data transfer** --- all operations are handled entirely on the GPU.
24
+ * DFloat11 is **much faster than CPU-offloading approaches**, enabling practical deployment in memory-constrained environments.
25
+ * The compression is **fully lossless**, guaranteeing that the model’s outputs are **bit-for-bit identical** to those of the original model.
26
+
27
+ ### 🔧 How to Use
28
+
29
+ 1. Install the DFloat11 pip package *(installs the CUDA kernel automatically; requires a CUDA-compatible GPU and PyTorch installed)*:
30
+
31
+ ```bash
32
+ pip install dfloat11[cuda12]
33
+ # or if you have CUDA version 11:
34
+ # pip install dfloat11[cuda11]
35
+ ```
36
+
37
+ 2. To use the DFloat11 model, run the following example code in Python:
38
+ ```python
39
+ import torch
40
+ from diffusers import FluxPipeline
41
+ from dfloat11 import DFloat11Model
42
+
43
+ pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16)
44
+ pipe.enable_model_cpu_offload()
45
+
46
+ DFloat11Model.from_pretrained('DFloat11/FLUX.1-schnell-DF11', device='cpu', bfloat16_model=pipe.transformer)
47
+
48
+ prompt = "A futuristic cityscape at sunset, with flying cars, neon lights, and reflective water canals"
49
+ image = pipe(
50
+ prompt,
51
+ guidance_scale=0.0,
52
+ num_inference_steps=4,
53
+ max_sequence_length=256,
54
+ generator=torch.Generator("cpu").manual_seed(0)
55
+ ).images[0]
56
+ image.save("flux-schnell.png")
57
+ ```
58
+
59
+ ### 📄 Learn More
60
+
61
+ * **Paper**: [70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float](https://arxiv.org/abs/2504.11651)
62
+ * **GitHub**: [https://github.com/LeanModels/DFloat11](https://github.com/LeanModels/DFloat11)
63
+ * **HuggingFace**: [https://huggingface.co/DFloat11](https://huggingface.co/DFloat11)
config.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dfloat11_config": {
3
+ "bytes_per_thread": 8,
4
+ "pattern_dict": {
5
+ "transformer_blocks.\\d+": [
6
+ "norm1.linear",
7
+ "norm1_context.linear",
8
+ "attn.to_q",
9
+ "attn.to_k",
10
+ "attn.to_v",
11
+ "attn.add_k_proj",
12
+ "attn.add_v_proj",
13
+ "attn.add_q_proj",
14
+ "attn.to_out.0",
15
+ "attn.to_add_out",
16
+ "ff.net.0.proj",
17
+ "ff.net.2",
18
+ "ff_context.net.0.proj",
19
+ "ff_context.net.2"
20
+ ],
21
+ "single_transformer_blocks.\\d+": [
22
+ "norm.linear",
23
+ "proj_mlp",
24
+ "proj_out",
25
+ "attn.to_q",
26
+ "attn.to_k",
27
+ "attn.to_v"
28
+ ]
29
+ },
30
+ "threads_per_block": [
31
+ 512
32
+ ],
33
+ "version": "0.2.0"
34
+ },
35
+ "model_type": "llama"
36
+ }
37
+
diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:edf0d7390cbcf66cb4a294c4bb1099323db3d9cc0d3b3a3ee35cc1881fc1a7ba
3
+ size 107792160
single_transformer_blocks_0.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0037a1846cd6ee4532aa1f5f15ffdcb968aa77c5d4d30acf3ee51321df20a99d
3
+ size 191953015
single_transformer_blocks_1.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e64a69f314d23e045686e2b3636f3b65613ff1bbe61df3a70db2c4fe836d5842
3
+ size 192032207
single_transformer_blocks_10.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf8e859cadea7b8ac2dc91fbbbd40d925604f65adfe719317efd8db7a0e7275f
3
+ size 193121523
single_transformer_blocks_11.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75830d953639891dcee2360ea47183d418db5280e8309806cb3dc23f0d6781bc
3
+ size 193355293
single_transformer_blocks_12.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66eefa3597c8db8f24d534a23a58df26f6563e8a0e6dbb1894f760ef26c44d09
3
+ size 193529273
single_transformer_blocks_13.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d110c7421a3d5aa2b076bc362c61cf7c516bd93380bd49e9aa1c7375d79d5dec
3
+ size 193556587
single_transformer_blocks_14.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8bee3032ad669b6639711bb06fc65d6aaecde8bf7dee72f2e3629fe22e97b572
3
+ size 193552945
single_transformer_blocks_15.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1991916050f222ec1c50ca20c22a59102f8ae4cc8322e56247a8045f176afc65
3
+ size 193512820
single_transformer_blocks_16.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:751724fc51ebb59a99987ab5631b82f35a68d06863de5614198a3edda54045f2
3
+ size 193540148
single_transformer_blocks_17.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:863cd3099cc41e40e90c38967eecb0951583cf784b682695e09c06cc06d72bc1
3
+ size 193663027
single_transformer_blocks_18.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:694dfbe171f862a637c8a22825356fa5254f70d8a7fb94c142693881a6865f75
3
+ size 193744130
single_transformer_blocks_19.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:74d568dfb324f67f17ab544a8f1100a14eafc9699522861df07e6f2ebb5edcec
3
+ size 193748170
single_transformer_blocks_2.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf5000a2bc92c45c465654b53fce5518e3cc2d8c05aac975a4b41862aa835873
3
+ size 192074001
single_transformer_blocks_20.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:910f97e188c44085496a57276d4e10ca06a09a07476e51aad500b1d119392647
3
+ size 193812404
single_transformer_blocks_21.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72e55153332eee80cd3c6d7f9e32c1a2000958aee3bc1554bddb7af44d4b5172
3
+ size 194050033
single_transformer_blocks_22.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca4f002463a8be9d28f958df090a959b824becb06190566f045076bca657820e
3
+ size 194185169
single_transformer_blocks_23.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f467b516919c81a3798511f45039f980272bba7dd7bfae083fa834421271fdf
3
+ size 194411637
single_transformer_blocks_24.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:42e32898cac5408801b18579072c80d5fb2af1f51c4348e96060a3064e78fa14
3
+ size 194459327
single_transformer_blocks_25.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:baade5dffabea356302ce414d4736732333fbb19e5acaf888d75a75ff4898db1
3
+ size 194751756
single_transformer_blocks_26.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4d671332cfe58cdc332edfb220a5b6cfe317a7bfe5607058282b8054a4e875e
3
+ size 194837141
single_transformer_blocks_27.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:377bbdbff2ed7b787071ab459c6e17eba5bccc467e0387b4ccd2b7aa86db79c4
3
+ size 195176223
single_transformer_blocks_28.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57d69b2b853301e6ab4be36a19dde058f4932fb5fea6f4e3dba6734ace7147fe
3
+ size 195365552
single_transformer_blocks_29.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f6ed53cbe68061e33f2f61acd11a8b5e0a4af96e2c264fb17f000dc48a139dc
3
+ size 195189385
single_transformer_blocks_3.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47792ba1e34c3b2b9644721f29cc79768ebaf18cd8f1dba68dd28d4456049645
3
+ size 192146012
single_transformer_blocks_30.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5bda3e305c44032910e47151e4318354b1ae5d3afff88644f8c8889d26e15fe1
3
+ size 195679215
single_transformer_blocks_31.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e1286e2c52052514ad7f90850d769513f4439de3194d903efd8a8d6932c98a43
3
+ size 195832841
single_transformer_blocks_32.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff0a7c59d4dcb60307c425597ba1580358c35f9963a7928501bb969325180695
3
+ size 195791381
single_transformer_blocks_33.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:05ed812665609b75a82562c7cdfc4ae48b588d1b39fcd728fb3698345885f87e
3
+ size 195843235
single_transformer_blocks_34.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e6cfb93e29930842cb807d760679cc1218757063863d6f8735c0adbbb83d8125
3
+ size 196142671
single_transformer_blocks_35.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b56c0b4224153f10cdd37c17314c240e51d20015eb84aabe79654dacba2a64b
3
+ size 196397938
single_transformer_blocks_36.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f20bb1166dd733b1b6c7a0af5ea820f7549100874d383721df9eaf30212e37f
3
+ size 194733332
single_transformer_blocks_37.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7b43788887b371039f8c3cab9d564e7d5f26285b85adece74e3f65963ef2a20
3
+ size 196538942
single_transformer_blocks_4.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:386508cff8883f508bca451562cc35a5158a400da97e02caeaaf3c5276d32946
3
+ size 192209800
single_transformer_blocks_5.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a19666cd7ce2275b283ce0499edc53f78733bc146c711b034af1760d6c1d38bd
3
+ size 192383459
single_transformer_blocks_6.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84fa6d67ec1e8d3326c38900293f6632d78e827b257c67526d3d8cbfd5ac732d
3
+ size 192510255
single_transformer_blocks_7.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5d7b1308b9f7d4d316778ec1dc499eda842cba6a3d2081d4f90c78d27dc8470
3
+ size 192611186
single_transformer_blocks_8.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:866c2cacf8c95a513e6de2230676557ba320fdfc95f66f49939a9741067c53dc
3
+ size 192849476
single_transformer_blocks_9.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aea5aa932b175287a5981eaaba361e41ca18c214ad8ad501b01ab63264d1abf7
3
+ size 192984853
transformer_blocks_0.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:505ce0fdf7761acffc150842a96b27b796385eb432e1e2f444ee8a65c795f8b3
3
+ size 471202099
transformer_blocks_1.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2d9a014f8d72c81128abdd3b7a0e0ca91fae5d5f3e3216181bebc53ae3261a6
3
+ size 471627688
transformer_blocks_10.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3fe0eb093f2e720b433b5eed39d77ee9f0c5ddb2e81a0801d3269375987dff3
3
+ size 463500213
transformer_blocks_11.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:236d05af08f23ae7bb90cc3ceb376da4f958e3a17cc960620bc5d7d97eaa74b7
3
+ size 462862609
transformer_blocks_12.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8496d0d29be9c3ed9c1826937a25d5fadf85753f2e224b12359789984e55c694
3
+ size 462757049
transformer_blocks_13.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b9733d95a6ded2ff70591ef8eb5abf230715d88e7506a54c551804beecc55566
3
+ size 463790209
transformer_blocks_14.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:453d1f4fed9deaedb1441b693b93d9af412cfafe9c9c1bc8cabc96e589da65d5
3
+ size 462434248
transformer_blocks_15.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ae0ec8d7dfaef9ba71fe2ede6b4b3e5815234f9d9b2400359bf1bba3e40acb6
3
+ size 461533069
transformer_blocks_16.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4a657aed5321a001c88410e46dcd103b0bb4f247d839d9c9adae9d980923c9a
3
+ size 461588247