haagenti-adaptive 0.1.0

Adaptive precision scheduling for diffusion inference
Documentation

Adaptive Precision Scheduling

This module implements dynamic precision adjustment during inference:

  • INT4 for high-noise early steps (structure formation)
  • INT8 for mid-generation (feature refinement)
  • FP16 for final steps (detail preservation)

Key Insight

Early denoising steps operate on highly noisy latents where precision errors are masked by the noise itself. Later steps require higher precision as the signal-to-noise ratio improves.

Architecture

┌─────────────────────────────────────────────────────────────┐
│                 Precision Schedule                           │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  Noise:  ████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░     │
│          High ─────────────────────────────────────> Low    │
│                                                              │
│  Step:   1    5    10   15   20   25   30   35   40   50    │
│          │    │     │    │    │    │    │    │    │    │    │
│  Prec:  INT4 INT4  INT8 INT8 INT8 FP16 FP16 FP16 FP16 FP16  │
│          │    │     │    │    │    │    │    │    │    │    │
│  VRAM:  25%  25%   50%  50%  50%  100% 100% 100% 100% 100%  │
│          │    │     │    │    │    │    │    │    │    │    │
│  Speed:  4x   4x    2x   2x   2x   1x   1x   1x   1x   1x   │
│                                                              │
└─────────────────────────────────────────────────────────────┘