LeanQuant commited on
Commit
bbd8d9a
·
verified ·
1 Parent(s): ca256d8

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 +78 -0
  2. config.json +36 -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,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - black-forest-labs/FLUX.1-Depth-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-Depth-dev`
14
+
15
+ This is a **losslessly compressed** version of [`black-forest-labs/FLUX.1-Depth-dev`](https://huggingface.co/black-forest-labs/FLUX.1-Depth-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 or upgrade the DFloat11 pip package *(installs the CUDA kernel automatically; requires a CUDA-compatible GPU and PyTorch installed)*:
30
+
31
+ ```bash
32
+ pip install -U dfloat11[cuda12]
33
+ # or if you have CUDA version 11:
34
+ # pip install -U dfloat11[cuda11]
35
+ ```
36
+
37
+ 2. Install or upgrade the diffusers and image_gen_aux packages.
38
+
39
+ ```bash
40
+ pip install -U diffusers
41
+ pip install git+https://github.com/asomoza/image_gen_aux.git
42
+ ```
43
+
44
+ 3. To use the DFloat11 model, run the following example code in Python:
45
+ ```python
46
+ import torch
47
+ from diffusers import FluxControlPipeline
48
+ from diffusers.utils import load_image
49
+ from image_gen_aux import DepthPreprocessor
50
+ from dfloat11 import DFloat11Model
51
+
52
+ pipe = FluxControlPipeline.from_pretrained("black-forest-labs/FLUX.1-Depth-dev", torch_dtype=torch.bfloat16)
53
+
54
+ DFloat11Model.from_pretrained('DFloat11/FLUX.1-Depth-dev-DF11', device='cpu', bfloat16_model=pipe.transformer)
55
+
56
+ prompt = "A robot made of exotic candies and chocolates of different kinds. The background is filled with confetti and celebratory gifts."
57
+ control_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/robot.png")
58
+
59
+ processor = DepthPreprocessor.from_pretrained("LiheYoung/depth-anything-large-hf")
60
+ control_image = processor(control_image)[0].convert("RGB")
61
+
62
+ image = pipe(
63
+ prompt=prompt,
64
+ control_image=control_image,
65
+ height=1024,
66
+ width=1024,
67
+ num_inference_steps=30,
68
+ guidance_scale=10.0,
69
+ generator=torch.Generator().manual_seed(42),
70
+ ).images[0]
71
+ image.save("output.png")
72
+ ```
73
+
74
+ ### 📄 Learn More
75
+
76
+ * **Paper**: [70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float](https://arxiv.org/abs/2504.11651)
77
+ * **GitHub**: [https://github.com/LeanModels/DFloat11](https://github.com/LeanModels/DFloat11)
78
+ * **HuggingFace**: [https://huggingface.co/DFloat11](https://huggingface.co/DFloat11)
config.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b4df65d350d1ab54caf7b4e62e8d81ca2e65d5a292e3548155c83bda5445569
3
+ size 128645392
single_transformer_blocks_0.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:afc9ab58e6c88e3dcab0864210eb5cda7c1d42cec608c1819935e8705fce40ec
3
+ size 191948604
single_transformer_blocks_1.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b00aefd19e2774699843afd0d0573bf20ee9828d74e0c97667a8f944b9887ae4
3
+ size 192027003
single_transformer_blocks_10.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f3c4827e46e33de768db6cf7368ea0fbbeb621a4e4c584dfff329c09da39e6d
3
+ size 193123170
single_transformer_blocks_11.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1488c01add77319b8ec5cfe01eca11f1490ed99062408c4cc7769086dfab915
3
+ size 193352236
single_transformer_blocks_12.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c11390ee85cfcaf04228fdb3c5036ef0128d077cfa69cdba87b13131af7b1a28
3
+ size 193526328
single_transformer_blocks_13.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f2d5f741a838bb145eed1204691a22e6e9f0c47fccf89ed9e9b2c369bb8acf3
3
+ size 193551776
single_transformer_blocks_14.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ae682484c0427fbae817589246e696f8656f418e0f3482cc4775ff55047e822
3
+ size 193547458
single_transformer_blocks_15.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:88c18fad68bbbd1dacb005ce1b5104e3b5e088d38621a309eb31d7324f6fed96
3
+ size 193506293
single_transformer_blocks_16.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:347977d45be1af6b5a5b745de4c5647a3ddba85b9185fbf9ee1ab4016934b12d
3
+ size 193535926
single_transformer_blocks_17.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9863d9c85da586b6c980a83e50cbc667e04706b99ecad952c9eb1c6b978234be
3
+ size 193659786
single_transformer_blocks_18.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96d53c6f1994e1c04ec013fc69e0fccb9a99abedbc30754a08b24c378cdc9e42
3
+ size 193739163
single_transformer_blocks_19.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6ff1b22a7974a70f884d9f60a78aaa3c70796de0cb21612e4a29a1025536aba8
3
+ size 193743584
single_transformer_blocks_2.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8c63ed1d26d0b4a14252cc2b7b6967b86f83986d5fd3e02c92663e0be713e8c
3
+ size 192070082
single_transformer_blocks_20.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b8d9dad9949bbfa15bc2766a4e8e1912cb74e6bdbbf29501d21c600f57dc5b3
3
+ size 193811348
single_transformer_blocks_21.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:da63fcaa9b8bab3cce86b51332b60f2b3a8ccb153813baaf2afa0786c51ce00d
3
+ size 194046752
single_transformer_blocks_22.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a34fbb7ff5a67d2146a2c7ea29044ba03a9c41d4df7893f5834f67e1744c7ee
3
+ size 194181450
single_transformer_blocks_23.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf62c8f56a4b5a1430444257536e4938e0df3b3e887648e5e9e0ef4805a3d925
3
+ size 194412210
single_transformer_blocks_24.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:435167e886b8fb0869cccef6a8c3343f47ed7eab175e6188493af3ddfff9fd53
3
+ size 194459449
single_transformer_blocks_25.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef57040dc1d08d7d6e16760ca6b27a346b240315cb02b58d081de522db62d3fd
3
+ size 194751947
single_transformer_blocks_26.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccf3e343743006adb0e7a01a5ea64a7538df5c63c6061949a5700e2750698e30
3
+ size 194831942
single_transformer_blocks_27.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:387ccf9a7127487de2bae9e6586845d70867b46df6c87d410cfc949fe6d37f97
3
+ size 195169548
single_transformer_blocks_28.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:344f9695368a8b5fb3598eebc96b5cb11e781bdbb2f5835ac19ee29178ca4fba
3
+ size 195356510
single_transformer_blocks_29.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4c7c5d21c116f5eff99382ddc03d7edd232fc62dc5c5b42c9f433eb4b2f2c67
3
+ size 195175157
single_transformer_blocks_3.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ea09e0089329a648041efb8a2345e16f4e8604f5d46878cb1637304ea69e5e01
3
+ size 192139651
single_transformer_blocks_30.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d42b07bf625b55dfa1ad363d0cdb2cb9a17f708bb208aff5c751060732732798
3
+ size 195667317
single_transformer_blocks_31.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:120bee28fdf26c26b42d0d8408edcdafb6585bc0d7d6db8f309853acb548e7c2
3
+ size 195825362
single_transformer_blocks_32.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fcbf8824c0f9e9018940a4849357500b15901c595ce796ce57aa694e03a0fb17
3
+ size 195790676
single_transformer_blocks_33.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18ee26d812b760206d12c69a482fa878cba0e8e9d05e56e455af50ec70819713
3
+ size 195840725
single_transformer_blocks_34.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e7d529fc7590f75e14287f269930ed840ab8d32f974e7fc91b67edf022507687
3
+ size 196144897
single_transformer_blocks_35.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dd55b04c02039c546c4bff21fa7496f46671152923c8cbfc35fb85c7de90a65c
3
+ size 196399524
single_transformer_blocks_36.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b41906a37222385ce98900c088c615502297f6b2dc900fa34b0bdd83e36a1007
3
+ size 194745315
single_transformer_blocks_37.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94b456f3ae9175bb9db5f20f42b8bb5fc4ae71df13300ecabaa0de662f25b538
3
+ size 196559910
single_transformer_blocks_4.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d007287f64574c026dbcebe3b59bf882d57efbca45a6c5751216217947a4daf7
3
+ size 192200417
single_transformer_blocks_5.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d72c9d3c4615dadd892dd63cd8ceaa63c67e7b1191ef24f40ee9231756d09c8
3
+ size 192378339
single_transformer_blocks_6.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:337966f48b1a45630a1133a8ff04abc21d59d3ace23f0885bcac21dcd145d2f2
3
+ size 192506358
single_transformer_blocks_7.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9dc9e4ff238d01e3902b8a5f76c0c094e45945383cc4652f79d16bc4f53dae06
3
+ size 192608194
single_transformer_blocks_8.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be0ee7fc72834ecfcde68cfd858e4db920600819065045512c2c8bdd461dc35d
3
+ size 192845409
single_transformer_blocks_9.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b781fe82edc242d54d7d7cc3dffec738b8b79880af6071aa4030a5720a03f7d4
3
+ size 192987067
transformer_blocks_0.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4841f9deed2cdaa273464c94e8df64e7a1e13228d8607c7fd856f22176e8cf4
3
+ size 471041227
transformer_blocks_1.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9801aba4e32c188a2a90521b1c7d7e4af79401f599002be3628743c3fb59319c
3
+ size 471567461
transformer_blocks_10.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0ae1edd0aa833627c6f9d42b14fbd100ebf5df46548bdde4355af402ab63abf2
3
+ size 463515992
transformer_blocks_11.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2deedf1ff0938b135dea4ae55bd6b807284e173ed39ccd4f75b196d252a9690
3
+ size 462852203
transformer_blocks_12.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:86e68ca62c3573b45afabdd8fbc5c91764c8841da4a35e64ef96b62a85240af7
3
+ size 462791241
transformer_blocks_13.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:31a1150db3f9d1a06525897c6116a49fc6b36fa13c0b9d458d30c7ce84ec9036
3
+ size 463836314
transformer_blocks_14.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd0c0cffa24b9efe0b5cf9fdd1b1f8c6e97066f3dbb2b2d2ea1c458de60899c1
3
+ size 462442680
transformer_blocks_15.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c23d42db1716c401f9879ce71ecf27fa451f2fe2608c0a569cdf60dc0b477b34
3
+ size 461513699
transformer_blocks_16.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2add71d854ad8c68fca57b994ec8da857b3e72d9a8f793e6549a43a1da21458a
3
+ size 461569810