Skip to content

[BUG] Vendored gemma3n/gemma4 edits from #6473 not recorded in vendor patches/MANIFEST: re-vendoring restores the Accelerate import #6525

Done

Description

@Qubitium

Summary

tests/test_native_vendor_manifest.py is red on origin/main (c649fcb): 2 failed, 1 passed.

AssertionError: gemma3n/modeling_gemma3n.py changed without re-recording (run --record-patches)
generator.differences(tmp_path, REPO) == ['gemma3n/modeling_gemma3n.py', 'gemma4/modeling_gemma4.py']

Root cause

#6473 (Accelerate removal) hand-edited two vendored Transformers files:

-if is_accelerate_available():
-    from accelerate.hooks import add_hook_to_module
+from .....weight_loader import add_hook_to_module

in gptqmodel/models/ports/native/gemma3n/modeling_gemma3n.py and .../gemma4/modeling_gemma4.py. It did not record the edits as scripts/vendor_patches/{gemma3n,gemma4}.patch and did not update native/MANIFEST.json, which still pins both files as verbatim with the upstream sha256.

Impact

The generator is the source of truth for the vendored tree. The next vendor_transformers_ports.py --all --refresh (any re-vendor) silently reverts both files to from accelerate.hooks import add_hook_to_module. That reintroduces an Accelerate dependency into Gemma 3n / Gemma 4 that #6473 removed, against the "never depend on Accelerate" rule. The vendored-tree contract test is also red until fixed.

Fix

Run scripts/vendor_transformers_ports.py <transformers-5.23-src> <repo> --all --record-patches. It adds gemma3n.patch and gemma4.patch and moves both manifest entries to patched with the committed sha256. No other patch or manifest entry changes.

Environment

origin/main c649fcb, transformers 5.23.0, Python 3.14.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions