Skip to content

Problem with ToCa Pipeline #1

@yiming-l21

Description

@yiming-l21

Description

When running sampling with cache enabled (e.g. --mode ToCa), the program crashes at the very beginning with:

File ".../flux/math.py", line 18, in attention
    cache_dic["attn_map"][-1][current["stream"]][current["layer"]]["total"] = score
KeyError: 38

Before the crash, debug prints show that current["stream"] == "single_stream" and current["layer"] reaches 38 (and later can be 19..56 depending on how it’s set).

Reproduction

Run sampling with cache enabled (example):

  • model: flux-dev
  • mode: ToCa
  • typical args: --num_steps 50 --interval 10 --first_enhance 3 (exact args don’t matter; crash happens immediately)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions