Python class
FirstBlockCache
FirstBlockCache
class max.pipelines.modeling.base.FirstBlockCache(dtype, device)
Bases: object
Standalone FirstBlockCache module.
Provides state allocation for FBCache. The conditional execution
helpers (can_use_fbcache, fbcache_conditional_execution)
remain in cache_mixin.py since they are used directly inside
transformer _forward_fbcache methods.
create_state()
create_state(batch_size, seq_len, residual_dim, output_dim)
Allocate fresh per-request FirstBlockCache state tensors.
-
Parameters:
-
Return type:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!