Skip to content

downloads_required misses load_components.pretrained_model_name_or_path overrides #981

Closed

Description

@dkackman

What

downloads_required (dw/plan.py) misses a per-component repo override. _collect_sources reads only from_pretrained_arguments.model_name, loras[].model_name and single-file URLs. A modular pipeline step that sets load_components.pretrained_model_name_or_path (a string, or a dict keyed by component name with an optional default) pulls that repo mid-run while validate_workflow reports it as not needed.

Diffusers' load_components honours that override per component (ComponentSpec.load merges the passed loading fields over the spec), and dw/quantized_cache.py already keys the SDNQ cache on it (_SPEC_FIELDS). The plan is the one place that does not know about it.

Split out of #980 (stage C), where this was found. It is generic, needs no model knowledge, and is correct for any workflow.

Scope

  • _collect_sources also walks load_components.pretrained_model_name_or_path: string form, dict form, the default key. Dedupe against model_name.
  • Tests: the three forms, dedupe, and unchanged output when the key is absent.
  • Docs: the downloads_required row in docs/ARCHITECTURE.md.
  • Deploy: server restart.

Acceptance

validate_workflow on an inline modular workflow with load_components.pretrained_model_name_or_path: {"transformer_ref": "<other repo>"} lists that repo in plan.downloads_required, with size, next to the base model_name. Without the override the list is unchanged. A dict holding only default lists that repo.

Known limit

The base repo is still listed whole. The plan cannot subtract the subfolder the override replaces, so a box that never pulled the base transformer_ref will still see it as required. Acceptable: downloads_required is a floor, not a byte count.

Activity

  1. dkackman commented on Oct 25, 2026

    @dkackman
    OwnerAuthor

    triage: work — self-contained dw/plan.py _collect_sources change (not on develop yet: no load_components handling in plan.py). Widens an existing collector; adds no task or validate rule. (claude-opus-5-5 via anthropic)

  2. added a commit that references this issue on Oct 25, 2026
  3. dkackman commented on Oct 25, 2026

    @dkackman
    OwnerAuthor

    Fixed by claude-sonnet-5-5 (anthropic) in b80dec7 on develop; deployed to lem at 04:10 (server restarted, healthy).

    What a consumer now sees: validate_workflow on a modular step with load_components.pretrained_model_name_or_path as a string, as a dict keyed by component name, or as a dict holding only default lists each of those repos in plan.downloads_required, with size, after the base model_name. A repo that is also the model_name is listed once. With no such key the list is unchanged. Before, those repos were absent from the list and were pulled mid-run.

    Known limit, as scoped in the issue: the base repo is still listed whole. The override's replaced subfolder is not subtracted.

    Tests are in tests/test_plan.py (test_a_load_components_repo_override_is_listed: string, dict, default, dedupe, key absent). I added a "Download sources" row to docs/ARCHITECTURE.md; there was no separate downloads_required row to extend. No regression case proposed.

  4. dkackman commented on Oct 25, 2026

    @dkackman
    OwnerAuthor

    Architecture review queued by the loop driver: this hand-off changed dw/ or dw_mcp/ on develop (68ae280a61..b80dec772a: dw/plan.py). The reviewer checks it against docs/ARCHITECTURE.md before the tester verifies.

  5. dkackman commented on Oct 25, 2026

    @dkackman
    OwnerAuthor

    Architecture review: pass (claude-opus-5-5 via anthropic).

    Read git diff 68ae280a..b80dec77 (the #981 commit): dw/plan.py (_collect_component_overrides, two key constants, one call in _collect_sources), tests/test_plan.py, docs/ARCHITECTURE.md. Checked against stage C item 3:

    • Second owner: none. dw/quantized_cache.py (map row "Quantized component cache") owns the per-component merge at load time (_SPEC_FIELDS) for its cache key. The plan only reads the declared override values out of the workflow tree to list repos, and that listing is the plan's own rule.
    • Build vs. buy: none. This is a walk of dw's own workflow JSON, which no dependency does.
    • The map: the new "Download sources" row names _collect_sources and _collect_component_overrides. Its test tests/test_plan.py::TestDownloadsRequired::test_a_load_components_repo_override_is_listed exists.
    • Context: the rationale and the known limit are in the function docstring. No CLAUDE.md changed.

    Nothing waived. This issue has no arch-approved label and needed none. It goes to the tester for MCP verify.

  6. dkackman commented on Oct 25, 2026

    @dkackman
    OwnerAuthor

    Verified by claude-opus-5-5 (anthropic) against develop @ b80dec7 on lem, all over MCP validate_workflow (workspace default). Each call used an inline single-step ModularPipeline workflow with base model_name: MiniMaxAI/MiniMax-Music3, which this box already has cached.

    load_components.pretrained_model_name_or_path plan.downloads_required
    key absent (control) [], the same as before the fix
    {"transformer": "stabilityai/stable-diffusion-2-1"} that repo is listed
    {"default": "openai/whisper-tiny"} (only default) openai/whisper-tiny, gb: 0.6, gated: false
    "hf-internal-testing/tiny-stable-diffusion-pipe" (string form) that repo, gb: 0.0
    dedupe: model_name: stabilityai/stable-diffusion-2-1 with {"transformer": "openai/whisper-tiny", "vae": "openai/whisper-tiny", "default": "stabilityai/stable-diffusion-2-1"} two entries: the base repo first, then openai/whisper-tiny once

    stabilityai/stable-diffusion-2-1 comes back with gb/gated/access_blocked: null. It does that in the dedupe call too, where it is the base model_name, so the nulls come from the size lookup for that repo, not from the override path. Every override repo that has a size gets one.

    This matches expected:. Closing. No regression case added: the dw pytest suite covers it (test_plan.py).

  7. added
    status:verifiedTester confirmed the fix via a real MCP call
    and removed on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions