Skip to content

fix(ports): record #6473's gemma3n/gemma4 hand edits as vendor patches (#6525) - #6526

Merged
Qubitium merged 1 commit into
mainfrom
fix/vendor-manifest-gemma-6473
Dec 1, 2026
Merged

Qubitium merged 1 commit into
mainfrom
fix/vendor-manifest-gemma-6473

Conversation

@Qubitium

@Qubitium Qubitium commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #6525

#6473 hand-edited the vendored native/gemma3n/modeling_gemma3n.py and native/gemma4/modeling_gemma4.py (Accelerate hook import -> gptqmodel.weight_loader.add_hook_to_module) but did not record the edits as vendor patches or update native/MANIFEST.json. tests/test_native_vendor_manifest.py is red on main, and a re-vendor (--all --refresh) would restore from accelerate.hooks import add_hook_to_module in both families.

What Changed

  • Added scripts/vendor_patches/gemma3n.patch and scripts/vendor_patches/gemma4.patch, generated by the documented --record-patches flow.
  • native/MANIFEST.json: both files move from verbatim to patched with the committed sha256. No other entries changed.
  • No runtime code change: the vendored files themselves are untouched.

Tests

  • Unit tests executed and passed.
  • Not applicable (new test): the existing contract test tests/test_native_vendor_manifest.py is the regression and is red on main.
python scripts/vendor_transformers_ports.py <site-packages>/transformers . --all --record-patches
# -> {"patches": [..., "gemma3n", "gemma4", ...]}; git status: MANIFEST.json + 2 new patches only

# RED (origin/main c649fcb5f)
pytest -q tests/test_native_vendor_manifest.py
2 failed, 1 passed   # "gemma3n/modeling_gemma3n.py changed without re-recording"; differences == [gemma3n, gemma4]

# GREEN (this branch)
pytest -q tests/test_native_vendor_manifest.py
3 passed

Lint: uvx [email protected] check gptqmodel ... tests setup.py: All checks passed.
Environment: transformers 5.23.0 (installed wheel as generator source), Python 3.14.

Measured Impact

Not applicable: metadata-only change, no runtime behaviour change.

Model Support / Module Plan

Not applicable: no MODEL_MAP or definition changes.

AWQ onboarding safety

Not applicable.

Logic Flow Documentation

Not applicable: no control-flow change.

Review Requirements

  • Reviewed this PR.
  • Uses the project's documented --record-patches workflow.
  • No monkeypatching.
  • Minimal surface (2 patch files + 2 manifest entries).
  • Regressions considered: the record step verifies that regenerating from the patches reproduces every committed file before rewriting the manifest.

Kernel Accuracy Requirements

Not applicable.

Notes

Found by the release-readiness test sweep on origin/main c649fcb.

🤖 Generated with Claude Code

#6525)

#6473 replaced the Accelerate hook import in the vendored gemma3n and gemma4
modeling files with gptqmodel.weight_loader.add_hook_to_module without
recording the edit, so MANIFEST.json still pinned both files as verbatim and
a re-vendor would restore the Accelerate import. Re-record with
vendor_transformers_ports.py --all --record-patches.

Fixes #6525

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Qubitium
Qubitium marked this pull request as ready for review December 1, 2026 02:40
@Qubitium
Qubitium merged commit 8df3dcc into main Dec 1, 2026
6 checks passed
@Qubitium
Qubitium deleted the fix/vendor-manifest-gemma-6473 branch December 1, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant