rd0-jinx 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. rd0_jinx-0.1.0/LICENSE +9 -0
  2. rd0_jinx-0.1.0/MANIFEST.in +6 -0
  3. rd0_jinx-0.1.0/PKG-INFO +108 -0
  4. rd0_jinx-0.1.0/README.md +75 -0
  5. rd0_jinx-0.1.0/examples/new_pr.json +102 -0
  6. rd0_jinx-0.1.0/examples/open_prs.jsonl +19 -0
  7. rd0_jinx-0.1.0/pyproject.toml +64 -0
  8. rd0_jinx-0.1.0/setup.cfg +4 -0
  9. rd0_jinx-0.1.0/src/rd0_jinx/__init__.py +6 -0
  10. rd0_jinx-0.1.0/src/rd0_jinx/action.py +110 -0
  11. rd0_jinx-0.1.0/src/rd0_jinx/agents.py +35 -0
  12. rd0_jinx-0.1.0/src/rd0_jinx/cli.py +119 -0
  13. rd0_jinx-0.1.0/src/rd0_jinx/data/templates.json +456 -0
  14. rd0_jinx-0.1.0/src/rd0_jinx/data/weights.json +61 -0
  15. rd0_jinx-0.1.0/src/rd0_jinx/data/weights_emb.json +65 -0
  16. rd0_jinx-0.1.0/src/rd0_jinx/embed.py +26 -0
  17. rd0_jinx-0.1.0/src/rd0_jinx/features.py +61 -0
  18. rd0_jinx-0.1.0/src/rd0_jinx/pr.py +110 -0
  19. rd0_jinx-0.1.0/src/rd0_jinx/py.typed +0 -0
  20. rd0_jinx-0.1.0/src/rd0_jinx/scorer.py +156 -0
  21. rd0_jinx-0.1.0/src/rd0_jinx/templates.py +107 -0
  22. rd0_jinx-0.1.0/src/rd0_jinx/text.py +81 -0
  23. rd0_jinx-0.1.0/src/rd0_jinx.egg-info/PKG-INFO +108 -0
  24. rd0_jinx-0.1.0/src/rd0_jinx.egg-info/SOURCES.txt +40 -0
  25. rd0_jinx-0.1.0/src/rd0_jinx.egg-info/dependency_links.txt +1 -0
  26. rd0_jinx-0.1.0/src/rd0_jinx.egg-info/entry_points.txt +2 -0
  27. rd0_jinx-0.1.0/src/rd0_jinx.egg-info/requires.txt +7 -0
  28. rd0_jinx-0.1.0/src/rd0_jinx.egg-info/top_level.txt +1 -0
  29. rd0_jinx-0.1.0/tests/conftest.py +37 -0
  30. rd0_jinx-0.1.0/tests/fixtures/aidev/README.md +3 -0
  31. rd0_jinx-0.1.0/tests/fixtures/aidev/cross_author_new.json +102 -0
  32. rd0_jinx-0.1.0/tests/fixtures/aidev/cross_author_queue.jsonl +19 -0
  33. rd0_jinx-0.1.0/tests/fixtures/aidev/expected.json +23 -0
  34. rd0_jinx-0.1.0/tests/fixtures/aidev/no_duplicate_new.json +366 -0
  35. rd0_jinx-0.1.0/tests/fixtures/aidev/no_duplicate_queue.jsonl +18 -0
  36. rd0_jinx-0.1.0/tests/fixtures/aidev/self_replacement_new.json +51 -0
  37. rd0_jinx-0.1.0/tests/fixtures/aidev/self_replacement_queue.jsonl +14 -0
  38. rd0_jinx-0.1.0/tests/test_action.py +36 -0
  39. rd0_jinx-0.1.0/tests/test_e2e_aidev.py +34 -0
  40. rd0_jinx-0.1.0/tests/test_pr.py +34 -0
  41. rd0_jinx-0.1.0/tests/test_scorer.py +82 -0
  42. rd0_jinx-0.1.0/tests/test_templates.py +23 -0
