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)
Description
When running sampling with cache enabled (e.g.
--mode ToCa), the program crashes at the very beginning with:Before the crash, debug prints show that
current["stream"] == "single_stream"andcurrent["layer"]reaches38(and later can be19..56depending on how it’s set).Reproduction
Run sampling with cache enabled (example):
flux-devToCa--num_steps 50 --interval 10 --first_enhance 3(exact args don’t matter; crash happens immediately)