LeanQuant commited on
Commit
3bea9e8
·
verified ·
1 Parent(s): 6c96444

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 +76 -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,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - black-forest-labs/FLUX.1-Fill-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-Fill-dev`
14
+
15
+ This is a **losslessly compressed** version of [`black-forest-labs/FLUX.1-Fill-dev`](https://huggingface.co/black-forest-labs/FLUX.1-Fill-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 package.
38
+
39
+ ```bash
40
+ pip install -U diffusers
41
+ ```
42
+
43
+ 3. To use the DFloat11 model, run the following example code in Python:
44
+ ```python
45
+ import torch
46
+ from diffusers import FluxFillPipeline
47
+ from diffusers.utils import load_image
48
+ from dfloat11 import DFloat11Model
49
+
50
+ image = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup.png")
51
+ mask = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup_mask.png")
52
+
53
+ pipe = FluxFillPipeline.from_pretrained("black-forest-labs/FLUX.1-Fill-dev", torch_dtype=torch.bfloat16)
54
+ pipe.enable_model_cpu_offload()
55
+
56
+ DFloat11Model.from_pretrained('DFloat11/FLUX.1-Fill-dev-DF11', device='cpu', bfloat16_model=pipe.transformer)
57
+
58
+ image = pipe(
59
+ prompt="a white paper cup",
60
+ image=image,
61
+ mask_image=mask,
62
+ height=1632,
63
+ width=1232,
64
+ guidance_scale=30,
65
+ num_inference_steps=50,
66
+ max_sequence_length=512,
67
+ generator=torch.Generator("cpu").manual_seed(0)
68
+ ).images[0]
69
+ image.save(f"flux-fill-dev.png")
70
+ ```
71
+
72
+ ### 📄 Learn More
73
+
74
+ * **Paper**: [70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float](https://arxiv.org/abs/2504.11651)
75
+ * **GitHub**: [https://github.com/LeanModels/DFloat11](https://github.com/LeanModels/DFloat11)
76
+ * **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:aaaef785df5c54125effff5a207a00f4d18e9b404f9c55124258ac5772c76cec
3
+ size 130218256
single_transformer_blocks_0.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:78e54c23a2ae63cc8576e96cd09937523cdfc3b4324b2c4a8f4da80e919d4aa3
3
+ size 191950290
single_transformer_blocks_1.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee077a6adb802d258cb185a1ce7a006b6147c63af6afbc1df30fbb2d906051d0
3
+ size 192032570
single_transformer_blocks_10.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3003875315511ec6e568e6eed8d0cd41b3fbab37d8540f6e6ed6e7fa4b195efc
3
+ size 193196648
single_transformer_blocks_11.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:478719e140a9b97339caa44a354ae608219fb5680897bbf0d399438a55357a99
3
+ size 193442804
single_transformer_blocks_12.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:719faa7314daa6676d0d3813dbc632764437c1206a2ab9f2fe48cce3aa11d645
3
+ size 193637578
single_transformer_blocks_13.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:568cacff62a00238b6e2ea0deca53134eb5ab19b4c9900cf141275a768029b33
3
+ size 193654109
single_transformer_blocks_14.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b502810b7b0ad27026b13a45726f15461d72cffbad9aca7c5be3ef292e7f66ba
3
+ size 193639989
single_transformer_blocks_15.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f30b170e851457c747be801fb8b5e151b516c25309469b2508b878ce22e0ac1b
3
+ size 193578930
single_transformer_blocks_16.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9b89fe43b2433614028edfd0be8b46ebf60520b61ce7d76a6730355ab23a08a
3
+ size 193591674
single_transformer_blocks_17.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50472970ef7f7dde5b5fca0c752ca7ab681c9289cc0d5a6cc87461215cdda4e6
3
+ size 193717106
single_transformer_blocks_18.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:757b08253ce136d8ffbea338fd5ec9afe48f498909272fc1c350098e79287eaa
3
+ size 193796268
single_transformer_blocks_19.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7df309537c322c7e523f5313f34ac0bc99676889b0334f149f442eb3d31781e8
3
+ size 193798310
single_transformer_blocks_2.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:048b2135ffc4bb5f61851b85afdc6b58cbe87f1cddcc5fc9bd470cb557a41a8a
3
+ size 192081102
single_transformer_blocks_20.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e61562043f56993cd2544e7e7d4af6dcdce5e9487cff60c21b87afe2140195c5
3
+ size 193859239
single_transformer_blocks_21.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4e8f413525d5d9f9dd05bce539932e28cd7e634df01c6b621893c4737ecef6d
3
+ size 194102778
single_transformer_blocks_22.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e706308713e4053241b68c0f9ae59e9a953afb0f244c94f2460934d26465de3c
3
+ size 194219114
single_transformer_blocks_23.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2d5633a1a884c0b3539bffd137004171faf05b95934bd464f050a59a93536ca
3
+ size 194441399
single_transformer_blocks_24.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a34576fdd154ae1a675ba76fbc1461b1070daa43b9904300a9997f8ef1bf9ae
3
+ size 194486321
single_transformer_blocks_25.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73b3b6714c3f6ac6ffb8e2b0d8c97e4ee707ee63e3d3fa886a169cf0f9f6e031
3
+ size 194759131
single_transformer_blocks_26.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6b49ff0480094f09430e9be119e8275e66b580b5427b653b5eee2520c93bf01
3
+ size 194834617
single_transformer_blocks_27.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87dd9c74adecb6fa0b57c6636bbe6d578de41a783095d275db9b87cb31974f0d
3
+ size 195187503
single_transformer_blocks_28.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef7cd1859a6e1114cd9873367710b0b6c894a1008d1e3bfb7cd7ba0885448c43
3
+ size 195325976
single_transformer_blocks_29.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dd568b3f4b1c785345cbabae95201922c511e5a729f5bdb4c93e0d4fa416ef28
3
+ size 195146883
single_transformer_blocks_3.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b745aa87f3dad390a284625a9c2ac367ba7af45343119b0ad6e39681bce651e
3
+ size 192152307
single_transformer_blocks_30.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24c6d7ce18e01d1f622f1a87637d0400a5a094b9d7bd79c25995b6da2d434d94
3
+ size 195638293
single_transformer_blocks_31.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18c085b67575e6097aa9ec21f71524400d32e8ef10c1907ce629f3961889e369
3
+ size 195997029
single_transformer_blocks_32.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf257bee5b8c9e2b129df255fbd4d902d566ef2ecaea64170cea5206772c4c73
3
+ size 195768043
single_transformer_blocks_33.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16ef4fa008fc0cddcf9c13f9b54ba511f4be519a603104e86c40a57bf42cdd1e
3
+ size 195834226
single_transformer_blocks_34.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ffd9854dd53562924ab7f16211762ba52b80de902014a3f60b1694fb5d1283a
3
+ size 196103048
single_transformer_blocks_35.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62d2c2636cef5ce84e109976da5479bf2b38368b2e81b626ec92bff26e7cdf79
3
+ size 196405959
single_transformer_blocks_36.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd74e42536cb56d1aa97e0affe6d43af177ef0e917a1da92ded7495b0c65696f
3
+ size 194725378
single_transformer_blocks_37.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:733dfa5ea0be2683dd8f925d06db35d419eee4c0f0a2a11d3c00f0ff2d3155f2
3
+ size 196276550
single_transformer_blocks_4.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a6c4090f35b84ee01b7daddcac10eb0722fc316d53e7949add019091b5a27e0
3
+ size 192223052
single_transformer_blocks_5.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b52d29704cfc96c1fd97f20d264c6a84eada5a5ee5730bcbbcde0da8a7460f51
3
+ size 192401054
single_transformer_blocks_6.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c657892360bcc96a622eed7de7365794f4f0a0a3e8696b3295c751ae0bcaaf9
3
+ size 192542163
single_transformer_blocks_7.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:542b132783aed86af7177de9e668981acadff8ad4096e3c93cbb103789a13f57
3
+ size 192656504
single_transformer_blocks_8.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57f30441560bf3cb8be721f65182274b3f8641decbd8bf3350885926beecab62
3
+ size 192896903
single_transformer_blocks_9.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2f3dd15f08c3e9d650237d9fa1a055c68f1b8e5aaf21fb906f29665c1ed163c
3
+ size 193049490
transformer_blocks_0.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e240c2bea9dab594d88735b1c93723994bf787259b79211402157d4020a5322f
3
+ size 470294552
transformer_blocks_1.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7db52ad05ac5724f1222c1c69cf264a8e82266733ac8345fc53402e23419c616
3
+ size 470006107
transformer_blocks_10.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a1ce14c442d399a3024e9941c6ad6f3b43808f6bc07802c3ac088122cb15085
3
+ size 463494611
transformer_blocks_11.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f2865bcc891d0e0a46ea3b968cba2f083ed13102bd058a3780e59184fdbdee0
3
+ size 462819989
transformer_blocks_12.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:306a7cec25df4131c0cd01f2224184efe903c7bdd4dad418f614868f95937e88
3
+ size 462807825
transformer_blocks_13.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94b9318f1b1926feb78d32c9242f1e09864093a41ddc905b6a0a3690dc8ab4e9
3
+ size 463815821
transformer_blocks_14.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2ba673380d83b10e49f564f681d8ad506a11a56d86410abb52863e913ccbc64e
3
+ size 462373271
transformer_blocks_15.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dad2ff1429fd9a25ecde66b450300401f1a191ee14953b7660857b90ab2b40c0
3
+ size 461436473
transformer_blocks_16.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fcc5a77325282d8d75d1cbd95a26167eef538eb02f6689c13bb85d43d5204ca6
3
+ size 461527874