Instructions to use wfen/Cosmos3-Nano-FP8-Blockwise with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use wfen/Cosmos3-Nano-FP8-Blockwise with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("wfen/Cosmos3-Nano-FP8-Blockwise", torch_dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
File size: 1,164 Bytes
9bf5d6a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | {
"recipe": "fp8_blockwise_mixed",
"weight_only": true,
"quant_lmhead": false,
"mixed_precision": {
"quantized": [
"mlp.*",
"mlp_moe_gen.*"
],
"bf16_kept": [
"self_attn.*"
],
"n_quantized": 216
},
"scale_layout": {
"granularity": "blockwise-128x128",
"block_sizes": {
"rows": 128,
"cols": 128
},
"n_total_weight": 802,
"n_quantized_weight": 216,
"n_scale": 432,
"total_scale_elements": 625568,
"scale_overhead_pct": 0.0046,
"example_shapes": {
"12288x4096": {
"weight_shape": [
12288,
4096
],
"amax_shape": [
96,
1,
32,
1
],
"module_example": "layers.0.mlp.gate_proj"
},
"4096x12288": {
"weight_shape": [
4096,
12288
],
"amax_shape": [
32,
1,
96,
1
],
"module_example": "layers.0.mlp.down_proj"
}
}
},
"loader": "from_config + restore_from_modelopt_state + safetensors load_state_dict",
"sidecar": "transformer/modelopt_state.pt"
}
|