Skip to content

validate_workflow passes cache type faster on FLUX.1-dev; run fails needing is_guidance_distilled #897

Closed

Description

@dkackman

Tool: validate_workflow vs run_workflow
Server: mps on mini-ai.lan, develop @ 0e73254
Filed by: claude-opus-5-5 via anthropic, while verifying #867 (case C-F444)

Repro

{"id":"flux-fb","seed":42,"steps":[{"name":"main","pipeline":{"configuration":{"component_type":"FluxPipeline","cache":{"type":"faster"}},"from_pretrained_arguments":{"model_name":"black-forest-labs/FLUX.1-dev","torch_dtype":"torch.bfloat16"},"arguments":{"prompt":"an apple","num_inference_steps":20,"width":512,"height":512,"guidance_scale":3.5}},"result":{"content_type":"image/jpeg","subfolder":"final"}}]}
  1. validate_workflow(workflow=<above>) returns valid: true, with no errors and no warnings.
  2. run_workflow(workflow=<above>, acknowledged_cost=true, workspace="regression-complete") (job eaa66f569193) returns failed after about 37 s:
    Step 'black-forest-labs/FLUX.1-dev': the faster cache failed (tuple index out of range). It assumes a cond/uncond batch of 2; a guidance-distilled model (FLUX.1-dev) needs cache.is_guidance_distilled: true

Expected

The runtime already knows the rule: FLUX.1-dev is guidance-distilled, and faster needs is_guidance_distilled: true. validate_workflow should report it, as an error or at least a warning, so the user isn't charged a model load to find out. Adding "is_guidance_distilled": true makes the run succeed (job 05804e87211d).

Note

A related gap: cache: {"type":"first_block"} validates clean on SD1.5 (UNet) and on Z-Image, then at run time only warns that it was "not applied" (jobs c91c3bee99cd, fb19b96cd5a7). It's worth considering in the same place: validate knows the component type.

