Expand description
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 │
│ │
└─────────────────────────────────────────────────────────────┘Modules§
- prelude
- Prelude for common imports
Structs§
- Precision
Capabilities - Hardware precision capabilities
- Precision
Profile - A precision profile defining step-to-precision mapping rules
- Precision
Schedule - Complete precision schedule for a generation
- Precision
Transition - A precision transition with blending information
- Schedule
Config - Configuration for schedule generation
- Step
Precision - Precision assignment for a single step
- Transition
Planner - Transition planner for optimizing precision changes
Enums§
- Adaptive
Error - Errors that can occur during adaptive precision operations
- Precision
- Precision levels for inference
- Profile
Preset - Preset profiles for common use cases
- Transition
Strategy - Strategy for transitioning between precision levels
Functions§
- quick_
schedule - Quick schedule generation for common cases
Type Aliases§
- Result
- Result type for adaptive precision operations