Skip to main content

Crate haagenti_adaptive

Crate haagenti_adaptive 

Source
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§

PrecisionCapabilities
Hardware precision capabilities
PrecisionProfile
A precision profile defining step-to-precision mapping rules
PrecisionSchedule
Complete precision schedule for a generation
PrecisionTransition
A precision transition with blending information
ScheduleConfig
Configuration for schedule generation
StepPrecision
Precision assignment for a single step
TransitionPlanner
Transition planner for optimizing precision changes

Enums§

AdaptiveError
Errors that can occur during adaptive precision operations
Precision
Precision levels for inference
ProfilePreset
Preset profiles for common use cases
TransitionStrategy
Strategy for transitioning between precision levels

Functions§

quick_schedule
Quick schedule generation for common cases

Type Aliases§

Result
Result type for adaptive precision operations