Activity

  1. added
    target:mini-aiFound against a non-lem server (DW_TARGET=mini-ai); Don triages
    owner:donParked for human decision
    status:needs-approvalParked pending a written proposal + human approval
    and removed on Oct 14, 2026
  2. dkackman commented on Oct 14, 2026

    @dkackman
    OwnerAuthor

    triage: escalate — this asks for a new validate_workflow rule matrix (cache type × pipeline/model: faster on a guidance-distilled model, first_block on UNet and on transformers diffusers doesn't hook). #895's triage left the FLUX half out of scope because the engine can't tell a distilled model from a CFG one without putting model knowledge in engine code. That half needs a decision on where the rule lives (catalog/plugin vs engine). The first_block half is a new per-component-class check. Both need sign-off before a fix session builds them. Triage: claude-opus-5-5 / anthropic.

  3. dkackman commented on Oct 14, 2026

    @dkackman
    OwnerAuthor

    Approved (Don, 2026-10-14): option 1. No validate-time rule matrix.

    Scope:

    The first_block half is split out to #904.

  4. added
    status:plan-approvedDon approved the feature plan (Don only)
    and removed
    owner:donParked for human decision
    status:needs-approvalParked pending a written proposal + human approval
    status:plan-approvedDon approved the feature plan (Don only)
    on Oct 14, 2026
  5. dkackman commented on Oct 14, 2026

    @dkackman
    OwnerAuthor

    triage: work — Don's approved scope (option 1) is the whole job: in enable_cache_on_transformer (dw/pipeline_processors/components.py), infer is_guidance_distilled from the transformer's config.guidance_embeds when a FasterCacheConfig doesn't set it. Keep #895's message (0dcf45a) as the fallback. It isn't on develop yet. #904 is a separate validate/registry change and doesn't share code with this. Triage: claude-opus-5-5 / anthropic.

  6. added a commit that references this issue on Oct 14, 2026
  7. dkackman commented on Oct 14, 2026

    @dkackman
    OwnerAuthor

    Fixed on develop @ 5600482 (merge of fix/897-faster-cache-distilled). Not yet deployed: the driver deploys develop to mini-ai after this session.

    What changed: enable_cache_on_transformer (dw/pipeline_processors/components.py) now, for a FasterCacheConfig whose workflow did not set is_guidance_distilled, sets it True when the loaded transformer's config.guidance_embeds is True, and logs at info when it infers. An explicit workflow value (true or false) always wins; the caller passes whether the key was present. #895's IndexError→ValueError message remains the fallback. No model names in the engine. Unit tests in tests/test_pipeline_components.py cover infer / no-embeds / explicit-wins; ruff and the cache tests pass.

    To verify: the keyless repro in the issue (FLUX.1-dev, cache: {type: faster}, no is_guidance_distilled) should now succeed. Server log should show "Inferring FasterCache is_guidance_distilled=True".

    FLUX.1-schnell: its transformer has guidance_embeds: false, so nothing is inferred there. I haven't run it. By code reading, FluxPipeline only batches CFG when a negative prompt/true_cfg_scale>1 is given, so schnell likely hits the same batch-of-2 assumption; if the tester tries it and it fails, that case isn't covered by guidance_embeds and the user must set the flag. (Not tested here.)

    claude-sonnet-5-5 via anthropic.

  8. dkackman commented on Oct 14, 2026

    @dkackman
    OwnerAuthor

    Architecture review queued by the loop driver: this hand-off changed dw/ or dw_mcp/ on develop (c243b9945b..560048269d: dw/pipeline_processors/components.py dw/pipeline_processors/pipeline.py). The reviewer checks it against docs/ARCHITECTURE.md before the tester verifies.

  9. dkackman commented on Oct 14, 2026

    @dkackman
    OwnerAuthor

    Architecture review: pass. Read git diff c243b994..56004826 under dw/ and dw_mcp/, limited to #897's commit c23b610 (dw/pipeline_processors/components.py, dw/pipeline_processors/pipeline.py). Checked it against docs/ARCHITECTURE.md and item 3 of stage-c-guardrails.md.

    • Second owner: none. The inference sits in enable_cache_on_transformer, next to the existing FasterCache current_timestep_callback wiring. pipeline.py only passes whether the workflow set the key. Validation isn't touched, so this doesn't overlap the "Acceleration warnings" row (dw/acceleration_warnings.py).
    • Build vs. buy: none. It reads diffusers' own transformer.config.guidance_embeds and sets a field on diffusers' FasterCacheConfig.
    • Map: no new owner, so no row needed.
    • Context: the rationale is a code comment in the owning module. No CLAUDE.md change.

    No arch-approved label, so nothing was waived. Over to the tester for the mini-ai repro.

    Reviewer: claude-opus-5-5 via anthropic.

  10. dkackman commented on Oct 14, 2026

    @dkackman
    OwnerAuthor

    Verified on mps (mini-ai.lan), develop @ 29d4c4c. Tester: claude-opus-5-5 via anthropic.

    1. Repro as written (FLUX.1-dev, cache: {"type":"faster"}, no is_guidance_distilled, workspace regression-complete): validate_workflow is valid, and run_workflow (job 65b710355470) now succeeds. One image came out; manifest timing.cache.type: "faster", 20 passes, denoise 23.1 s.
    2. Adjacent: an explicit value wins. The same workflow with "is_guidance_distilled": false (job b4ffd1983493) fails with validate_workflow accepts cache type 'faster' on FluxPipeline (FLUX.1-dev); run fails in diffusers faster_cache with IndexError #895's fallback message, unchanged: the faster cache failed (tuple index out of range). It assumes a cond/uncond batch of 2; a guidance-distilled model (FLUX.1-dev) needs cache.is_guidance_distilled: true. Nothing was inferred over the explicit false.

    Not observable over MCP: the info line "Inferring FasterCache is_guidance_distilled=True" doesn't show up in get_job_events(kinds=["log","warning"]) for job 65b710355470. The events hold only workflow and file log lines, so I can't confirm it from here. That's not a blocker. The behavior it describes is confirmed.

    Not tried: FLUX.1-schnell (the hand-off's open question). Both outputs deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions