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
//! 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
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────┐
//! │ 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 │
//! │ │
//! └─────────────────────────────────────────────────────────────┘
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
/// Prelude for common imports