IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Python class

TaylorSeer

TaylorSeer​

class max.pipelines.diffusion.TaylorSeer(max_order, dtype, device)

source

Bases: object

Standalone TaylorSeer caching module.

Compiles predict and update graphs at construction time and provides methods for the full TaylorSeer lifecycle: scheduling, prediction, factor updates, and state allocation.

Parameters:

compiled_predict()​

compiled_predict(factor_0, factor_1, factor_2, step_offset, max_order)

source

Run the compiled Taylor predict graph on eager tensors.

Parameters:

Return type:

Tensor

compiled_update()​

compiled_update(new_output, old_factor_0, old_factor_1, delta_step, max_order)

source

Run the compiled Taylor update graph on eager tensors.

Parameters:

Return type:

tuple[Tensor, Tensor, Tensor]

create_state()​

create_state(batch_size, seq_len, output_dim)

source

Allocate fresh per-request TaylorSeer state tensors.

Parameters:

  • batch_size (int)
  • seq_len (int)
  • output_dim (int)

Return type:

TaylorSeerState

should_skip()​

static should_skip(step, warmup_steps, cache_interval)

source

Return True when the full transformer pass can be skipped at step.

Parameters:

  • step (int)
  • warmup_steps (int)
  • cache_interval (int)

Return type:

bool