LeanQuant commited on
Commit
dbb180b
·
verified ·
1 Parent(s): 6e303b2

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 +66 -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,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - black-forest-labs/FLUX.1-dev
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-dev`
14
+
15
+ This is a **losslessly compressed** version of [`black-forest-labs/FLUX.1-dev`](https://huggingface.co/black-forest-labs/FLUX.1-dev) 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-dev", torch_dtype=torch.bfloat16)
44
+ pipe.enable_model_cpu_offload()
45
+
46
+ DFloat11Model.from_pretrained('DFloat11/FLUX.1-dev-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
+ width=1920,
52
+ height=1440,
53
+ guidance_scale=3.5,
54
+ num_inference_steps=50,
55
+ max_sequence_length=512,
56
+ generator=torch.Generator(device="cuda").manual_seed(0)
57
+ ).images[0]
58
+
59
+ image.save("image.png")
60
+ ```
61
+
62
+ ### 📄 Learn More
63
+
64
+ * **Paper**: [70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float](https://arxiv.org/abs/2504.11651)
65
+ * **GitHub**: [https://github.com/LeanModels/DFloat11](https://github.com/LeanModels/DFloat11)
66
+ * **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:377d89f46e79ad75668a94dcf6689897ddf30631a88dd0735fe5a0afa4b3a80e
3
+ size 128252176
single_transformer_blocks_0.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4211cf5e28046581ec8807137d680d7c45c62bba99fb6aa6eba5b14eb8c6a88
3
+ size 191954551
single_transformer_blocks_1.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c2e0750f62b901215a091a036d24800099df2d2fd8938a05c8588c56fee1bd1
3
+ size 192031127
single_transformer_blocks_10.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91f1761a29d5d152d07d9acc728ba1ddc23068e6efc00ea971f91d9de1122ba2
3
+ size 193131890
single_transformer_blocks_11.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2aac606a63df555da9107805f0ac16a53f01678e4711056dde7471db09e2c85
3
+ size 193361866
single_transformer_blocks_12.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dcc7a2f2a2a5b5878d15406352adbabbc18ab14c1c83a1435d836764b9f4b4d1
3
+ size 193532369
single_transformer_blocks_13.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d192f3b8578fd52009936cb4e2545133d8def982869a73f9cf60a6ed3c6f4aaf
3
+ size 193559171
single_transformer_blocks_14.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ab914fd8d4a4481e278c8d154e71640b9014da7a56816dcf13cabb3015548b3b
3
+ size 193554015
single_transformer_blocks_15.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c0e2d47e56f45364e0c736af1d70cf308c45849e73282587ec3408ef4d55a9d
3
+ size 193521141
single_transformer_blocks_16.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e2e285f8c49fe3fec76032abc046f26c2442ddcfdc0356556f682d7c3a8781b
3
+ size 193547955
single_transformer_blocks_17.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e354a425714b8f5e8632d593f169a84fe3b7b9471a9dc30d8f8e7d4f88a22b23
3
+ size 193677798
single_transformer_blocks_18.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1e14f06e0000e2e91730e0727100ae385e75c91306dae7d5a85fb2379185220
3
+ size 193747490
single_transformer_blocks_19.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:07cab1ad7c4135534f726fe801dd41f8f9b461ebd6625e096cb44fa86b3bbe36
3
+ size 193753360
single_transformer_blocks_2.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:334d3256977e0a2d073105130aac323a9348a08f8b14b39a31d2f72980a1fbec
3
+ size 192075010
single_transformer_blocks_20.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6ace0adb8a3097031cf3f3d5e6e2df15797523282ad7d5c161b46bea3d8c7e46
3
+ size 193823895
single_transformer_blocks_21.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:acda6286f934a55cb9335c94439031d818687fd458d602bb67b8f6e4c9fc5c05
3
+ size 194056734
single_transformer_blocks_22.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2222582007f84efd085b54f5a94ccd5323ab7149ed9c754757d37ffe3d17022d
3
+ size 194192022
single_transformer_blocks_23.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a569f253b3aa549e3fc0bd6c6236599c6ee6fba59a24c82bb9b59f555326a299
3
+ size 194424415
single_transformer_blocks_24.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:324ea3f6fa681c4012440091ae174969a392d49d04ac7cd7e79909877bd9d36c
3
+ size 194472956
single_transformer_blocks_25.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ff388f14602451a8c178b10c85eb2a78b4257508f42ac83794f7c1925332007
3
+ size 194765359
single_transformer_blocks_26.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1d2ede686ecdd239bfffb615a9913b527b5af7d9e617ae20ced22d7d3f696e43
3
+ size 194846806
single_transformer_blocks_27.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d456bfc6808ee26e820d26dd36314fdac124905f60e0b49d520b43bcdb4a4996
3
+ size 195184466
single_transformer_blocks_28.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:29ebeece5f673318cb58aa510ddaf31f84cbb6b8eefab0111ea37b906cee6d98
3
+ size 195372473
single_transformer_blocks_29.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98f8efbfb36cc68635bccedb8a44b2064b2f2387ae1178445d32c4d55c440ae1
3
+ size 195196343
single_transformer_blocks_3.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:776aa35aaf09f725bc1fcd0b8e8b40c3d3b327c5260ef9ee9f179e6026224350
3
+ size 192144267
single_transformer_blocks_30.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8d17aa12a5524667899187c391d6fbd69a4aa9f6b804595edc6d50214fdf5135
3
+ size 195686128
single_transformer_blocks_31.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21c4a84661f1cbe4a6d072191138348e9b6fb3f9e02f462de41331dc10749e38
3
+ size 195846674
single_transformer_blocks_32.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0415b6bda45d0341868833db84562216826d1845877d9d0cbc2d8691046d3962
3
+ size 195802375
single_transformer_blocks_33.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8eb4bd5572e3dff991278a09472023e5b6ba67db10a9c541f8d0355e54518e39
3
+ size 195852599
single_transformer_blocks_34.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36555661599e5a73f572910033d00e97cd0f0198f180d621ba8396e54e4feacd
3
+ size 196141180
single_transformer_blocks_35.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0bf7cd21d43bb94e0f01d9e79c95087005551bb2cf3785c00ef3a5de21fa8e06
3
+ size 196399943
single_transformer_blocks_36.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b7954690700b34b5e0b6dc787d505139bd5c9807b0b1bbd3a1301da948b8871a
3
+ size 194730251
single_transformer_blocks_37.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2707bed907ccb6fdd138919495fd7bc27d692e1235408dba0324502f0197da0e
3
+ size 196580291
single_transformer_blocks_4.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fc9b2bc71b95fc000060ce8f46f8c68a8399d418e3e0d065f01ce25269c9e6a
3
+ size 192202896
single_transformer_blocks_5.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa4f5da1a6f4166a60bc3c4bbde255edd9d5be193062d2f08685416590831f93
3
+ size 192384671
single_transformer_blocks_6.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16c97740663efc8ce21cad7298f23c0bddf345226ef9645ad5b28a40fc534684
3
+ size 192512824
single_transformer_blocks_7.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:795195a048e200be26b7cf6fc12e13fa59eb362a8643d9b31b2c459d07f8b0b1
3
+ size 192615572
single_transformer_blocks_8.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:452107e66a45d7b36a6a66e613a0baf1e022f1d46af6ea804d2d96b7370f5b45
3
+ size 192850028
single_transformer_blocks_9.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:427be4b0f48177122279267ec31d8f39a911eb943b3b9e3e7e0bb43c5ac869a2
3
+ size 192997419
transformer_blocks_0.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:05ea5daf20aa16d2af261ef3ac03b393265e69aad074a67a850d8a807f5b3de6
3
+ size 471260158
transformer_blocks_1.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e96635ed5c9b7c3532ac3e3779b03ff77291bff990d0c9a0f6db5aa7963036e4
3
+ size 471606797
transformer_blocks_10.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0df4a60d3adafc84149f2a38b0d79ef580366b40aa996a6c0ab951d1780ae92d
3
+ size 463548745
transformer_blocks_11.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38155feefbd2967ddf3130556fa5b2c553c093523932880a5857cd26f21fe3d2
3
+ size 462869820
transformer_blocks_12.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1fad86f3c500292754e8e7e8d7d2c0b3a4751675126ab6dbb0a5f941a914fb2
3
+ size 462838791
transformer_blocks_13.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7126d88b38a8bb18a1f9f2303603fed71519b71ffc7d621283252f4ff8337200
3
+ size 463891204
transformer_blocks_14.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc4f018794e7b728d816c9a45bcb7d1ceb5eb76c5c0df38bd9f95b0c7cdacb87
3
+ size 462471841
transformer_blocks_15.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40081bea75a312a8deb18876c1cfa3144cd3915143edc8e1d61a9bf9fd597ccf
3
+ size 461519724
transformer_blocks_16.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84e7852f8e201cf7585366cd3b160e3fe3169d7d49bf12621dc9aa859e13f094
3
+ size 461572890