rd0_jinx-0.1.0/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Harshul Jain
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,6 @@
1
+ # The sdist ships the tests, so it must also ship what they read.
2
+ # conftest.py is not picked up by setuptools' sdist defaults, and the suite
3
+ # imports it as a module (pythonpath includes `tests`), so include it by name.
4
+ include tests/conftest.py
5
+ recursive-include tests/fixtures *.json *.jsonl *.md
6
+ recursive-include examples *.json *.jsonl
@@ -0,0 +1,108 @@
1
+ Metadata-Version: 2.4
2
+ Name: rd0-jinx
3
+ Version: 0.1.0
4
+ Summary: Jinx: duplicate pull-request warnings for coding-agent PRs. The first tool in rd0, a toolkit for review debt.
5
+ Author: Harshul Jain, Saurabh Yergattikar, Tanya Sah, Parv Khatri
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://rd0.ai
8
+ Project-URL: Source, https://github.com/harshuljain13/rd0-jinx
9
+ Project-URL: Issues, https://github.com/harshuljain13/rd0-jinx/issues
10
+ Project-URL: Changelog, https://github.com/harshuljain13/rd0-jinx/releases
11
+ Keywords: pull-request,duplicate-detection,code-review,review-debt,github-action,coding-agents,static-analysis
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Quality Assurance
22
+ Classifier: Topic :: Software Development :: Version Control :: Git
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.9
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Provides-Extra: embed
28
+ Requires-Dist: sentence-transformers>=2.2; extra == "embed"
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest; extra == "dev"
31
+ Requires-Dist: ruff; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ # rd0-jinx
35
+
36
+ **Find the pull request that already does this.**
37
+
38
+ Coding agents (Copilot, Codex, Devin, Claude Code, Cursor, Jules) open a lot of pull requests, and some of
39
+ them redo work that is already open. `rd0-jinx` checks a new PR against the open ones and, when it finds a
40
+ likely duplicate, tells you which PR it matches and why.
41
+
42
+ - Runs on CPU in about 6 ms per PR. No LLM, no API key, no network call.
43
+ - Explains every match: shared files, overlapping line ranges, identical added lines, the same linked issue.
44
+ - About 1.9 false alarms per 100 PRs that have no duplicate.
45
+
46
+ Full README, benchmark and papers: **https://github.com/harshuljain13/rd0-jinx**
47
+
48
+ ## Install
49
+
50
+ ```bash
51
+ pip install rd0-jinx # the `jinx` command
52
+ pip install "rd0-jinx[embed]" # optional local MiniLM text model (installs PyTorch)
53
+ ```
54
+
55
+ ## Use it
56
+
57
+ ```bash
58
+ jinx check new_pr.json --open-queue open_prs.jsonl --top 2
59
+ ```
60
+
61
+ ```text
62
+ PR #44134: checked 19 open PRs in 12 ms. 1 likely duplicate(s) (score >= 0.50).
63
+ DUPLICATE? #44110 score 1.00 refactor(tvp): use capture_outputs for output tracing
64
+ - one PR links to the other (#44110)
65
+ - shares 1 of 1 changed files (src/transformers/models/tvp/modeling_tvp.py)
66
+ - 100% of changed line ranges overlap
67
+ - 100% of added lines are identical
68
+ - similar title/description after removing agent template text (0.92)
69
+ ```
70
+
71
+ Input uses the GitHub API's JSON shape (`number`, `title`, `body`, `user.login`, `created_at`). Optional
72
+ fields are `diff` (unified diff text), `files`, `agent` and `linked_issues`. The queue can be a JSON list or
73
+ a JSON-lines file.
74
+
75
+ | Flag | What it does |
76
+ |---|---|
77
+ | `--top N` | List at most N candidates |
78
+ | `--threshold X` | Flag only scores >= X (default 0.5) |
79
+ | `--json` | Machine-readable output |
80
+ | `--embed` | Also use the local MiniLM text model (needs `[embed]`) |
81
+ | `--templates FILE` | Use templates learned from your own PRs |
82
+
83
+ ## In Python
84
+
85
+ ```python
86
+ from rd0_jinx import PR, Detector
87
+
88
+ new = PR.from_dict(new_pr_json) # GitHub API JSON shape
89
+ queue = [PR.from_dict(d) for d in open_prs_json]
90
+
91
+ det = Detector() # ships with trained weights
92
+ for m in det.rank(new, queue, top=3):
93
+ if m.score >= det.threshold:
94
+ print(m.number, round(m.score, 2), m.reasons)
95
+ ```
96
+
97
+ ## As a GitHub Action
98
+
99
+ ```yaml
100
+ - uses: harshuljain13/rd0-jinx@main
101
+ with:
102
+ threshold: "" # empty = bundled default (0.5)
103
+ max-open-prs: "200"
104
+ ```
105
+
106
+ ## License
107
+
108
+ MIT. The shipped weights were trained on [AIDev](https://huggingface.co/datasets/hao-li/AIDev) (CC BY 4.0).
@@ -0,0 +1,75 @@
1
+ # rd0-jinx
2
+
3
+ **Find the pull request that already does this.**
4
+
5
+ Coding agents (Copilot, Codex, Devin, Claude Code, Cursor, Jules) open a lot of pull requests, and some of
6
+ them redo work that is already open. `rd0-jinx` checks a new PR against the open ones and, when it finds a
7
+ likely duplicate, tells you which PR it matches and why.
8
+
9
+ - Runs on CPU in about 6 ms per PR. No LLM, no API key, no network call.
10
+ - Explains every match: shared files, overlapping line ranges, identical added lines, the same linked issue.
11
+ - About 1.9 false alarms per 100 PRs that have no duplicate.
12
+
13
+ Full README, benchmark and papers: **https://github.com/harshuljain13/rd0-jinx**
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ pip install rd0-jinx # the `jinx` command
19
+ pip install "rd0-jinx[embed]" # optional local MiniLM text model (installs PyTorch)
20
+ ```
21
+
22
+ ## Use it
23
+
24
+ ```bash
25
+ jinx check new_pr.json --open-queue open_prs.jsonl --top 2
26
+ ```
27
+
28
+ ```text
29
+ PR #44134: checked 19 open PRs in 12 ms. 1 likely duplicate(s) (score >= 0.50).
30
+ DUPLICATE? #44110 score 1.00 refactor(tvp): use capture_outputs for output tracing
31
+ - one PR links to the other (#44110)
32
+ - shares 1 of 1 changed files (src/transformers/models/tvp/modeling_tvp.py)
33
+ - 100% of changed line ranges overlap
34
+ - 100% of added lines are identical
35
+ - similar title/description after removing agent template text (0.92)
36
+ ```
37
+
38
+ Input uses the GitHub API's JSON shape (`number`, `title`, `body`, `user.login`, `created_at`). Optional
39
+ fields are `diff` (unified diff text), `files`, `agent` and `linked_issues`. The queue can be a JSON list or
40
+ a JSON-lines file.
41
+
42
+ | Flag | What it does |
43
+ |---|---|
44
+ | `--top N` | List at most N candidates |
45
+ | `--threshold X` | Flag only scores >= X (default 0.5) |
46
+ | `--json` | Machine-readable output |
47
+ | `--embed` | Also use the local MiniLM text model (needs `[embed]`) |
48
+ | `--templates FILE` | Use templates learned from your own PRs |
49
+
50
+ ## In Python
51
+
52
+ ```python
53
+ from rd0_jinx import PR, Detector
54
+
55
+ new = PR.from_dict(new_pr_json) # GitHub API JSON shape
56
+ queue = [PR.from_dict(d) for d in open_prs_json]
57
+
58
+ det = Detector() # ships with trained weights
59
+ for m in det.rank(new, queue, top=3):
60
+ if m.score >= det.threshold:
61
+ print(m.number, round(m.score, 2), m.reasons)
62
+ ```
63
+
64
+ ## As a GitHub Action
65
+
66
+ ```yaml
67
+ - uses: harshuljain13/rd0-jinx@main
68
+ with:
69
+ threshold: "" # empty = bundled default (0.5)
70
+ max-open-prs: "200"
71
+ ```
72
+
73
+ ## License
74
+
75
+ MIT. The shipped weights were trained on [AIDev](https://huggingface.co/datasets/hao-li/AIDev) (CC BY 4.0).
@@ -0,0 +1,102 @@
1
+ {
2
+ "number": 44134,
3
+ "title": "refactor(tvp): use capture_outputs for output tracing",
4
+ "body": "Migrated from https://github.com/huggingface/transformers/pull/44110 (original account: @fumadari).\n\n## Summary\n- Part of #43979 \u2014 refactors `tvp` to use the `capture_outputs`, `can_return_tuple`, and `merge_with_config_defaults` decorators\n- Simplifies `TvpAttention` to always return `(output, attention_probs)` (hooks decide what to capture)\n- Simplifies `TvpEncodeLayer` and `TvpEncoder` to plain forward without output collection logic\n- Adds `_can_record_outputs = {\"hidden_states\": TvpEncodeLayer, \"attentions\": TvpAttention}` to `TvpPreTrainedModel`\n- Adds `@capture_outputs` to `TvpModel`, `@can_return_tuple` to `TvpForVideoGrounding`\n- Net change: 28 added, 101 removed (-73 lines)\n\n## Test plan\n- [x] All 82 model tests pass (`pytest tests/models/tvp/ -x -q`)\n- [x] `test_capture_outputs_decorator` passes\n- [x] `test_hidden_states_output` and `test_attention_outputs` pass\n- [x] `test_retain_grad_hidden_states_attentions` passes\n\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)\n",
5
+ "author": "dario-fumarola",
6
+ "agent": "Claude_Code",
7
+ "created_at": "2026-02-18T21:14:27+00:00",
8
+ "closed_at": "2026-02-22T02:28:51+00:00",
9
+ "html_url": "https://github.com/huggingface/transformers/pull/44134",
10
+ "files": [
11
+ "src/transformers/models/tvp/modeling_tvp.py"
12
+ ],
13
+ "hunks": [
14
+ [
15
+ "src/transformers/models/tvp/modeling_tvp.py",
16
+ 23,
17
+ 32
18
+ ],
19
+ [
20
+ "src/transformers/models/tvp/modeling_tvp.py",
21
+ 349,
22
+ 361
23
+ ],
24
+ [
25
+ "src/transformers/models/tvp/modeling_tvp.py",
26
+ 385,
27
+ 394
28
+ ],
29
+ [
30
+ "src/transformers/models/tvp/modeling_tvp.py",
31
+ 427,
32
+ 450
33
+ ],
34
+ [
35
+ "src/transformers/models/tvp/modeling_tvp.py",
36
+ 453,
37
+ 502
38
+ ],
39
+ [
40
+ "src/transformers/models/tvp/modeling_tvp.py",
41
+ 520,
42
+ 526
43
+ ],
44
+ [
45
+ "src/transformers/models/tvp/modeling_tvp.py",
46
+ 709,
47
+ 727
48
+ ],
49
+ [
50
+ "src/transformers/models/tvp/modeling_tvp.py",
51
+ 735,
52
+ 742
53
+ ],
54
+ [
55
+ "src/transformers/models/tvp/modeling_tvp.py",
56
+ 761,
57
+ 785
58
+ ],
59
+ [
60
+ "src/transformers/models/tvp/modeling_tvp.py",
61
+ 810,
62
+ 829
63
+ ],
64
+ [
65
+ "src/transformers/models/tvp/modeling_tvp.py",
66
+ 840,
67
+ 857
68
+ ],
69
+ [
70
+ "src/transformers/models/tvp/modeling_tvp.py",
71
+ 863,
72
+ 874
73
+ ]
74
+ ],
75
+ "added_hashes": [
76
+ -6234949597182208704,
77
+ -6234949597111276482,
78
+ -6234949597082969226,
79
+ -6234949597067075612,
80
+ -6234949596687936574,
81
+ -6234949596492174358,
82
+ -6234949596260447961,
83
+ -6234949596209635997,
84
+ -6234949595866478382,
85
+ -6234949595852480167,
86
+ -6234949595692275344,
87
+ -6234949595536700687,
88
+ -6234949595321508850,
89
+ -6234949595176725570,
90
+ -6234949595075097959,
91
+ -6234949594974353019,
92
+ -6234949594657974751,
93
+ -6234949594493185090,
94
+ -6234949594419889991,
95
+ -6234949594383516668,
96
+ -6234949593925434604,
97
+ -6234949593674360367,
98
+ -6234949593658283157,
99
+ -6234949593529532779
100
+ ],
101
+ "linked_issues": []
102
+ }
@@ -0,0 +1,19 @@
1
+ {"number": 40390, "title": "Fix typo: 'lenght' to 'length'", "body": "Fixed 2 instances of the typo \"lenght\" \u2192 \"length\" in docstring comments in tests/models/kyutai_speech_to_text/test_modeling_kyutai_speech_to_text.py\r\n\r\nThe typo was in test method documentation explaining context length divergence behavior.\r\n\r\n\ud83e\udd16 Generated with [Claude Code](https://claude.ai/code)\r\n\r\n# What does this PR do?\r\n\r\n<!--\r\nCongratulations! You've made it this far! You're not quite done yet though.\r\n\r\nOnce merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.\r\n\r\nThen, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.\r\n\r\nOnce you're done, someone will review your PR shortly (see the section \"Who can review?\" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.\r\n-->\r\n\r\n<!-- Remove if not applicable -->\r\n\r\nFixes # (issue)\r\n\r\n\r\n## Before submitting\r\n- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).\r\n- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),\r\n Pull Request section?\r\n- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link\r\n to it if that's the case.\r\n- [ ] Did you make sure to update the documentation with your changes? Here are the\r\n [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and\r\n [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).\r\n- [ ] Did you write any new necessary tests?\r\n\r\n\r\n## Who can review?\r\n\r\nAnyone in the community is free to review the PR once the tests have passed. Feel free to tag\r\nmembers/contributors who may be interested in your PR.\r\n\r\n<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @\r\n\r\n If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.\r\n Please tag fewer than 3 people.\r\n\r\nModels:\r\n\r\n- text models: @ArthurZucker\r\n- vision models: @amyeroberts, @qubvel\r\n- speech models: @eustlb\r\n- graph models: @clefourrier\r\n\r\nLibrary:\r\n\r\n- flax: @gante and @Rocketknight1\r\n- generate: @zucchini-nlp (visual-language models) or @gante (all others)\r\n- pipelines: @Rocketknight1\r\n- tensorflow: @gante and @Rocketknight1\r\n- tokenizers: @ArthurZucker\r\n- trainer: @zach-huggingface, @SunMarc and @qgallouedec\r\n- chat templates: @Rocketknight1\r\n\r\nIntegrations:\r\n\r\n- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface\r\n- ray/raytune: @richardliaw, @amogkam\r\n- Big Model Inference: @SunMarc\r\n- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber\r\n\r\nDocumentation: @stevhliu\r\n\r\nHF projects:\r\n\r\n- accelerate: [different repo](https://github.com/huggingface/accelerate)\r\n- datasets: [different repo](https://github.com/huggingface/datasets)\r\n- diffusers: [different repo](https://github.com/huggingface/diffusers)\r\n- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)\r\n\r\nMaintained examples (not research project or legacy):\r\n\r\n- Flax: @Rocketknight1\r\n- PyTorch: See Models above and tag the person corresponding to the modality of the example.\r\n- TensorFlow: @Rocketknight1\r\n\r\n -->\r\n", "author": "Prawal-Sharma", "agent": "Claude_Code", "created_at": "2025-08-22T21:19:23+00:00", "closed_at": null, "html_url": "https://github.com/huggingface/transformers/pull/40390", "files": ["docs/source/en/model_doc/florence2.md", "docs/source/en/model_doc/gemma3n.md", "docs/source/en/model_doc/ovis2.md", "docs/source/en/model_doc/reformer.md", "docs/source/en/model_doc/sam.md", "docs/source/en/model_doc/umt5.md", "docs/source/en/model_doc/xmod.md", "docs/source/en/optimizers.md", "docs/source/ko/glossary.md", "docs/source/ko/model_doc/exaone4.md", "docs/source/ko/optimizers.md", "docs/source/ms/index.md", "src/transformers/cache_utils.py", "src/transformers/generation/continuous_batching.py", "src/transformers/models/altclip/modeling_altclip.py", "src/transformers/models/arcee/configuration_arcee.py", "src/transformers/models/arcee/modular_arcee.py", "src/transformers/models/doge/configuration_doge.py", "src/transformers/models/doge/modeling_doge.py", "src/transformers/models/doge/modular_doge.py", "src/transformers/models/efficientloftr/modeling_efficientloftr.py", "src/transformers/models/exaone4/configuration_exaone4.py", "src/transformers/models/exaone4/modular_exaone4.py", "src/transformers/models/gemma3n/configuration_gemma3n.py", "src/transformers/models/gemma3n/feature_extraction_gemma3n.py", "src/transformers/models/gemma3n/modeling_gemma3n.py", "src/transformers/models/gemma3n/modular_gemma3n.py", "src/transformers/models/glm4v/configuration_glm4v.py", "src/transformers/models/glm4v/modular_glm4v.py", "src/transformers/models/glm4v_moe/configuration_glm4v_moe.py", "src/transformers/models/glm4v_moe/modular_glm4v_moe.py", "src/transformers/models/hunyuan_v1_dense/configuration_hunyuan_v1_dense.py", "src/transformers/models/hunyuan_v1_moe/configuration_hunyuan_v1_moe.py", "src/transformers/models/kosmos2_5/configuration_kosmos2_5.py", "src/transformers/models/kosmos2_5/image_processing_kosmos2_5.py", "src/transformers/models/kosmos2_5/image_processing_kosmos2_5_fast.py", "src/transformers/models/kyutai_speech_to_text/configuration_kyutai_speech_to_text.py", "src/transformers/models/kyutai_speech_to_text/modeling_kyutai_speech_to_text.py", "src/transformers/models/lightglue/configuration_lightglue.py", "src/transformers/models/lightglue/modeling_lightglue.py", "src/transformers/models/lightglue/modular_lightglue.py", "src/transformers/models/mimi/modeling_mimi.py", "src/transformers/models/sam2/modeling_sam2.py", "src/transformers/models/sam2/modular_sam2.py", "src/transformers/models/smollm3/configuration_smollm3.py", "src/transformers/models/smollm3/modular_smollm3.py", "src/transformers/models/unispeech/modeling_unispeech.py", "src/transformers/models/unispeech/modular_unispeech.py", "src/transformers/models/unispeech_sat/modeling_unispeech_sat.py", "src/transformers/models/unispeech_sat/modular_unispeech_sat.py", "src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py", "src/transformers/models/wav2vec2/modeling_wav2vec2.py", "src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py", "src/transformers/models/wav2vec2_conformer/modular_wav2vec2_conformer.py", "src/transformers/models/xcodec/modeling_xcodec.py", "src/transformers/models/xlstm/modeling_xlstm.py", "tests/models/kyutai_speech_to_text/test_modeling_kyutai_speech_to_text.py"], "hunks": [["docs/source/en/model_doc/florence2.md", 23, 30], ["docs/source/en/model_doc/florence2.md", 154, 161], ["docs/source/en/model_doc/gemma3n.md", 202, 207], ["docs/source/en/model_doc/ovis2.md", 18, 25], ["docs/source/en/model_doc/reformer.md", 23, 30], ["docs/source/en/model_doc/sam.md", 23, 30], ["docs/source/en/model_doc/umt5.md", 23, 30], ["docs/source/en/model_doc/xmod.md", 23, 30], ["docs/source/en/optimizers.md", 180, 187], ["docs/source/ko/glossary.md", 150, 157], ["docs/source/ko/glossary.md", 187, 194], ["docs/source/ko/model_doc/exaone4.md", 27, 34], ["docs/source/ko/optimizers.md", 180, 187], ["docs/source/ms/index.md", 204, 211], ["src/transformers/cache_utils.py", 1144, 1151], ["src/transformers/generation/continuous_batching.py", 132, 139], ["src/transformers/models/altclip/modeling_altclip.py", 972, 979], ["src/transformers/models/arcee/configuration_arcee.py", 54, 61], ["src/transformers/models/arcee/modular_arcee.py", 60, 67], ["src/transformers/models/doge/configuration_doge.py", 98, 105], ["src/transformers/models/doge/modeling_doge.py", 605, 612], ["src/transformers/models/doge/modular_doge.py", 126, 133], ["src/transformers/models/doge/modular_doge.py", 601, 608], ["src/transformers/models/efficientloftr/modeling_efficientloftr.py", 889, 896], ["src/transformers/models/exaone4/configuration_exaone4.py", 50, 57], ["src/transformers/models/exaone4/modular_exaone4.py", 85, 92], ["src/transformers/models/gemma3n/configuration_gemma3n.py", 68, 75], ["src/transformers/models/gemma3n/feature_extraction_gemma3n.py", 108, 115], ["src/transformers/models/gemma3n/modeling_gemma3n.py", 907, 914], ["src/transformers/models/gemma3n/modular_gemma3n.py", 96, 103], ["src/transformers/models/gemma3n/modular_gemma3n.py", 1476, 1483], ["src/transformers/models/glm4v/configuration_glm4v.py", 147, 154], ["src/transformers/models/glm4v/modular_glm4v.py", 188, 195], ["src/transformers/models/glm4v_moe/configuration_glm4v_moe.py", 148, 155], ["src/transformers/models/glm4v_moe/modular_glm4v_moe.py", 77, 84], ["src/transformers/models/hunyuan_v1_dense/configuration_hunyuan_v1_dense.py", 50, 57], ["src/transformers/models/hunyuan_v1_moe/configuration_hunyuan_v1_moe.py", 52, 59], ["src/transformers/models/kosmos2_5/configuration_kosmos2_5.py", 56, 64], ["src/transformers/models/kosmos2_5/image_processing_kosmos2_5.py", 88, 95], ["src/transformers/models/kosmos2_5/image_processing_kosmos2_5_fast.py", 65, 72], ["src/transformers/models/kosmos2_5/image_processing_kosmos2_5_fast.py", 93, 100], ["src/transformers/models/kyutai_speech_to_text/configuration_kyutai_speech_to_text.py", 51, 58], ["src/transformers/models/kyutai_speech_to_text/modeling_kyutai_speech_to_text.py", 143, 150], ["src/transformers/models/lightglue/configuration_lightglue.py", 49, 56], ["src/transformers/models/lightglue/modeling_lightglue.py", 500, 507], ["src/transformers/models/lightglue/modular_lightglue.py", 68, 75], ["src/transformers/models/lightglue/modular_lightglue.py", 658, 665], ["src/transformers/models/mimi/modeling_mimi.py", 77, 84], ["src/transformers/models/mimi/modeling_mimi.py", 314, 324], ["src/transformers/models/sam2/modeling_sam2.py", 591, 598], ["src/transformers/models/sam2/modular_sam2.py", 706, 713], ["src/transformers/models/smollm3/configuration_smollm3.py", 51, 58], ["src/transformers/models/smollm3/modular_smollm3.py", 70, 77], ["src/transformers/models/unispeech/modeling_unispeech.py", 65, 72], ["src/transformers/models/unispeech/modular_unispeech.py", 52, 59], ["src/transformers/models/unispeech_sat/modeling_unispeech_sat.py", 67, 74], ["src/transformers/models/unispeech_sat/modular_unispeech_sat.py", 57, 64], ["src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py", 79, 86], ["src/transformers/models/wav2vec2/modeling_wav2vec2.py", 85, 92], ["src/transformers/models/wav2vec2/modeling_wav2vec2.py", 95, 104], ["src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py", 45, 52], ["src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py", 55, 64], ["src/transformers/models/wav2vec2_conformer/modular_wav2vec2_conformer.py", 45, 52], ["src/transformers/models/wav2vec2_conformer/modular_wav2vec2_conformer.py", 55, 64], ["src/transformers/models/xcodec/modeling_xcodec.py", 267, 274], ["src/transformers/models/xlstm/modeling_xlstm.py", 51, 58], ["tests/models/kyutai_speech_to_text/test_modeling_kyutai_speech_to_text.py", 717, 724], ["tests/models/kyutai_speech_to_text/test_modeling_kyutai_speech_to_text.py", 747, 754]], "added_hashes": [-9049916323100516228, -8341446788563038397, -8313056411230135965, -8313056407639016131, -8100464072250323893, -8092869053577123435, -7992622546603139291, -7734228102451319917, -7677816419806331988, -7328522507371930080, -6717488531600194664, -6320950088442588584, -6265714988249363393, -6253232612043485526, -6253232611764708963, -6226930365720594604, -6201619099251194224, -6187136545673215016, -6166381542320582543, -5845456223733628389, -5551983917990639794, -5416968441563790420, -4938294976337407053, -4884280145670174969, -4848349693300875912, -4848349692751532757, -4848349691641139002, -4566793850754189902, -4566793848492882125, -4143417599438812681, -4143417597869922653, -4143417597620854913, -4079296070495983240, -4079296070183022428, -4079296067685464532, -3945995479527024089, -3173770618419553683, -3087990150184253035, -2947348432775854540, -2431299851314696860, -2309314311214794355, -2309314309223858357, -2025285887563545437, -1632305727831717369, -1269637783662721625, -1269637782905732078, -825935477104904992, -825935475840048536, -825935475620340812, -530181191384732563, -456780834511690052, 361989815835446231, 525046982089727310, 754783533055943573, 1374342898645294202, 1645370519204319325, 1853250916619433816, 2427022620470283165, 2897724171427307034, 2923907599335732334, 3503838372351387823, 4041733351807210843, 5228154932391257581, 5314101306767989294, 6392040531156977358, 6392040532471749614, 6817965321776980306, 7415110427311954069, 8987488463414887276, 9022311343357535261, 9193321499479823495, 9193321501218844016], "linked_issues": []}
2
+ {"number": 40392, "title": "Remove debug print statement from ShieldGemma2 conversion script", "body": "Removed unnecessary print statement that was outputting normalized_path during vision weight conversion in convert_shieldgemma2_weights_orbax_to_hf.py\r\n\r\nThis appears to be a leftover debug statement that should not be in production code.\r\n\r\n\ud83e\udd16 Generated with [Claude Code](https://claude.ai/code)\r\n\r\n# What does this PR do?\r\n\r\n<!--\r\nCongratulations! You've made it this far! You're not quite done yet though.\r\n\r\nOnce merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.\r\n\r\nThen, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.\r\n\r\nOnce you're done, someone will review your PR shortly (see the section \"Who can review?\" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.\r\n-->\r\n\r\n<!-- Remove if not applicable -->\r\n\r\nFixes # (issue)\r\n\r\n\r\n## Before submitting\r\n- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).\r\n- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),\r\n Pull Request section?\r\n- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link\r\n to it if that's the case.\r\n- [ ] Did you make sure to update the documentation with your changes? Here are the\r\n [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and\r\n [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).\r\n- [ ] Did you write any new necessary tests?\r\n\r\n\r\n## Who can review?\r\n\r\nAnyone in the community is free to review the PR once the tests have passed. Feel free to tag\r\nmembers/contributors who may be interested in your PR.\r\n\r\n<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @\r\n\r\n If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.\r\n Please tag fewer than 3 people.\r\n\r\nModels:\r\n\r\n- text models: @ArthurZucker\r\n- vision models: @amyeroberts, @qubvel\r\n- speech models: @eustlb\r\n- graph models: @clefourrier\r\n\r\nLibrary:\r\n\r\n- flax: @gante and @Rocketknight1\r\n- generate: @zucchini-nlp (visual-language models) or @gante (all others)\r\n- pipelines: @Rocketknight1\r\n- tensorflow: @gante and @Rocketknight1\r\n- tokenizers: @ArthurZucker\r\n- trainer: @zach-huggingface, @SunMarc and @qgallouedec\r\n- chat templates: @Rocketknight1\r\n\r\nIntegrations:\r\n\r\n- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface\r\n- ray/raytune: @richardliaw, @amogkam\r\n- Big Model Inference: @SunMarc\r\n- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber\r\n\r\nDocumentation: @stevhliu\r\n\r\nHF projects:\r\n\r\n- accelerate: [different repo](https://github.com/huggingface/accelerate)\r\n- datasets: [different repo](https://github.com/huggingface/datasets)\r\n- diffusers: [different repo](https://github.com/huggingface/diffusers)\r\n- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)\r\n\r\nMaintained examples (not research project or legacy):\r\n\r\n- Flax: @Rocketknight1\r\n- PyTorch: See Models above and tag the person corresponding to the modality of the example.\r\n- TensorFlow: @Rocketknight1\r\n\r\n -->\r\n", "author": "Prawal-Sharma", "agent": "Claude_Code", "created_at": "2025-08-22T23:30:32+00:00", "closed_at": null, "html_url": "https://github.com/huggingface/transformers/pull/40392", "files": ["src/transformers/models/shieldgemma2/convert_shieldgemma2_weights_orbax_to_hf.py"], "hunks": [["src/transformers/models/shieldgemma2/convert_shieldgemma2_weights_orbax_to_hf.py", 216, 224]], "added_hashes": [], "linked_issues": []}
3
+ {"number": 43085, "title": "Add async_stopping_criteria flag to reduce GPU-CPU syncs during generation", "body": "## Summary\n- Adds `async_stopping_criteria` flag to `GenerationConfig` that enables asynchronous stopping criteria checks during generation\n- When enabled, stopping criteria are evaluated on a separate CUDA stream, allowing generation to continue while the check runs\n- Uses pinned (page-locked) CPU memory with numpy view for efficient GPU-CPU communication without explicit synchronization\n- Polls for completion only when the CUDA event signals the async operation is done (no artificial delays)\n\nFixes #43086\n\n## Motivation\nGPU-CPU synchronization during stopping criteria checks creates a bottleneck in autoregressive text generation. Each call to check if generation should stop requires syncing with the GPU to evaluate conditions like EOS token detection. This PR overlaps these checks with generation, reducing idle time.\n\n## Key Optimizations\n1. **Async CUDA stream**: Stopping criteria run on a separate stream, overlapping with token generation\n2. **Pinned memory + numpy**: Results written to pinned memory and read via numpy view - no PyTorch `.item()` sync needed\n3. **Event-based polling**: Only check completion when `event.query()` returns True (no fixed polling interval)\n4. **CPU-side max_length**: Length checks done on CPU without any GPU sync\n\n## Benchmark Results\n\n**Stopping criteria overhead (200 checks):**\n\n| Mode | Time | Per Check | Speedup |\n|------|------|-----------|---------|\n| Sync | 104.65ms | 0.523ms | 1.00x |\n| Async | 51.76ms | 0.259ms | **2.02x** |\n\n## Usage\n```python\nmodel.generate(\n inputs, \n max_new_tokens=200, \n async_stopping_criteria=True\n)\n```\n\n## Test plan\n- [x] Verify correctness: async mode produces identical outputs to sync mode\n - `test_async_sync_equivalence_max_length`\n - `test_async_sync_equivalence_eos_token`\n - `test_async_sync_equivalence_partial_eos`\n- [x] Test with various stopping criteria (EOS, max_length, custom criteria)\n - `test_async_sync_equivalence_max_length` - max_length criteria\n - `test_async_sync_equivalence_eos_token` - EOS token criteria\n - `test_async_custom_stopping_criteria` - custom stopping criteria\n - `test_async_multiple_eos_tokens` - multiple EOS token IDs\n- [x] Test with different batch sizes\n - `test_async_different_batch_sizes` - batch sizes 1, 2, 4, 8, 16\n- [x] Ensure graceful fallback when CUDA is not available\n - `test_async_cpu_fallback` - verifies sync fallback on CPU tensors\n- [x] Test wrapper interface compatibility\n - `test_async_wrapper_basic` - `__len__`, `__iter__`, `max_length` property\n - `test_async_legacy_call_interface` - legacy `__call__` interface\n - `test_async_finalize` - cleanup method\n\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)\n", "author": "AmitMY", "agent": "Claude_Code", "created_at": "2026-01-03T09:42:33+00:00", "closed_at": null, "html_url": "https://github.com/huggingface/transformers/pull/43085", "files": ["src/transformers/generation/__init__.py", "src/transformers/generation/configuration_utils.py", "src/transformers/generation/stopping_criteria.py", "src/transformers/generation/utils.py", "tests/generation/test_stopping_criteria.py"], "hunks": [["src/transformers/generation/__init__.py", 76, 82], ["src/transformers/generation/__init__.py", 173, 179], ["src/transformers/generation/configuration_utils.py", 331, 337], ["src/transformers/generation/configuration_utils.py", 414, 420], ["src/transformers/generation/stopping_criteria.py", 509, 515], ["src/transformers/generation/stopping_criteria.py", 543, 551], ["src/transformers/generation/stopping_criteria.py", 654, 679], ["src/transformers/generation/utils.py", 101, 107], ["src/transformers/generation/utils.py", 2641, 2647], ["src/transformers/generation/utils.py", 2903, 2917], ["tests/generation/test_stopping_criteria.py", 25, 31], ["tests/generation/test_stopping_criteria.py", 287, 290], ["tests/generation/test_stopping_criteria.py", 325, 331], ["tests/generation/test_stopping_criteria.py", 329, 338], ["tests/generation/test_stopping_criteria.py", 338, 344], ["tests/generation/test_stopping_criteria.py", 357, 364], ["tests/generation/test_stopping_criteria.py", 357, 376], ["tests/generation/test_stopping_criteria.py", 366, 374], ["tests/generation/test_stopping_criteria.py", 395, 405], ["tests/generation/test_stopping_criteria.py", 409, 418], ["tests/generation/test_stopping_criteria.py", 437, 447], ["tests/generation/test_stopping_criteria.py", 457, 466], ["tests/generation/test_stopping_criteria.py", 474, 483], ["tests/generation/test_stopping_criteria.py", 492, 498], ["tests/generation/test_stopping_criteria.py", 503, 513], ["tests/generation/test_stopping_criteria.py", 518, 528], ["tests/generation/test_stopping_criteria.py", 537, 547]], "added_hashes": [-3734392982817558605, -3734392982221005473, -1751138061477971119, -1751138059812927152, -1751138059515404089, -1751138059196081323, -1751138058210349359, -1751138057410955078, -867024670068595291, -867024670054741032, -867024670018141083, -867024670010921649, -867024669998069390, -867024669985452172, -867024669932475948, -867024669904358340, -867024669892660529, -867024669811676287, -867024669685263355, -867024669667977512, -867024669620378137, -867024669596760311, -867024669571125407, -867024669562682473, -867024669556602304, -867024669546389025, -867024669517596447, -867024669511306516, -867024669490169330, -867024669488858384, -867024669437309249, -867024669416975219, -867024669412851561, -867024669412699465, -867024669393947583, -867024669387171928, -867024669365887978, -867024669333705474, -867024669286465376, -867024669269258506, -867024669267305230, -867024669245475733, -867024669231846469, -867024669205794041, -867024669186634379, -867024669183519466, -867024669175839816, -867024669173025305, -867024669103868220, -867024669078707723, -867024669058183048, -867024669010184749, -867024668989318952, -867024668877773782, -867024668869194640, -867024668814516055, -867024668793821303, -867024668786778344, -867024668735581175, -867024668735019417, -867024668730780671, -867024668712964865, -867024668707024301, -867024668675655355, -867024668674409032, -867024668668410526, -867024668635632501, -867024668621238275, -867024668605693021, -867024668574716024, -867024668526984454, -867024668508846415, -867024668492136795, -867024668471712408, -867024668384584489, -867024668382601426, -867024668374073925, -867024668354861264, -867024668332952700, -867024668326623945, -867024668323888982, -867024668264197925, -867024668262718203, -867024668224022895, -867024668194507744, -867024668119958557, -867024668092724521, -867024668019538648, -867024668006837280, -867024667999197614, -867024667938035231, -867024667865901002, -867024667858318265, -867024667843295902, -867024667815326284, -867024667701460802, -867024667697995160, -867024667694767775, -867024667679788018, -867024667655002603, -867024667639447658, -867024667636583859, -867024667578672507, -867024667551991321, -867024667488808470, -867024667463259175, -867024667456086298, -867024667441523085, -867024667382299090, -867024667183200362, -867024667125404798, -867024667091491295, -867024667081308075, -867024667034939981, -867024666928695084, -867024666918319635, -867024666889843812, -867024666865082473, -867024666841831112, -867024666813473353, -867024666741777466, -867024666707132893, -867024666704241123, -867024666702051634, -867024666643444105, -867024666638803179, -867024666561584468, -867024666555622397, -867024666542315629, -867024666515500716, -867024666410851573, -867024666381311318, -867024666366714575, -867024666359950973, -867024666315783898, -867024666303425569, -867024666281313163, -867024666257947973, -867024666232978776, -867024666220196646, -867024666219987816, -867024666178538970, -867024666176049577, -867024666154174113, -867024666145613515, -867024666139204943, -867024666130792140, -867024666041143269, -867024666034666448, -867024666000331103, -867024665947230649, -867024665891219649, -867024665879040033, -867024665861603383, -867024665841572402, -867024665819634802, -867024665796679693, 8387107243947589581, 8387107244015642025, 8387107244020718820, 8387107244055134093, 8387107244099590559, 8387107244145376167, 8387107244193774370, 8387107244240329632, 8387107244270790411, 8387107244354590611, 8387107244358194210, 8387107244359663973, 8387107244363561914, 8387107244407629209, 8387107244596521053, 8387107244623888592, 8387107244653947764, 8387107244659247640, 8387107244672272667, 8387107244701677964, 8387107244713340441, 8387107244714541509, 8387107244750492676, 8387107244757288937, 8387107244777385772, 8387107244821503479, 8387107244833807217, 8387107244859642875, 8387107244860346942, 8387107244957746196, 8387107244971031444, 8387107245087141788, 8387107245156382302, 8387107245230060025, 8387107245239944426, 8387107245244059940, 8387107245263970328, 8387107245299262874, 8387107245314525235, 8387107245314843469, 8387107245358274905, 8387107245384287551, 8387107245459754194, 8387107245470829582, 8387107245489073563, 8387107245556978948, 8387107245561342644, 8387107245566139318, 8387107245569865302, 8387107245595614043, 8387107245608885141, 8387107245636236059, 8387107245638532984, 8387107245640330481, 8387107245665589561, 8387107245689937780, 8387107245727216951, 8387107245742818939, 8387107245786125280, 8387107245796708421, 8387107245798984151, 8387107245799026710, 8387107245800086107, 8387107245802652712, 8387107245818604467, 8387107245827636843, 8387107245902132246, 8387107245922449907, 8387107245993272118, 8387107246008777534, 8387107246014271260, 8387107246032699301, 8387107246061080433, 8387107246067263806, 8387107246068536265, 8387107246074931016, 8387107246092546055, 8387107246110845796, 8387107246154471336, 8387107246179372590, 8387107246212562393, 8387107246254599795, 8387107246284654191, 8387107246292921828, 8387107246324677795, 8387107246331116575, 8387107246352484147, 8387107246380172729, 8387107246395909494, 8387107246400450857, 8387107246471033133, 8387107246494820682, 8387107246569857079, 8387107246590569310, 8387107246598117075, 8387107246607790476, 8387107246621020765, 8387107246649054804, 8387107246655325795, 8387107246730960729, 8387107246814484239, 8387107246837478059, 8387107246850329940, 8387107246861747154, 8387107246894087428, 8387107246900841865, 8387107246908354441, 8387107246966973300, 8387107247041293012, 8387107247050112551, 8387107247064894645, 8387107247089939148, 8387107247142019207, 8387107247170873386, 8387107247179010395, 8387107247184682223, 8387107247238356608, 8387107247260859639, 8387107247294451983, 8387107247297048287, 8387107247300417016, 8387107247304750158, 8387107247308197676, 8387107247312460110, 8387107247505429729, 8387107247525606853, 8387107247527126494, 8387107247547339286, 8387107247562511338, 8387107247620263050, 8387107247630690835, 8387107247634625358, 8387107247705986140, 8387107247715600073, 8387107247723240349, 8387107247755023415, 8387107247876118923, 8387107247982576216, 8387107248010427355, 8387107248014233925, 8387107248041744226, 8387107248065717138, 8387107248159874278, 8387107248190398009, 8846904542622044973, 8846904542956983445, 8846904543280868548, 8846904543520676917, 8846904543802642810, 8846904544341176312, 8846904544754084607, 8846904544875381340, 8846904545137939947, 8846904545338570203, 8846904545911926120, 8846904546311426386, 8846904546355208976], "linked_issues": [3777909876]}
4
+ {"number": 43088, "title": "Skip attention_mask.all() GPU-CPU sync during generation", "body": "I guess there could be cases where people define a custom mask, but I don't know of any.\r\n\r\n----\r\n\r\n## Summary\r\n- Adds a context variable `_attention_mask_all_true` to track if attention_mask is known to be all-True during generation\r\n- Sets the context variable at the start of `generate()` based on the initial mask state\r\n- Modifies `_ignore_causal_mask_sdpa()` to skip the expensive `.all()` check when the context variable indicates no padding\r\n\r\n## Problem\r\nDuring autoregressive generation, `_ignore_causal_mask_sdpa()` in `masking_utils.py` calls `padding_mask.all()` on every generated token to check if the mask contains any padding. This causes a GPU-CPU synchronization that adds ~2-3ms per token, significantly impacting generation latency.\r\n\r\n## Solution\r\nSince during generation we only append ones (1s) to the attention mask, if the mask starts all-True (no padding), it will remain all-True throughout generation. We check this once at the start and use a context variable to skip subsequent `.all()` checks.\r\n\r\n## Results\r\n- Reduces `.all()` calls from N+1 to 1 for N generated tokens\r\n- Example: 201 calls \u2192 1 call for 200 tokens generated\r\n- Eliminates per-token GPU-CPU sync overhead (~2-3ms per token)\r\n\r\n## Test plan\r\n- [x] Verified outputs are identical with and without optimization\r\n- [x] Verified `.all()` call count reduced from 201 to 1 for 200 tokens\r\n- [ ] Run existing tests\r\n\r\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "author": "AmitMY", "agent": "Claude_Code", "created_at": "2026-01-03T10:40:33+00:00", "closed_at": null, "html_url": "https://github.com/huggingface/transformers/pull/43088", "files": ["src/transformers/generation/utils.py", "src/transformers/masking_utils.py"], "hunks": [["src/transformers/generation/utils.py", 41, 48], ["src/transformers/generation/utils.py", 2645, 2660], ["src/transformers/masking_utils.py", 12, 25], ["src/transformers/masking_utils.py", 20, 33], ["src/transformers/masking_utils.py", 51, 57], ["src/transformers/masking_utils.py", 243, 257]], "added_hashes": [2485374343192119725, 2485374343316366422, 2485374344227551255, 2485374344699109154, 2485374344749868790, 2485374345276216791, 2485374345481727008, 2485374346880790136, 2485374347173668541, 8846904543486060638, 8846904543488687071, 8846904543828665720, 8846904544109307859, 8846904544151045127, 8846904544491520760, 8846904544646199145, 8846904544666454151, 8846904545320729723, 8846904545619701245, 8846904545833879992, 8846904545851201102, 8846904546506962227, 8846904546665717914, 8846904546809654978], "linked_issues": []}
5
+ {"number": 43849, "title": "Fix translation task validation when translation pipeline is unavailable", "body": "## Summary\n- only treat `translation_XX_to_YY` as a special task when the `translation` pipeline is actually registered\n- stop advertising `translation_XX_to_YY` in unknown-task error messages when translation is not supported\n- add regression tests for both modes of `PipelineRegistry` (with and without translation support)\n\n## Reproduction\nIssue: #43825\n\nWith v5 defaults, `pipeline(\"translation_en_to_de\")` currently raises `KeyError: 'translation'` and unknown-task messages still list `translation_XX_to_YY` although `translation` is unavailable.\n\n## Validation\n- `PYTHONPATH=src uv run --with pytest --with datasets pytest -q tests/pipelines/test_pipelines_common.py -k PipelineRegistryTest`\n- `uvx ruff check src/transformers/pipelines/base.py tests/pipelines/test_pipelines_common.py`\n\nFixes #43825\n", "author": "weiguangli-io", "agent": "OpenAI_Codex", "created_at": "2026-02-09T02:31:22+00:00", "closed_at": "2026-03-03T09:42:38+00:00", "html_url": "https://github.com/huggingface/transformers/pull/43849", "files": ["src/transformers/pipelines/base.py", "tests/pipelines/test_pipelines_common.py"], "hunks": [["src/transformers/pipelines/base.py", 1345, 1361], ["src/transformers/pipelines/base.py", 1357, 1366], ["tests/pipelines/test_pipelines_common.py", 36, 43], ["tests/pipelines/test_pipelines_common.py", 788, 794], ["tests/pipelines/test_pipelines_common.py", 866, 872]], "added_hashes": [-4465502674391701548, -4465502674084570847, -4465502674068648520, -4465502673755171732, -4465502673386634931, -4465502673311391623, -4465502673219762308, -4465502673179429653, -4465502673122088927, -4465502673030326993, -4465502672800114964, -4465502672765666402, -4465502672585629007, -4465502672566089027, -4465502672478234678, -4465502672110138732, -4465502671707901925, -4465502671319084605, -4465502671178070260, -4465502670925452842, -4465502670524740098, -4465502670455189277, -2086730776639745275, -2086730776501913869, -2086730776263872009, -2086730775957001754, -2086730775864524284, -2086730775125952590, -2086730774708179459], "linked_issues": [3911716367]}
6
+ {"number": 44007, "title": "[ResNet] Refactor output tracing to decorator-based interface", "body": "## Summary\n- refactor `ResNetModel` to use `@capture_outputs` for hidden-state collection\n- register `_can_record_outputs` on `ResNetPreTrainedModel` with `ResNetStage`\n- switch `ResNetForImageClassification` and `ResNetBackbone` to `@can_return_tuple` and remove manual `return_dict` branching\n- preserve existing hidden-state behavior while simplifying output handling\n\nCloses #43979 for `resnet`.\n\n## Validation\n- `python3 -m compileall src/transformers/models/resnet/modeling_resnet.py`\n- full model tests were not run in this environment due missing optional test dependency (`regex`)\n", "author": "pdwi2020", "agent": "OpenAI_Codex", "created_at": "2026-02-15T07:26:52+00:00", "closed_at": null, "html_url": "https://github.com/huggingface/transformers/pull/44007", "files": ["src/transformers/models/regnet/modeling_regnet.py", "src/transformers/models/resnet/modeling_resnet.py", "src/transformers/models/rt_detr/modeling_rt_detr_resnet.py"], "hunks": [["src/transformers/models/regnet/modeling_regnet.py", 26, 33], ["src/transformers/models/regnet/modeling_regnet.py", 262, 268], ["src/transformers/models/regnet/modeling_regnet.py", 294, 330], ["src/transformers/models/regnet/modeling_regnet.py", 347, 372], ["src/transformers/models/regnet/modeling_regnet.py", 374, 384], ["src/transformers/models/resnet/modeling_resnet.py", 28, 35], ["src/transformers/models/resnet/modeling_resnet.py", 248, 254], ["src/transformers/models/resnet/modeling_resnet.py", 281, 317], ["src/transformers/models/resnet/modeling_resnet.py", 333, 358], ["src/transformers/models/resnet/modeling_resnet.py", 360, 370], ["src/transformers/models/resnet/modeling_resnet.py", 385, 397], ["src/transformers/models/resnet/modeling_resnet.py", 419, 426], ["src/transformers/models/resnet/modeling_resnet.py", 435, 447], ["src/transformers/models/rt_detr/modeling_rt_detr_resnet.py", 302, 308]], "added_hashes": [-5413133619844815501, -5413133619689394920, -5413133619643212064, -5413133619567274631, -5413133619565889306, -5413133619095144574, -5413133618146347569, -5413133618015245508, -5413133617858931279, -5413133617391196019, -5413133616525084940, -5413133616490538333, 168206681935620486, 168206682285804377, 168206682621768553, 168206682951772659, 168206683092515853, 168206683140018578, 168206683954438552, 168206684085591624, 168206684120183327, 168206685250497638, 168206685849415639, 168206685990850906, 5521733567579392265], "linked_issues": [3937612029]}
7
+ {"number": 44014, "title": "[UMT5] Ignore tied encoder embedding missing-key warning", "body": "## Summary\nFixes #43992 by preventing a false missing-key report for `UMT5EncoderModel` when `encoder.embed_tokens.weight` is tied to `shared.weight`.\n\n`UMT5EncoderModel` already declares tied weights, but loading checkpoints that only carry the shared embedding can still surface a misleading missing key warning for `encoder.embed_tokens.weight`. This change marks that key as ignorable-on-load for this encoder-only class, matching the tied-embedding semantics.\n\n## Changes\n- `src/transformers/models/umt5/modeling_umt5.py`\n - Add `_keys_to_ignore_on_load_missing = [r\"encoder.embed_tokens.weight\"]` to `UMT5EncoderModel`.\n- `tests/models/umt5/test_encoder_missing_keys.py`\n - Add a regression test that loads `UMT5EncoderModel` from a state dict missing `encoder.embed_tokens.weight` and asserts the key is not reported in `missing_keys`.\n\n## Validation\n- `PYTHONPATH=src python3 -m ruff check src/transformers/models/umt5/modeling_umt5.py tests/models/umt5/test_encoder_missing_keys.py`\n- `PYTHONPATH=src /tmp/tfpycheck/bin/pytest -q tests/models/umt5/test_encoder_missing_keys.py`\n- `PYTHONPATH=src /tmp/tfpycheck/bin/coverage run -m pytest -q tests/models/umt5/test_encoder_missing_keys.py`\n- `PYTHONPATH=src /tmp/tfpycheck/bin/coverage report -m src/transformers/models/umt5/modeling_umt5.py`\n\nCoverage note:\n- The added regression test hits the new load-ignore behavior directly; full-file coverage remains low because the model file contains many unrelated execution paths.\n", "author": "weiguangli-io", "agent": "OpenAI_Codex", "created_at": "2026-02-15T15:17:22+00:00", "closed_at": "2026-02-16T13:40:21+00:00", "html_url": "https://github.com/huggingface/transformers/pull/44014", "files": ["src/transformers/models/umt5/modeling_umt5.py", "tests/models/umt5/test_encoder_missing_keys.py"], "hunks": [["src/transformers/models/umt5/modeling_umt5.py", 1161, 1167], ["tests/models/umt5/test_encoder_missing_keys.py", 0, 1]], "added_hashes": [-8592285940545811514, -8592285940482949189, -8592285940471199283, -8592285940290328324, -8592285940279327402, -8592285940225494820, -8592285940158465198, -8592285940090941488, -8592285939980396963, -8592285939790525454, -8592285939669325141, -8592285939455014984, -8592285938933536439, -8592285938739171528, -8592285938705532059, -8592285938327153545, -8592285938287979124, -8592285938110038459, -8592285938031688688, -8592285938006575339, -8592285937977412240, -8592285937964070388, -8592285937807470155, -8592285937801214497, -8592285937525547906, -8592285937463957591, -8592285937371727814, -8592285937105951869, -8592285936957654400, -8592285936369264961, -8592285936357087524, -6781171886823783045], "linked_issues": [3939917737]}
8
+ {"number": 44018, "title": "Refactor GPT-Neo output tracing to use capture_outputs/can_return_tuple", "body": "## Summary\n\n- Migrates `gpt_neo` to the standardized output collection interface as part of #43979\n- Adds `@capture_outputs` decorator on `GPTNeoModel.forward` (base model)\n- Adds `@can_return_tuple` decorator on all wrapper model forwards (`ForCausalLM`, `ForSequenceClassification`, `ForTokenClassification`, `ForQuestionAnswering`)\n- Adds `_can_record_outputs` mapping on `GPTNeoPreTrainedModel` pointing to `GPTNeoBlock` (hidden_states) and `GPTNeoAttention` (attentions)\n- Removes manual `output_attentions`, `output_hidden_states`, `return_dict` parameter handling and collection loops\n- `GPTNeoBlock` now returns `hidden_states` directly instead of `(hidden_states, attn_weights)` tuple\n\n## Test plan\n\n- [ ] Run existing GPT-Neo model tests (`tests/models/gpt_neo/`)\n- [ ] Verify `output_attentions=True` still returns attention weights via hooks\n- [ ] Verify `output_hidden_states=True` still returns per-layer hidden states via hooks\n- [ ] Verify `return_dict=False` still returns tuples via `@can_return_tuple`\n\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "author": "yashbora9", "agent": "Claude_Code", "created_at": "2026-02-15T19:35:06+00:00", "closed_at": null, "html_url": "https://github.com/huggingface/transformers/pull/44018", "files": ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", "tests/models/gpt_neo/test_modeling_gpt_neo.py"], "hunks": [["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 26, 44], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 39, 45], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 135, 142], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 180, 187], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 282, 297], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 328, 345], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 351, 358], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 363, 369], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 398, 404], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 408, 420], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 428, 441], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 479, 521], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 535, 541], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 546, 559], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 571, 595], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 597, 607], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 634, 640], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 645, 656], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 668, 689], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 730, 739], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 756, 762], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 767, 778], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 790, 812], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 815, 825], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 838, 844], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 848, 859], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 867, 887], ["src/transformers/models/gpt_neo/modeling_gpt_neo.py", 904, 914], ["tests/models/gpt_neo/test_modeling_gpt_neo.py", 458, 465]], "added_hashes": [622451384998121621, 6774150125920989723, 6774150126115154271, 6774150126261654656, 6774150126302833786, 6774150126329736949, 6774150126548538506, 6774150126580710125, 6774150126719751470, 6774150127003437261, 6774150127097701322, 6774150127352399718, 6774150127481729055, 6774150127683691748, 6774150127723695841, 6774150127758911767, 6774150127828719527, 6774150127857449438, 6774150127866075935, 6774150128340972657, 6774150128637860938, 6774150128701449524, 6774150129015955252, 6774150129296647094, 6774150129454375456, 6774150129790095787, 6774150129891678468], "linked_issues": []}
9
+ {"number": 44070, "title": "Add GGUF loading support for Qwen3-Next (qwen3_next) architecture", "body": "## Summary\n\n- Add GGUF config mapping, defaults, and tokenizer converter for `qwen3_next` (Qwen3-Coder-Next, hybrid DeltaNet+Attention MoE, 80B total / 3B active)\n- Add `Qwen3NextTensorProcessor` handling DeltaNet-specific tensor transforms: QKVZ merge, A_log, conv1d unsqueeze, norm weight offsets, dt_bias mapping, and MoE experts (inherited from `Qwen2MoeTensorProcessor`)\n- Add architecture name mappings and post-processing for `linear_value_head_dim` and `rope_parameters`\n\n## Motivation\n\nThis enables loading quantized GGUF files (e.g. Q4_K_XL from llama.cpp) directly into `Qwen3NextForCausalLM`, which unblocks vLLM GGUF support for this architecture.\n\n## Verification\n\nTested against `Qwen3-Coder-Next-UD-Q4_K_XL.gguf` (46 GB, 843 tensors):\n- Config loading: all 21 GGUF metadata keys mapped correctly\n- Weight map: 843 GGUF tensors \u2192 759 model parameters, 100% coverage\n- Tensor shapes: 20 representative tensors dequantized and verified\n- Tensor transforms: QKVZ roundtrip (exact reconstruction), A_log, conv1d, norms, MoE experts all verified on real data\n- Forward pass: 4-layer subset loaded (66/66 params), no NaN/Inf, reasonable logit range\n- Full 80B model inference requires >160GB memory (not feasible on test hardware)\n\n## Tests\n\n- `test_qwen3_next_config_mapping`: verifies all 21 config keys, defaults, and tokenizer converter\n- `test_qwen3_next_tensor_processor`: verifies processor registration and key transforms (conv1d unsqueeze, A_log, norm -1, ssm_norm passthrough)\n- `test_qwen3_next_q4_k_xl`: skipped (80B model, >160GB memory required)\n\n## Dependencies\n\nRequires `gguf-py` with `MODEL_ARCH.QWEN3NEXT` support (available in llama.cpp upstream gguf-py, not yet in PyPI release).\n\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "author": "rudybear", "agent": "Claude_Code", "created_at": "2026-02-17T07:18:13+00:00", "closed_at": null, "html_url": "https://github.com/huggingface/transformers/pull/44070", "files": ["src/transformers/integrations/ggml.py", "src/transformers/modeling_gguf_pytorch_utils.py", "tests/quantization/ggml/test_ggml.py"], "hunks": [["src/transformers/integrations/ggml.py", 129, 135], ["src/transformers/integrations/ggml.py", 320, 326], ["src/transformers/integrations/ggml.py", 752, 758], ["src/transformers/modeling_gguf_pytorch_utils.py", 299, 305], ["src/transformers/modeling_gguf_pytorch_utils.py", 312, 318], ["src/transformers/modeling_gguf_pytorch_utils.py", 356, 362], ["src/transformers/modeling_gguf_pytorch_utils.py", 462, 468], ["src/transformers/modeling_gguf_pytorch_utils.py", 538, 544], ["tests/quantization/ggml/test_ggml.py", 1129, 1132]], "added_hashes": [-8656424276269803897, -8656424276260951564, -8656424276177372686, -8656424276109641983, -8656424276096938603, -8656424276052930975, -8656424276020983586, -8656424276020555728, -8656424276012490824, -8656424275981270008, -8656424275918730354, -8656424275914850536, -8656424275903349036, -8656424275901026292, -8656424275873125566, -8656424275856715365, -8656424275812181249, -8656424275792371080, -8656424275746857215, -8656424275683091344, -8656424275665628306, -8656424275644377701, -8656424275411881385, -8656424275304561949, -8656424275300298538, -8656424275291307435, -8656424275255039863, -8656424275233023035, -8656424275202715433, -8656424275177049993, -8656424275173644017, -8656424275160128950, -8656424275150338462, -8656424275140881240, -8656424275114064132, -8656424275109212638, -8656424275097253170, -8656424275049100915, -8656424274986276167, -8656424274983450958, -8656424274913407972, -8656424274893103021, -8656424274870191734, -8656424274866991078, -8656424274838120246, -8656424274646241559, -8656424274593800991, -8656424274493905062, -8656424274488487684, -8656424274384766786, -8656424274336633827, -8656424274274196509, -8656424274260727651, -8656424274225991428, -8656424274178530162, -8656424274089014405, -8656424274065755209, -8656424274055156260, -8656424274037642699, -8656424273960390672, -8656424273868679369, -8656424273856962146, -8656424273643734389, -8656424273641279986, -8656424273608008210, -8656424273573024595, -8656424273539285590, -8656424273464770648, -8656424273408573567, -8656424273392048223, -8656424273336651852, -8656424273315832853, -8656424273287115747, -8656424273277171734, -8656424273230526373, -8656424273187325534, -8656424273180884638, -8656424273153719637, -8656424273127208984, -8656424273103294706, -8656424273040192134, -8656424273000529610, -8656424272964824066, -8656424272940008871, -8656424272854417478, -8656424272782093480, -8656424272724551132, -8656424272711947133, -8656424272668315959, -8656424272615401433, -8656424272561226325, -8656424272539736649, -8656424272523816548, -8656424272492425910, -8656424272461797069, -8656424272457279464, -8656424272409223147, -8656424272377623973, -8656424272353094985, -8656424272272213411, -8656424272208247613, -8656424272203385623, -8656424272181968823, -8656424272133577706, -8656424272125459237, -8656424272121571722, -8656424272121366040, -8656424272117355069, -8656424272103527965, -6865136830187662057, -6865136830184554987, -6865136829961898552, -6865136829821770871, -6865136829625179031, -6865136829541270095, -6865136829238242366, -6865136829082447156, -6865136829002699836, -6865136828588951642, -6865136828462799771, -6865136828313845739, -6865136827826037075, -6865136827756386006, -6865136827748806961, -6865136827602120098, -6865136827322333853, -6865136826848065920, -6865136826812998153, -6865136826753958257, -6865136826638171993, -6865136826612781408, -6865136826410440081, -6865136826390789033, -6507440821456966271, -6507440821411978051, -6507440821394723680, -6507440821379896266, -6507440821374646358, -6507440821359417262, -6507440821334997419, -6507440821169040586, -6507440821149637998, -6507440821145588089, -6507440821087616347, -6507440820974369284, -6507440820753429114, -6507440820691554746, -6507440820682637329, -6507440820662141061, -6507440820622206203, -6507440820588593038, -6507440820473677918, -6507440820469557739, -6507440820447823747, -6507440820419344543, -6507440820249357069, -6507440820185505974, -6507440820141388715, -6507440820136258388, -6507440820098789764, -6507440820090889083, -6507440819963080960, -6507440819943265493, -6507440819902118630, -6507440819839441862, -6507440819749802370, -6507440819747354267, -6507440819701113387, -6507440819627850447, -6507440819534745222, -6507440819527896483, -6507440819526432142, -6507440819466577856, -6507440819427833795, -6507440819420205096, -6507440819418143855, -6507440819374516129, -6507440819283840963, -6507440819244151261, -6507440819188094821, -6507440819181249937, -6507440819177475633, -6507440819092926603, -6507440818982100329, -6507440818961053226, -6507440818928753457, -6507440818767686352, -6507440818467132106, -6507440818395884482, -6507440818342446997, -6507440818193586821, -6507440818088552948, -6507440818087173477, -6507440818081605762, -6507440818046033024, -6507440818005915965, -6507440817990522006, -6507440817958868093, -6507440817936155837, -6507440817906502052, -6507440817899252120, -6507440817890960270, -6507440817836246234, -6507440817657396444, -6507440817559137307, -6507440817553934105, -6507440817547892214, -6507440817395556032, -6507440817387124666, -6507440817380154845, -6507440817377613302, -6507440817296697161, -6507440817213312198, -6507440817203325900, -6507440817182923320], "linked_issues": []}
10
+ {"number": 44102, "title": "Refactor ibert output tracing with capture_outputs", "body": "## Summary\n\nRefactors the `ibert` model to use the new `@capture_outputs` and `@can_return_tuple` decorators for output tracing, as part of the meta-issue #43979.\n\n**Key changes:**\n- Added `_can_record_outputs = {\"hidden_states\": IBertLayer, \"attentions\": IBertAttention}` on `IBertPreTrainedModel`\n- Added `@merge_with_config_defaults` + `@capture_outputs` on `IBertModel.forward`\n- Added `@can_return_tuple` on all wrapper model forwards (`IBertForMaskedLM`, `IBertForSequenceClassification`, `IBertForMultipleChoice`, `IBertForTokenClassification`, `IBertForQuestionAnswering`)\n- Removed `output_attentions`, `output_hidden_states`, `return_dict` from all forward signatures, replaced with `**kwargs: Unpack[TransformersKwargs]`\n- Simplified `IBertEncoder` to a plain layer loop (removed manual hidden state/attention collection)\n- Restructured `IBertSelfAttention` and `IBertAttention` returns for hook compatibility (always return attention probs alongside the quantization scaling factors)\n- Net reduction of ~112 lines\n\n**Note on ibert's quantization architecture:** ibert returns `(tensor, scaling_factor)` pairs from internal modules. The refactoring restructures `IBertAttention.forward` to return `((attention_output, scaling_factor), attention_probs)` so the capture hook at index=1 correctly captures attention probabilities. `IBertLayer.forward` now returns a single tensor (the layer output), compatible with the hidden_states hook.\n\n## Test plan\n\n- [x] All 80 ibert model tests pass (`pytest tests/models/ibert/test_modeling_ibert.py`)\n- [x] Tests cover `output_attentions=True`, `output_hidden_states=True`, and `return_dict=False` scenarios via the standard test suite\n\n\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "author": "fumadari", "agent": "Claude_Code", "created_at": "2026-02-17T17:21:32+00:00", "closed_at": "2026-02-18T21:19:35+00:00", "html_url": "https://github.com/huggingface/transformers/pull/44102", "files": ["src/transformers/models/ibert/modeling_ibert.py"], "hunks": [["src/transformers/models/ibert/modeling_ibert.py", 25, 32], ["src/transformers/models/ibert/modeling_ibert.py", 34, 41], ["src/transformers/models/ibert/modeling_ibert.py", 221, 228], ["src/transformers/models/ibert/modeling_ibert.py", 284, 298], ["src/transformers/models/ibert/modeling_ibert.py", 353, 373], ["src/transformers/models/ibert/modeling_ibert.py", 469, 494], ["src/transformers/models/ibert/modeling_ibert.py", 518, 567], ["src/transformers/models/ibert/modeling_ibert.py", 583, 589], ["src/transformers/models/ibert/modeling_ibert.py", 656, 662], ["src/transformers/models/ibert/modeling_ibert.py", 664, 681], ["src/transformers/models/ibert/modeling_ibert.py", 703, 729], ["src/transformers/models/ibert/modeling_ibert.py", 749, 755], ["src/transformers/models/ibert/modeling_ibert.py", 758, 786], ["src/transformers/models/ibert/modeling_ibert.py", 789, 799], ["src/transformers/models/ibert/modeling_ibert.py", 840, 846], ["src/transformers/models/ibert/modeling_ibert.py", 849, 877], ["src/transformers/models/ibert/modeling_ibert.py", 897, 906], ["src/transformers/models/ibert/modeling_ibert.py", 921, 927], ["src/transformers/models/ibert/modeling_ibert.py", 930, 941], ["src/transformers/models/ibert/modeling_ibert.py", 965, 972], ["src/transformers/models/ibert/modeling_ibert.py", 984, 993], ["src/transformers/models/ibert/modeling_ibert.py", 999, 1009], ["src/transformers/models/ibert/modeling_ibert.py", 1024, 1030], ["src/transformers/models/ibert/modeling_ibert.py", 1033, 1059], ["src/transformers/models/ibert/modeling_ibert.py", 1065, 1075], ["src/transformers/models/ibert/modeling_ibert.py", 1108, 1114], ["src/transformers/models/ibert/modeling_ibert.py", 1118, 1140], ["src/transformers/models/ibert/modeling_ibert.py", 1160, 1170]], "added_hashes": [5089327059418127692, 5089327059537294923, 5089327059596398876, 5089327060137746459, 5089327060253025689, 5089327060394356839, 5089327060538193998, 5089327060783420156, 5089327061000471659, 5089327061059581583, 5089327061391055013, 5089327061407476648, 5089327061547441456, 5089327061575981582, 5089327061614259508, 5089327061629157790, 5089327061647267140, 5089327061747393816, 5089327061927894182, 5089327062335604256, 5089327062398032617, 5089327062564071298, 5089327063123243156, 5089327063184137138, 5089327063227916568, 5089327063238025932, 5089327063336751382, 5089327063350648015], "linked_issues": []}
11
+ {"number": 44104, "title": "Refactor megatron_bert to use automatic output tracing", "body": "## Summary\n- Replace manual `hidden_states`/`attentions`/`cross_attentions` collection in `MegatronBertEncoder` with the `@capture_outputs` decorator and forward hooks\n- Add `@can_return_tuple` to all 8 wrapper model classes, eliminating manual `return_dict` handling\n- Add `@merge_with_config_defaults` to `MegatronBertModel.forward` for automatic config resolution\n- Use `OutputRecorder` with `layer_name` filtering to correctly separate self-attention (`.attention`) from cross-attention (`.crossattention`) captures\n- Remove unused `BaseModelOutputWithPastAndCrossAttentions` import\n- Net reduction: **-141 lines** (66 added, 207 removed)\n\n## Details\n\nThis follows the same pattern as the reference `llama` implementation and [the ibert refactoring in #44102](https://github.com/huggingface/transformers/pull/44102). Key considerations for megatron_bert:\n\n1. **Cross-attention support**: Uses two separate `OutputRecorder` entries with `layer_name` filtering \u2014 `.attention` matches self-attention modules while `.crossattention` matches cross-attention modules\n2. **Cache support**: `MegatronBertEncoder` still returns `(hidden_states, past_key_values)` to preserve caching functionality\n3. **Gradient checkpointing**: `GradientCheckpointingLayer` continues to work via `MegatronBertLayer`\n4. **Post-LayerNorm**: The final LayerNorm in the encoder is preserved; `tie_last_hidden_states=True` (default) ensures the post-LN output replaces the last hook-captured pre-LN hidden state\n\nAll 76 local tests pass (121 skipped \u2014 expected without GPU/special dependencies).\n\nPart of #43979\n\n## Test plan\n- [x] All `tests/models/megatron_bert/` tests pass locally (76 passed, 121 skipped)\n- [ ] CI passes on full test suite\n\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "author": "fumadari", "agent": "Claude_Code", "created_at": "2026-02-17T18:43:44+00:00", "closed_at": "2026-02-18T21:19:34+00:00", "html_url": "https://github.com/huggingface/transformers/pull/44104", "files": ["src/transformers/models/megatron_bert/modeling_megatron_bert.py"], "hunks": [["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 27, 34], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 38, 46], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 128, 137], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 226, 247], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 296, 315], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 317, 338], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 359, 370], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 373, 431], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 518, 524], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 591, 597], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 603, 621], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 662, 693], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 722, 728], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 732, 743], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 764, 781], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 787, 797], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 830, 836], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 843, 856], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 870, 877], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 884, 894], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 897, 908], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 942, 948], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 953, 973], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 975, 984], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 988, 998], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1015, 1021], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1024, 1035], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1054, 1072], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1077, 1087], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1107, 1113], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1116, 1144], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1167, 1176], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1191, 1197], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1200, 1211], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1235, 1242], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1254, 1263], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1270, 1280], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1295, 1301], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1304, 1330], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1336, 1346], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1360, 1366], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1370, 1392], ["src/transformers/models/megatron_bert/modeling_megatron_bert.py", 1412, 1422]], "added_hashes": [-6829888282924452637, -6829888282884651966, -6829888282879674190, -6829888282834971547, -6829888282622239752, -6829888282478761087, -6829888282402596507, -6829888282299127129, -6829888282261701354, -6829888282245848103, -6829888282095214609, -6829888281881208924, -6829888281738354803, -6829888281632515700, -6829888281596048781, -6829888281396077397, -6829888281261431041, -6829888281045194477, -6829888281015510623, -6829888280815731475, -6829888280695830263, -6829888280519016708, -6829888280366402472, -6829888280292212838, -6829888280287064794, -6829888280275972366, -6829888280275146484, -6829888280171290754, -6829888280143614330, -6829888279842792928, -6829888279694903934, -6829888279612061592, -6829888279533720349, -6829888279517812278, -6829888279447128829, -6829888279402206120, -6829888279095052986, -6829888279047949686, -6829888278986485743, -6829888278975876276, -6829888278872000860], "linked_issues": []}
12
+ {"number": 44105, "title": "Refactor lilt to use automatic output tracing", "body": "## Summary\n- Replace manual `hidden_states`/`attentions` collection in `LiltEncoder` with the `@capture_outputs` decorator and forward hooks\n- Add `@can_return_tuple` to all 3 wrapper model classes, eliminating manual `return_dict` handling\n- Add `@merge_with_config_defaults` to `LiltModel.forward` for automatic config resolution\n- Remove unused `BaseModelOutput` import\n- Net reduction: **-88 lines** (39 added, 127 removed)\n\n## Details\n\nLiLT has a dual-branch architecture (text + layout), which requires special handling for the attention capture hook. `LiltAttention` returns a 3-tuple `(attention_output, layout_attention_output, attention_probs)`, so `OutputRecorder(LiltAttention, index=2)` is used to capture attention probs at index 2 instead of the default index 1.\n\nThe hidden states hook on `LiltLayer` correctly captures `output[0]` (text hidden states) since the layer returns `(layer_output, layout_layer_output)`.\n\nAll 79 local tests pass (112 skipped, 2 xfailed \u2014 expected without GPU/special dependencies).\n\nPart of #43979\n\n## Test plan\n- [x] All `tests/models/lilt/` tests pass locally (79 passed, 112 skipped, 2 xfailed)\n- [ ] CI passes on full test suite\n\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "author": "fumadari", "agent": "Claude_Code", "created_at": "2026-02-17T18:54:40+00:00", "closed_at": "2026-02-18T21:19:32+00:00", "html_url": "https://github.com/huggingface/transformers/pull/44105", "files": ["src/transformers/models/lilt/modeling_lilt.py"], "hunks": [["src/transformers/models/lilt/modeling_lilt.py", 23, 38], ["src/transformers/models/lilt/modeling_lilt.py", 222, 230], ["src/transformers/models/lilt/modeling_lilt.py", 278, 289], ["src/transformers/models/lilt/modeling_lilt.py", 316, 334], ["src/transformers/models/lilt/modeling_lilt.py", 384, 412], ["src/transformers/models/lilt/modeling_lilt.py", 430, 478], ["src/transformers/models/lilt/modeling_lilt.py", 496, 502], ["src/transformers/models/lilt/modeling_lilt.py", 528, 534], ["src/transformers/models/lilt/modeling_lilt.py", 537, 548], ["src/transformers/models/lilt/modeling_lilt.py", 568, 580], ["src/transformers/models/lilt/modeling_lilt.py", 614, 639], ["src/transformers/models/lilt/modeling_lilt.py", 655, 661], ["src/transformers/models/lilt/modeling_lilt.py", 665, 676], ["src/transformers/models/lilt/modeling_lilt.py", 701, 719], ["src/transformers/models/lilt/modeling_lilt.py", 742, 752], ["src/transformers/models/lilt/modeling_lilt.py", 771, 777], ["src/transformers/models/lilt/modeling_lilt.py", 781, 792], ["src/transformers/models/lilt/modeling_lilt.py", 814, 832], ["src/transformers/models/lilt/modeling_lilt.py", 840, 850], ["src/transformers/models/lilt/modeling_lilt.py", 888, 894], ["src/transformers/models/lilt/modeling_lilt.py", 899, 910], ["src/transformers/models/lilt/modeling_lilt.py", 935, 953], ["src/transformers/models/lilt/modeling_lilt.py", 973, 983]], "added_hashes": [-8876942813614601210, -8876942813589967802, -8876942813569153653, -8876942813413770187, -8876942813318332941, -8876942813264774593, -8876942812911158662, -8876942812775151855, -8876942812073377185, -8876942812019279071, -8876942811870170747, -8876942811798672485, -8876942811358980392, -8876942811154859246, -8876942811146818089, -8876942811090408979, -8876942810765900534, -8876942810638724876, -8876942810589953397, -8876942810281260051, -8876942810121883025, -8876942810118023122, -8876942810045029743, -8876942809902734088, -8876942809644677693, -8876942809506125118, -8876942809504625861, -8876942809499650101, -8876942809493571520], "linked_issues": []}
13
+ {"number": 44106, "title": "Refactor yoso to use automatic output tracing", "body": "## Summary\n- Replace manual `hidden_states`/`attentions` collection in `YosoEncoder` with the `@capture_outputs` decorator and forward hooks\n- Add `@can_return_tuple` to all 5 wrapper model classes, eliminating manual `return_dict` handling\n- Add `@merge_with_config_defaults` to `YosoModel.forward` for automatic config resolution\n- Net reduction: **-85 lines** (47 added, 132 removed)\n\n## Details\n\nYOSO uses LSH-based attention that doesn't compute traditional attention weights. The existing code returns `context_layer` as the attention proxy when `output_attentions=True`. After refactoring, `YosoSelfAttention` always returns `(context_layer, context_layer)` where the second element serves as the attention proxy for hooks.\n\nAll 73 local tests pass (125 skipped \u2014 expected without GPU/CUDA kernels).\n\nPart of #43979\n\n## Test plan\n- [x] All `tests/models/yoso/` tests pass locally (73 passed, 125 skipped)\n- [ ] CI passes on full test suite\n\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "author": "fumadari", "agent": "Claude_Code", "created_at": "2026-02-17T18:59:25+00:00", "closed_at": "2026-02-18T21:19:30+00:00", "html_url": "https://github.com/huggingface/transformers/pull/44106", "files": ["src/transformers/models/yoso/modeling_yoso.py"], "hunks": [["src/transformers/models/yoso/modeling_yoso.py", 31, 45], ["src/transformers/models/yoso/modeling_yoso.py", 328, 335], ["src/transformers/models/yoso/modeling_yoso.py", 418, 427], ["src/transformers/models/yoso/modeling_yoso.py", 444, 455], ["src/transformers/models/yoso/modeling_yoso.py", 492, 510], ["src/transformers/models/yoso/modeling_yoso.py", 522, 555], ["src/transformers/models/yoso/modeling_yoso.py", 602, 608], ["src/transformers/models/yoso/modeling_yoso.py", 632, 638], ["src/transformers/models/yoso/modeling_yoso.py", 640, 657], ["src/transformers/models/yoso/modeling_yoso.py", 681, 704], ["src/transformers/models/yoso/modeling_yoso.py", 724, 730], ["src/transformers/models/yoso/modeling_yoso.py", 733, 761], ["src/transformers/models/yoso/modeling_yoso.py", 765, 775], ["src/transformers/models/yoso/modeling_yoso.py", 814, 820], ["src/transformers/models/yoso/modeling_yoso.py", 823, 851], ["src/transformers/models/yoso/modeling_yoso.py", 872, 881], ["src/transformers/models/yoso/modeling_yoso.py", 896, 902], ["src/transformers/models/yoso/modeling_yoso.py", 905, 916], ["src/transformers/models/yoso/modeling_yoso.py", 940, 947], ["src/transformers/models/yoso/modeling_yoso.py", 959, 968], ["src/transformers/models/yoso/modeling_yoso.py", 977, 987], ["src/transformers/models/yoso/modeling_yoso.py", 1002, 1008], ["src/transformers/models/yoso/modeling_yoso.py", 1011, 1037], ["src/transformers/models/yoso/modeling_yoso.py", 1052, 1062], ["src/transformers/models/yoso/modeling_yoso.py", 1078, 1084], ["src/transformers/models/yoso/modeling_yoso.py", 1088, 1110], ["src/transformers/models/yoso/modeling_yoso.py", 1130, 1140]], "added_hashes": [5552735768704808818, 5552735768862465141, 5552735769070522279, 5552735769114623407, 5552735769215457881, 5552735769257553083, 5552735769503774914, 5552735769648658290, 5552735770201351333, 5552735770225033622, 5552735770354167381, 5552735770644149912, 5552735770684369694, 5552735770821703518, 5552735770872559374, 5552735770916662176, 5552735771065311287, 5552735771134880055, 5552735771157081118, 5552735771219439831, 5552735771348045244, 5552735771348678130, 5552735771586913379, 5552735771839552170, 5552735771931403224, 5552735772001193232, 5552735772219247500, 5552735772474913164, 5552735772529019122, 5552735772548565798, 5552735772590734120, 5552735772605948490], "linked_issues": []}
14
+ {"number": 44107, "title": "refactor(mra): use output tracing decorators", "body": "## Summary\n- Replaces manual `output_hidden_states`/`return_dict` resolution in `MraModel` with `@merge_with_config_defaults` and `@capture_outputs` decorators\n- Simplifies `MraEncoder` to a plain loop returning a single tensor, removing `BaseModelOutputWithCrossAttentions` construction\n- Adds `@can_return_tuple` to all 5 wrapper models (`MraForMaskedLM`, `MraForSequenceClassification`, `MraForMultipleChoice`, `MraForTokenClassification`, `MraForQuestionAnswering`), removing manual `return_dict` handling\n- Adds `_can_record_outputs = {\"hidden_states\": MraLayer}` to `MraPreTrainedModel` (MRA uses approximate attention with no attention weights)\n- Simplifies `MraSelfAttention`, `MraAttention`, and `MraLayer` to return plain tensors instead of tuples\n- Net reduction: **-72 lines** (40 added, 112 removed)\n\nPart of #43979\n\n## Test plan\n- [x] All 70 MRA model tests pass (`pytest tests/models/mra/ -x -q` \u2192 70 passed, 125 skipped, 3 xfailed)\n- [x] `test_capture_outputs_decorator` passes\n- [x] `test_hidden_states_output` passes\n- [x] `test_model_outputs_equivalence` passes\n- [x] `test_retain_grad_hidden_states_attentions` passes\n\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "author": "fumadari", "agent": "Claude_Code", "created_at": "2026-02-17T19:04:42+00:00", "closed_at": "2026-02-18T21:19:29+00:00", "html_url": "https://github.com/huggingface/transformers/pull/44107", "files": ["src/transformers/models/mra/modeling_mra.py"], "hunks": [["src/transformers/models/mra/modeling_mra.py", 31, 46], ["src/transformers/models/mra/modeling_mra.py", 607, 616], ["src/transformers/models/mra/modeling_mra.py", 635, 644], ["src/transformers/models/mra/modeling_mra.py", 682, 699], ["src/transformers/models/mra/modeling_mra.py", 711, 739], ["src/transformers/models/mra/modeling_mra.py", 787, 793], ["src/transformers/models/mra/modeling_mra.py", 818, 840], ["src/transformers/models/mra/modeling_mra.py", 868, 891], ["src/transformers/models/mra/modeling_mra.py", 911, 917], ["src/transformers/models/mra/modeling_mra.py", 919, 945], ["src/transformers/models/mra/modeling_mra.py", 949, 959], ["src/transformers/models/mra/modeling_mra.py", 1000, 1006], ["src/transformers/models/mra/modeling_mra.py", 1008, 1034], ["src/transformers/models/mra/modeling_mra.py", 1055, 1064], ["src/transformers/models/mra/modeling_mra.py", 1080, 1086], ["src/transformers/models/mra/modeling_mra.py", 1088, 1098], ["src/transformers/models/mra/modeling_mra.py", 1122, 1129], ["src/transformers/models/mra/modeling_mra.py", 1141, 1149], ["src/transformers/models/mra/modeling_mra.py", 1158, 1168], ["src/transformers/models/mra/modeling_mra.py", 1184, 1190], ["src/transformers/models/mra/modeling_mra.py", 1192, 1216], ["src/transformers/models/mra/modeling_mra.py", 1231, 1241], ["src/transformers/models/mra/modeling_mra.py", 1258, 1264], ["src/transformers/models/mra/modeling_mra.py", 1267, 1287], ["src/transformers/models/mra/modeling_mra.py", 1307, 1317]], "added_hashes": [-2257612089808342624, -2257612089775925674, -2257612089695155394, -2257612089629883480, -2257612089258962875, -2257612089020313478, -2257612088862606467, -2257612088771326567, -2257612088364588454, -2257612088195843203, -2257612088051059507, -2257612087612669517, -2257612087555907567, -2257612087484891944, -2257612086955784890, -2257612086908585321, -2257612086793868232, -2257612086735488255, -2257612086645250129, -2257612086477663487, -2257612086470408317, -2257612086304966873, -2257612086189310589, -2257612086128769239, -2257612086077224157, -2257612085956454747, -2257612085572683215], "linked_issues": []}
15
+ {"number": 44108, "title": "refactor(vitdet): use output tracing decorators", "body": "## Summary\n- Adds `@merge_with_config_defaults` and `@capture_outputs` to both `VitDetModel` and `VitDetBackbone`, removing manual `output_attentions`/`return_dict` resolution\n- Adds `_can_record_outputs = {\"attentions\": VitDetAttention}` to `VitDetPreTrainedModel` for automatic attention capture via hooks\n- Simplifies `VitDetAttention` to always return `(hidden_state, attention_probs)`, removing the `output_attentions` parameter\n- Simplifies `VitDetLayer` to return a single tensor instead of a tuple\n- Simplifies `VitDetEncoder` to a clean loop, removing `output_attentions` and `return_dict` parameters (keeps `output_hidden_states` for backbone use)\n- Net reduction: **-49 lines** (33 added, 82 removed)\n\nPart of #43979\n\n## Test plan\n- [x] All 75 VitDet tests pass (`pytest tests/models/vitdet/ -x -q` \u2192 75 passed, 125 skipped)\n- [x] `test_capture_outputs_decorator` passes\n- [x] `test_attention_outputs` passes\n- [x] `test_hidden_states_output` passes\n- [x] `test_model_outputs_equivalence` passes\n- [x] `test_retain_grad_hidden_states_attentions` passes\n- [x] `test_backbone` and all backbone tests pass\n\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "author": "fumadari", "agent": "Claude_Code", "created_at": "2026-02-17T19:15:00+00:00", "closed_at": "2026-02-18T21:19:27+00:00", "html_url": "https://github.com/huggingface/transformers/pull/44108", "files": ["src/transformers/models/vitdet/modeling_vitdet.py"], "hunks": [["src/transformers/models/vitdet/modeling_vitdet.py", 25, 32], ["src/transformers/models/vitdet/modeling_vitdet.py", 227, 234], ["src/transformers/models/vitdet/modeling_vitdet.py", 249, 264], ["src/transformers/models/vitdet/modeling_vitdet.py", 471, 482], ["src/transformers/models/vitdet/modeling_vitdet.py", 487, 499], ["src/transformers/models/vitdet/modeling_vitdet.py", 508, 517], ["src/transformers/models/vitdet/modeling_vitdet.py", 539, 572], ["src/transformers/models/vitdet/modeling_vitdet.py", 577, 583], ["src/transformers/models/vitdet/modeling_vitdet.py", 622, 636], ["src/transformers/models/vitdet/modeling_vitdet.py", 649, 660], ["src/transformers/models/vitdet/modeling_vitdet.py", 662, 681], ["src/transformers/models/vitdet/modeling_vitdet.py", 698, 711], ["src/transformers/models/vitdet/modeling_vitdet.py", 725, 764]], "added_hashes": [5456407606453039082, 5456407606475340686, 5456407606760656143, 5456407606834732765, 5456407606932927962, 5456407606954687707, 5456407607392795787, 5456407607489604861, 5456407607573449481, 5456407607787467104, 5456407607821196744, 5456407607835631011, 5456407608184017120, 5456407608206707642, 5456407608281283178, 5456407608379825066, 5456407608756289765, 5456407608791206364, 5456407609050260286, 5456407609127876006, 5456407609490241920, 5456407609605108516, 5456407609669890584, 5456407609800705760, 5456407609823595547, 5456407609916984269], "linked_issues": []}
16
+ {"number": 44109, "title": "refactor(hgnet_v2): use capture_outputs for output tracing", "body": "## Summary\n- Part of #43979 \u2014 refactors `hgnet_v2` to use the `capture_outputs` and `merge_with_config_defaults` decorators\n- Simplifies `HGNetV2Encoder` by removing `return_dict` parameter (always returns `BaseModelOutputWithNoAttention`)\n- Adds `@capture_outputs` + `@merge_with_config_defaults` to `HGNetV2Backbone` and `HGNetV2ForImageClassification`\n- Removes manual `return_dict` handling from backbone and classifier forward methods\n- Edits applied to `modular_hgnet_v2.py` and regenerated `modeling_hgnet_v2.py`\n- Net change: 48 added, 87 removed (-39 lines)\n\n## Test plan\n- [x] All 68 model tests pass (`pytest tests/models/hgnet_v2/ -x -q`)\n- [x] Modular conversion produces correct output\n- [x] `output_hidden_states` works both via kwarg and config\n\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "author": "fumadari", "agent": "Claude_Code", "created_at": "2026-02-17T19:23:03+00:00", "closed_at": "2026-02-18T21:19:25+00:00", "html_url": "https://github.com/huggingface/transformers/pull/44109", "files": ["src/transformers/models/hgnet_v2/modeling_hgnet_v2.py", "src/transformers/models/hgnet_v2/modular_hgnet_v2.py"], "hunks": [["src/transformers/models/hgnet_v2/modeling_hgnet_v2.py", 28, 35], ["src/transformers/models/hgnet_v2/modeling_hgnet_v2.py", 315, 341], ["src/transformers/models/hgnet_v2/modeling_hgnet_v2.py", 351, 364], ["src/transformers/models/hgnet_v2/modeling_hgnet_v2.py", 378, 410], ["src/transformers/models/hgnet_v2/modeling_hgnet_v2.py", 429, 443], ["src/transformers/models/hgnet_v2/modeling_hgnet_v2.py", 465, 478], ["src/transformers/models/hgnet_v2/modeling_hgnet_v2.py", 480, 490], ["src/transformers/models/hgnet_v2/modular_hgnet_v2.py", 26, 35], ["src/transformers/models/hgnet_v2/modular_hgnet_v2.py", 436, 462], ["src/transformers/models/hgnet_v2/modular_hgnet_v2.py", 472, 485], ["src/transformers/models/hgnet_v2/modular_hgnet_v2.py", 499, 531], ["src/transformers/models/hgnet_v2/modular_hgnet_v2.py", 550, 564], ["src/transformers/models/hgnet_v2/modular_hgnet_v2.py", 586, 599], ["src/transformers/models/hgnet_v2/modular_hgnet_v2.py", 601, 611]], "added_hashes": [-8285188549780500290, -8285188549595811967, -8285188549291097948, -8285188549217806788, -8285188548726930593, -8285188548701287273, -8285188548478490042, -8285188548477786868, -8285188547995457238, -8285188547918751248, -8285188547596841113, -8285188547561505715, -8285188547307569582, -8285188547209806521, -8285188546971844646, -8285188546470758461, -8285188546470507634, -8285188546180518251, -1917609468994300990, -1917609468910277379, -1917609468738639422, -1917609468159918045, -1917609467929767957, -1917609467877218704, -1917609467875792582, -1917609467600010280, -1917609467409246912, -1917609466909524175, -1917609466878800869, -1917609466639893202, -1917609466220451242, -1917609466024207732, -1917609465853381441, -1917609465853130510, -1917609465610359319, -1917609465382371781], "linked_issues": []}
17
+ {"number": 44110, "title": "refactor(tvp): use capture_outputs for output tracing", "body": "## Summary\n- Part of #43979 \u2014 refactors `tvp` to use the `capture_outputs`, `can_return_tuple`, and `merge_with_config_defaults` decorators\n- Simplifies `TvpAttention` to always return `(output, attention_probs)` (hooks decide what to capture)\n- Simplifies `TvpEncodeLayer` and `TvpEncoder` to plain forward without output collection logic\n- Adds `_can_record_outputs = {\"hidden_states\": TvpEncodeLayer, \"attentions\": TvpAttention}` to `TvpPreTrainedModel`\n- Adds `@capture_outputs` to `TvpModel`, `@can_return_tuple` to `TvpForVideoGrounding`\n- Net change: 28 added, 101 removed (-73 lines)\n\n## Test plan\n- [x] All 82 model tests pass (`pytest tests/models/tvp/ -x -q`)\n- [x] `test_capture_outputs_decorator` passes\n- [x] `test_hidden_states_output` and `test_attention_outputs` pass\n- [x] `test_retain_grad_hidden_states_attentions` passes\n\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "author": "fumadari", "agent": "Claude_Code", "created_at": "2026-02-17T19:32:55+00:00", "closed_at": "2026-02-18T21:19:24+00:00", "html_url": "https://github.com/huggingface/transformers/pull/44110", "files": ["src/transformers/models/tvp/modeling_tvp.py"], "hunks": [["src/transformers/models/tvp/modeling_tvp.py", 23, 32], ["src/transformers/models/tvp/modeling_tvp.py", 349, 361], ["src/transformers/models/tvp/modeling_tvp.py", 385, 394], ["src/transformers/models/tvp/modeling_tvp.py", 427, 450], ["src/transformers/models/tvp/modeling_tvp.py", 453, 502], ["src/transformers/models/tvp/modeling_tvp.py", 520, 526], ["src/transformers/models/tvp/modeling_tvp.py", 709, 727], ["src/transformers/models/tvp/modeling_tvp.py", 735, 742], ["src/transformers/models/tvp/modeling_tvp.py", 761, 785], ["src/transformers/models/tvp/modeling_tvp.py", 810, 829], ["src/transformers/models/tvp/modeling_tvp.py", 840, 857], ["src/transformers/models/tvp/modeling_tvp.py", 863, 874]], "added_hashes": [-6234949597182208704, -6234949597111276482, -6234949597082969226, -6234949597067075612, -6234949596687936574, -6234949596492174358, -6234949596260447961, -6234949596209635997, -6234949595866478382, -6234949595852480167, -6234949595692275344, -6234949595536700687, -6234949595321508850, -6234949595176725570, -6234949595075097959, -6234949594974353019, -6234949594657974751, -6234949594493185090, -6234949594419889991, -6234949594383516668, -6234949593925434604, -6234949593674360367, -6234949593658283157, -6234949593529532779], "linked_issues": []}
18
+ {"number": 44111, "title": "refactor(poolformer): use capture_outputs for output tracing", "body": "## Summary\n- Part of #43979 \u2014 refactors `poolformer` to use the `capture_outputs`, `can_return_tuple`, and `merge_with_config_defaults` decorators\n- Simplifies `PoolFormerLayer` to return a single tensor instead of a 1-tuple\n- Simplifies `PoolFormerEncoder` by removing `return_dict` (always returns `BaseModelOutputWithNoAttention`)\n- Adds `@capture_outputs` to `PoolFormerModel`, `@can_return_tuple` to `PoolFormerForImageClassification`\n- Net change: 30 added, 59 removed (-29 lines)\n\n## Test plan\n- [x] All 99 model tests pass (`pytest tests/models/poolformer/ -x -q`)\n- [x] `test_hidden_states_output` passes\n- [x] `test_model_outputs_equivalence` passes\n\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "author": "fumadari", "agent": "Claude_Code", "created_at": "2026-02-17T19:38:02+00:00", "closed_at": "2026-02-18T21:19:22+00:00", "html_url": "https://github.com/huggingface/transformers/pull/44111", "files": ["src/transformers/models/poolformer/modeling_poolformer.py"], "hunks": [["src/transformers/models/poolformer/modeling_poolformer.py", 22, 29], ["src/transformers/models/poolformer/modeling_poolformer.py", 146, 174], ["src/transformers/models/poolformer/modeling_poolformer.py", 214, 240], ["src/transformers/models/poolformer/modeling_poolformer.py", 272, 306], ["src/transformers/models/poolformer/modeling_poolformer.py", 341, 382]], "added_hashes": [1922564869589174629, 1922564869944313428, 1922564870038217381, 1922564870068524823, 1922564870121456002, 1922564870171672253, 1922564870191229905, 1922564870766868543, 1922564870962146983, 1922564870970605591, 1922564870995385558, 1922564871237862469, 1922564871322195887, 1922564871502583078, 1922564871529052147, 1922564871710711161, 1922564871940752878, 1922564872140345425, 1922564872167868217, 1922564872179472711, 1922564872354275684, 1922564872969897039, 1922564873043415876, 1922564873234890902, 1922564873363117416, 1922564873378214179, 1922564873425198286, 1922564873527546611], "linked_issues": []}
19
+ {"number": 44133, "title": "refactor(poolformer): use capture_outputs for output tracing", "body": "Migrated from https://github.com/huggingface/transformers/pull/44111 (original account: @fumadari).\n\n## Summary\n- Part of #43979 \u2014 refactors `poolformer` to use the `capture_outputs`, `can_return_tuple`, and `merge_with_config_defaults` decorators\n- Simplifies `PoolFormerLayer` to return a single tensor instead of a 1-tuple\n- Simplifies `PoolFormerEncoder` by removing `return_dict` (always returns `BaseModelOutputWithNoAttention`)\n- Adds `@capture_outputs` to `PoolFormerModel`, `@can_return_tuple` to `PoolFormerForImageClassification`\n- Net change: 30 added, 59 removed (-29 lines)\n\n## Test plan\n- [x] All 99 model tests pass (`pytest tests/models/poolformer/ -x -q`)\n- [x] `test_hidden_states_output` passes\n- [x] `test_model_outputs_equivalence` passes\n\n\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)\n", "author": "dario-fumarola", "agent": "Claude_Code", "created_at": "2026-02-18T21:12:22+00:00", "closed_at": "2026-02-22T02:28:52+00:00", "html_url": "https://github.com/huggingface/transformers/pull/44133", "files": ["src/transformers/models/poolformer/modeling_poolformer.py"], "hunks": [["src/transformers/models/poolformer/modeling_poolformer.py", 22, 29], ["src/transformers/models/poolformer/modeling_poolformer.py", 146, 174], ["src/transformers/models/poolformer/modeling_poolformer.py", 214, 240], ["src/transformers/models/poolformer/modeling_poolformer.py", 272, 306], ["src/transformers/models/poolformer/modeling_poolformer.py", 341, 382]], "added_hashes": [1922564869589174629, 1922564869944313428, 1922564870038217381, 1922564870068524823, 1922564870121456002, 1922564870171672253, 1922564870191229905, 1922564870766868543, 1922564870962146983, 1922564870970605591, 1922564870995385558, 1922564871237862469, 1922564871322195887, 1922564871502583078, 1922564871529052147, 1922564871710711161, 1922564871940752878, 1922564872140345425, 1922564872167868217, 1922564872179472711, 1922564872354275684, 1922564872969897039, 1922564873043415876, 1922564873234890902, 1922564873363117416, 1922564873378214179, 1922564873425198286, 1922564873527546611], "linked_issues": []}
@@ -0,0 +1,64 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "rd0-jinx"
7
+ version = "0.1.0"
8
+ description = "Jinx: duplicate pull-request warnings for coding-agent PRs. The first tool in rd0, a toolkit for review debt."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ dependencies = []
14
+ keywords = [
15
+ "pull-request",
16
+ "duplicate-detection",
17
+ "code-review",
18
+ "review-debt",
19
+ "github-action",
20
+ "coding-agents",
21
+ "static-analysis",
22
+ ]
23
+ authors = [
24
+ { name = "Harshul Jain" },
25
+ { name = "Saurabh Yergattikar" },
26
+ { name = "Tanya Sah" },
27
+ { name = "Parv Khatri" },
28
+ ]
29
+ classifiers = [
30
+ "Development Status :: 4 - Beta",
31
+ "Intended Audience :: Developers",
32
+ "Operating System :: OS Independent",
33
+ "Programming Language :: Python :: 3",
34
+ "Programming Language :: Python :: 3.9",
35
+ "Programming Language :: Python :: 3.10",
36
+ "Programming Language :: Python :: 3.11",
37
+ "Programming Language :: Python :: 3.12",
38
+ "Programming Language :: Python :: 3.13",
39
+ "Topic :: Software Development :: Quality Assurance",
40
+ "Topic :: Software Development :: Version Control :: Git",
41
+ "Typing :: Typed",
42
+ ]
43
+
44
+ [project.urls]
45
+ Homepage = "https://rd0.ai"
46
+ Source = "https://github.com/harshuljain13/rd0-jinx"
47
+ Issues = "https://github.com/harshuljain13/rd0-jinx/issues"
48
+ Changelog = "https://github.com/harshuljain13/rd0-jinx/releases"
49
+
50
+ [project.optional-dependencies]
51
+ embed = ["sentence-transformers>=2.2"]
52
+ dev = ["pytest", "ruff"]
53
+
54
+ [project.scripts]
55
+ jinx = "rd0_jinx.cli:main"
56
+
57
+ [tool.setuptools.packages.find]
58
+ where = ["src"]
59
+
60
+ [tool.setuptools.package-data]
61
+ rd0_jinx = ["data/*.json", "py.typed"]
62
+
63
+ [tool.pytest.ini_options]
64
+ pythonpath = ["src", "tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,6 @@
1
+ from .pr import PR
2
+ from .scorer import Detector, Match
3
+ from .templates import TemplateModel
4
+
5
+ __all__ = ["PR", "Detector", "Match", "TemplateModel"]
6
+ __version__ = "0.1.0"