|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +CKPT="black-forest-labs/FLUX.1-Kontext-dev" |
| 4 | +IMAGE="yarn-art-pikachu.png" |
| 5 | +PROMPT="Make Pikachu hold a sign that says 'Black Forest Labs is awesome', yarn art style, detailed, vibrant colors" |
| 6 | +CACHE_DIR="/fsx/sayak/.cache" |
| 7 | + |
| 8 | +# bfloat16 |
| 9 | +python run_benchmark.py \ |
| 10 | + --ckpt $CKPT --image $IMAGE --prompt "$PROMPT" \ |
| 11 | + --compile_export_mode disabled \ |
| 12 | + --disable_fused_projections \ |
| 13 | + --disable_channels_last \ |
| 14 | + --disable_fa3 \ |
| 15 | + --disable_quant \ |
| 16 | + --disable_inductor_tuning_flags \ |
| 17 | + --output-file bf16.png \ |
| 18 | + --num_inference_steps 28 \ |
| 19 | + --cache-dir $CACHE_DIR \ |
| 20 | + > bf16.txt 2>&1 |
| 21 | + |
| 22 | +# bfloat16 + torch.compile |
| 23 | +python run_benchmark.py \ |
| 24 | + --ckpt $CKPT --image $IMAGE --prompt "$PROMPT" \ |
| 25 | + --compile_export_mode compile \ |
| 26 | + --disable_fused_projections \ |
| 27 | + --disable_channels_last \ |
| 28 | + --disable_fa3 \ |
| 29 | + --disable_quant \ |
| 30 | + --disable_inductor_tuning_flags \ |
| 31 | + --output-file bf16_compile.png \ |
| 32 | + --num_inference_steps 28 \ |
| 33 | + --cache-dir $CACHE_DIR \ |
| 34 | + > bf16_compile.txt 2>&1 |
| 35 | + |
| 36 | +# bfloat16 + torch.compile + qkv projection |
| 37 | +python run_benchmark.py \ |
| 38 | + --ckpt $CKPT --image $IMAGE --prompt "$PROMPT" \ |
| 39 | + --compile_export_mode compile \ |
| 40 | + --disable_channels_last \ |
| 41 | + --disable_fa3 \ |
| 42 | + --disable_quant \ |
| 43 | + --disable_inductor_tuning_flags \ |
| 44 | + --output-file bf16_compile_qkv.png \ |
| 45 | + --num_inference_steps 28 \ |
| 46 | + --cache-dir $CACHE_DIR \ |
| 47 | + > bf16_compile_qkv.txt 2>&1 |
| 48 | + |
| 49 | +# bfloat16 + torch.compile + qkv projection + channels_last |
| 50 | +python run_benchmark.py \ |
| 51 | + --ckpt $CKPT --image $IMAGE --prompt "$PROMPT" \ |
| 52 | + --compile_export_mode compile \ |
| 53 | + --disable_fa3 \ |
| 54 | + --disable_quant \ |
| 55 | + --disable_inductor_tuning_flags \ |
| 56 | + --output-file bf16_compile_qkv_chan.png \ |
| 57 | + --num_inference_steps 28 \ |
| 58 | + --cache-dir $CACHE_DIR \ |
| 59 | + > bf16_compile_qkv_chan.txt 2>&1 |
| 60 | + |
| 61 | +# bfloat16 + torch.compile + qkv projection + channels_last + FA3 |
| 62 | +python run_benchmark.py \ |
| 63 | + --ckpt $CKPT --image $IMAGE --prompt "$PROMPT" \ |
| 64 | + --compile_export_mode compile \ |
| 65 | + --disable_quant \ |
| 66 | + --disable_inductor_tuning_flags \ |
| 67 | + --output-file bf16_compile_qkv_chan_fa3.png \ |
| 68 | + --num_inference_steps 28 \ |
| 69 | + --cache-dir $CACHE_DIR \ |
| 70 | + > bf16_compile_qkv_chan_fa3.txt 2>&1 |
| 71 | + |
| 72 | +# bfloat16 + torch.compile + qkv projection + channels_last + FA3 + float8 quant |
| 73 | +python run_benchmark.py \ |
| 74 | + --ckpt $CKPT --image $IMAGE --prompt "$PROMPT" \ |
| 75 | + --compile_export_mode compile \ |
| 76 | + --disable_inductor_tuning_flags \ |
| 77 | + --output-file bf16_compile_qkv_chan_fa3_quant.png \ |
| 78 | + --num_inference_steps 28 \ |
| 79 | + --cache-dir $CACHE_DIR \ |
| 80 | + > bf16_compile_qkv_chan_fa3_quant.txt 2>&1 |
| 81 | + |
| 82 | +# bfloat16 + torch.compile + qkv projection + channels_last + FA3 + float8 quant + inductor flags |
| 83 | +python run_benchmark.py \ |
| 84 | + --ckpt $CKPT --image $IMAGE --prompt "$PROMPT" \ |
| 85 | + --compile_export_mode compile \ |
| 86 | + --output-file bf16_compile_qkv_chan_fa3_quant_flags.png \ |
| 87 | + --num_inference_steps 28 \ |
| 88 | + --cache-dir $CACHE_DIR \ |
| 89 | + > bf16_compile_qkv_chan_fa3_quant_flags.txt 2>&1 |
| 90 | + |
| 91 | +# fully optimized (torch.export + AOTI to address cold start) |
| 92 | +python run_benchmark.py --ckpt $CKPT --image $IMAGE --prompt "$PROMPT" \ |
| 93 | + --output-file fully_optimized.png \ |
| 94 | + --num_inference_steps 28 \ |
| 95 | + --cache-dir $CACHE_DIR \ |
| 96 | + > fully_optimized.txt 2>&1 |
0 commit comments