url string | repository_url string | labels_url string | comments_url string | events_url string | html_url string | id int64 | node_id string | number int64 | title string | user dict | labels list | state string | locked bool | assignee dict | assignees list | milestone null | comments list | created_at timestamp[ms] | updated_at timestamp[ms] | closed_at timestamp[ms] | author_association string | type dict | active_lock_reason null | draft bool | pull_request dict | body string | closed_by dict | reactions dict | timeline_url string | performed_via_github_app null | state_reason string | sub_issues_summary dict | issue_dependencies_summary dict | is_pull_request bool | is_closed bool |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
https://api.github.com/repos/huggingface/transformers/issues/40240 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40240/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40240/comments | https://api.github.com/repos/huggingface/transformers/issues/40240/events | https://github.com/huggingface/transformers/pull/40240 | 3,329,519,741 | PR_kwDOCUB6oc6kDByA | 40,240 | docs: Update TrOCR model card to new format | {
"login": "AceHunterr",
"id": 88583647,
"node_id": "MDQ6VXNlcjg4NTgzNjQ3",
"avatar_url": "https://avatars.githubusercontent.com/u/88583647?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/AceHunterr",
"html_url": "https://github.com/AceHunterr",
"followers_url": "https://api.github.com/users/AceHunterr/followers",
"following_url": "https://api.github.com/users/AceHunterr/following{/other_user}",
"gists_url": "https://api.github.com/users/AceHunterr/gists{/gist_id}",
"starred_url": "https://api.github.com/users/AceHunterr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AceHunterr/subscriptions",
"organizations_url": "https://api.github.com/users/AceHunterr/orgs",
"repos_url": "https://api.github.com/users/AceHunterr/repos",
"events_url": "https://api.github.com/users/AceHunterr/events{/privacy}",
"received_events_url": "https://api.github.com/users/AceHunterr/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-18T07:25:24 | 2025-08-19T19:22:35 | 2025-08-19T16:17:46 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40240",
"html_url": "https://github.com/huggingface/transformers/pull/40240",
"diff_url": "https://github.com/huggingface/transformers/pull/40240.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40240.patch",
"merged_at": "2025-08-19T16:17:46"
} | # What does this PR do?
<!--
Congratulations! You've made it this far! You're not quite done yet though.
Once 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.
Then, 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.
Once 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.
-->
<!-- Remove if not applicable -->
Fixes #36979
Updated the TROCR.md file to the standardised format for documentation.
## Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [x] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@stevhliu
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Models:
- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier
Library:
- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
Documentation: @stevhliu
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
Maintained examples (not research project or legacy):
- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1
-->
| {
"login": "stevhliu",
"id": 59462357,
"node_id": "MDQ6VXNlcjU5NDYyMzU3",
"avatar_url": "https://avatars.githubusercontent.com/u/59462357?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stevhliu",
"html_url": "https://github.com/stevhliu",
"followers_url": "https://api.github.com/users/stevhliu/followers",
"following_url": "https://api.github.com/users/stevhliu/following{/other_user}",
"gists_url": "https://api.github.com/users/stevhliu/gists{/gist_id}",
"starred_url": "https://api.github.com/users/stevhliu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stevhliu/subscriptions",
"organizations_url": "https://api.github.com/users/stevhliu/orgs",
"repos_url": "https://api.github.com/users/stevhliu/repos",
"events_url": "https://api.github.com/users/stevhliu/events{/privacy}",
"received_events_url": "https://api.github.com/users/stevhliu/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40240/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40240/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40239 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40239/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40239/comments | https://api.github.com/repos/huggingface/transformers/issues/40239/events | https://github.com/huggingface/transformers/issues/40239 | 3,329,374,176 | I_kwDOCUB6oc7Gcjfg | 40,239 | Please remove the redundant dependency jieba: rjieba does the same and has better performance | {
"login": "yurivict",
"id": 271906,
"node_id": "MDQ6VXNlcjI3MTkwNg==",
"avatar_url": "https://avatars.githubusercontent.com/u/271906?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yurivict",
"html_url": "https://github.com/yurivict",
"followers_url": "https://api.github.com/users/yurivict/followers",
"following_url": "https://api.github.com/users/yurivict/following{/other_user}",
"gists_url": "https://api.github.com/users/yurivict/gists{/gist_id}",
"starred_url": "https://api.github.com/users/yurivict/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yurivict/subscriptions",
"organizations_url": "https://api.github.com/users/yurivict/orgs",
"repos_url": "https://api.github.com/users/yurivict/repos",
"events_url": "https://api.github.com/users/yurivict/events{/privacy}",
"received_events_url": "https://api.github.com/users/yurivict/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 1990918270,
"node_id": "MDU6TGFiZWwxOTkwOTE4Mjcw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/Good%20First%20Issue",
"name": "Good First Issue",
"color": "bbf794",
"default": false,
"description": ""
}
] | closed | false | null | [] | null | [] | 2025-08-18T06:36:23 | 2025-08-30T11:28:53 | 2025-08-30T11:28:53 | NONE | null | null | null | null | ### System Info
see subject
### Who can help?
see subject
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
see subject
### Expected behavior
see subject | {
"login": "ydshieh",
"id": 2521628,
"node_id": "MDQ6VXNlcjI1MjE2Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ydshieh",
"html_url": "https://github.com/ydshieh",
"followers_url": "https://api.github.com/users/ydshieh/followers",
"following_url": "https://api.github.com/users/ydshieh/following{/other_user}",
"gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions",
"organizations_url": "https://api.github.com/users/ydshieh/orgs",
"repos_url": "https://api.github.com/users/ydshieh/repos",
"events_url": "https://api.github.com/users/ydshieh/events{/privacy}",
"received_events_url": "https://api.github.com/users/ydshieh/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40239/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40239/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40238 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40238/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40238/comments | https://api.github.com/repos/huggingface/transformers/issues/40238/events | https://github.com/huggingface/transformers/pull/40238 | 3,329,349,819 | PR_kwDOCUB6oc6kCeqq | 40,238 | Fix type annotation error in DepthPro model image processor | {
"login": "MengAiDev",
"id": 202287492,
"node_id": "U_kgDODA6phA",
"avatar_url": "https://avatars.githubusercontent.com/u/202287492?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/MengAiDev",
"html_url": "https://github.com/MengAiDev",
"followers_url": "https://api.github.com/users/MengAiDev/followers",
"following_url": "https://api.github.com/users/MengAiDev/following{/other_user}",
"gists_url": "https://api.github.com/users/MengAiDev/gists{/gist_id}",
"starred_url": "https://api.github.com/users/MengAiDev/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MengAiDev/subscriptions",
"organizations_url": "https://api.github.com/users/MengAiDev/orgs",
"repos_url": "https://api.github.com/users/MengAiDev/repos",
"events_url": "https://api.github.com/users/MengAiDev/events{/privacy}",
"received_events_url": "https://api.github.com/users/MengAiDev/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-18T06:26:34 | 2025-08-18T14:42:29 | 2025-08-18T14:42:13 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40238",
"html_url": "https://github.com/huggingface/transformers/pull/40238",
"diff_url": "https://github.com/huggingface/transformers/pull/40238.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40238.patch",
"merged_at": "2025-08-18T14:42:13"
} | # What does this PR do?
Fix type annotation error in DepthPro model image processor
Fixes #40235
@amyeroberts, @qubvel @stevhliu
| {
"login": "qubvel",
"id": 31920396,
"node_id": "MDQ6VXNlcjMxOTIwMzk2",
"avatar_url": "https://avatars.githubusercontent.com/u/31920396?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/qubvel",
"html_url": "https://github.com/qubvel",
"followers_url": "https://api.github.com/users/qubvel/followers",
"following_url": "https://api.github.com/users/qubvel/following{/other_user}",
"gists_url": "https://api.github.com/users/qubvel/gists{/gist_id}",
"starred_url": "https://api.github.com/users/qubvel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/qubvel/subscriptions",
"organizations_url": "https://api.github.com/users/qubvel/orgs",
"repos_url": "https://api.github.com/users/qubvel/repos",
"events_url": "https://api.github.com/users/qubvel/events{/privacy}",
"received_events_url": "https://api.github.com/users/qubvel/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40238/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40238/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40237 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40237/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40237/comments | https://api.github.com/repos/huggingface/transformers/issues/40237/events | https://github.com/huggingface/transformers/pull/40237 | 3,329,171,574 | PR_kwDOCUB6oc6kB7EP | 40,237 | add print for tensor after each level | {
"login": "jthakurH",
"id": 152950604,
"node_id": "U_kgDOCR3XTA",
"avatar_url": "https://avatars.githubusercontent.com/u/152950604?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jthakurH",
"html_url": "https://github.com/jthakurH",
"followers_url": "https://api.github.com/users/jthakurH/followers",
"following_url": "https://api.github.com/users/jthakurH/following{/other_user}",
"gists_url": "https://api.github.com/users/jthakurH/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jthakurH/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jthakurH/subscriptions",
"organizations_url": "https://api.github.com/users/jthakurH/orgs",
"repos_url": "https://api.github.com/users/jthakurH/repos",
"events_url": "https://api.github.com/users/jthakurH/events{/privacy}",
"received_events_url": "https://api.github.com/users/jthakurH/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-18T05:02:22 | 2025-08-19T04:02:34 | 2025-08-18T12:51:35 | NONE | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40237",
"html_url": "https://github.com/huggingface/transformers/pull/40237",
"diff_url": "https://github.com/huggingface/transformers/pull/40237.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40237.patch",
"merged_at": null
} | # What does this PR do?
<!--
Congratulations! You've made it this far! You're not quite done yet though.
Once 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.
Then, 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.
Once 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.
-->
<!-- Remove if not applicable -->
Fixes # (issue)
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Models:
- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier
Library:
- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
Documentation: @stevhliu
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
Maintained examples (not research project or legacy):
- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1
-->
| {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40237/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40237/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40236 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40236/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40236/comments | https://api.github.com/repos/huggingface/transformers/issues/40236/events | https://github.com/huggingface/transformers/issues/40236 | 3,328,991,036 | I_kwDOCUB6oc7GbF88 | 40,236 | Training support for the MXFP4 Quantization Method | {
"login": "InfiniteInbox",
"id": 77806168,
"node_id": "MDQ6VXNlcjc3ODA2MTY4",
"avatar_url": "https://avatars.githubusercontent.com/u/77806168?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/InfiniteInbox",
"html_url": "https://github.com/InfiniteInbox",
"followers_url": "https://api.github.com/users/InfiniteInbox/followers",
"following_url": "https://api.github.com/users/InfiniteInbox/following{/other_user}",
"gists_url": "https://api.github.com/users/InfiniteInbox/gists{/gist_id}",
"starred_url": "https://api.github.com/users/InfiniteInbox/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/InfiniteInbox/subscriptions",
"organizations_url": "https://api.github.com/users/InfiniteInbox/orgs",
"repos_url": "https://api.github.com/users/InfiniteInbox/repos",
"events_url": "https://api.github.com/users/InfiniteInbox/events{/privacy}",
"received_events_url": "https://api.github.com/users/InfiniteInbox/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 2648621985,
"node_id": "MDU6TGFiZWwyNjQ4NjIxOTg1",
"url": "https://api.github.com/repos/huggingface/transformers/labels/Feature%20request",
"name": "Feature request",
"color": "FBCA04",
"default": false,
"description": "Request for a new feature"
}
] | closed | false | null | [] | null | [] | 2025-08-18T02:55:55 | 2025-08-24T11:45:51 | 2025-08-18T12:46:57 | NONE | null | null | null | null | ### Feature request
Request for the ability to train MXFP4 Quantized models.
### Motivation
Hello! I am currently trying to create a script that fine tunes GPT OSS 20B and wished to fine tune it on some of my own data.
<img width="851" height="29" alt="Image" src="https://github.com/user-attachments/assets/e0c92453-a12c-4c99-b85d-7a36329bc5c8" />
### Your contribution
Here is a working code snippet assuming the feature is added
`from transformers import AutoModelForCausalLM, AutoTokenizer, TrainingArguments, Trainer`
`from peft import LoraConfig, get_peft_model`
`model_id = "openai/gpt-oss-20b"`
`tokenizer = AutoTokenizer.from_pretrained(model_id)`
`model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype="auto")`
`lora_config = LoraConfig(r=8, lora_alpha=16, target_modules=["q_proj","v_proj"], task_type="CAUSAL_LM")`
`model = get_peft_model(model, lora_config)`
`training_args = TrainingArguments(output_dir="./out", per_device_train_batch_size=1, num_train_epochs=1)`
`trainer = Trainer(model=model, args=training_args, train_dataset=[{"input_ids":[1,2,3], "labels":[1,2,3]}])` | {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40236/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40236/timeline | null | duplicate | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40235 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40235/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40235/comments | https://api.github.com/repos/huggingface/transformers/issues/40235/events | https://github.com/huggingface/transformers/issues/40235 | 3,328,990,116 | I_kwDOCUB6oc7GbFuk | 40,235 | Type annotation error in DepthPro model image processor | {
"login": "soyosaki",
"id": 189066510,
"node_id": "U_kgDOC0TtDg",
"avatar_url": "https://avatars.githubusercontent.com/u/189066510?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/soyosaki",
"html_url": "https://github.com/soyosaki",
"followers_url": "https://api.github.com/users/soyosaki/followers",
"following_url": "https://api.github.com/users/soyosaki/following{/other_user}",
"gists_url": "https://api.github.com/users/soyosaki/gists{/gist_id}",
"starred_url": "https://api.github.com/users/soyosaki/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/soyosaki/subscriptions",
"organizations_url": "https://api.github.com/users/soyosaki/orgs",
"repos_url": "https://api.github.com/users/soyosaki/repos",
"events_url": "https://api.github.com/users/soyosaki/events{/privacy}",
"received_events_url": "https://api.github.com/users/soyosaki/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-18T02:55:12 | 2025-08-18T14:42:14 | 2025-08-18T14:42:14 | NONE | null | null | null | null | ### System Info
irrelevant
### Who can help?
_No response_
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
https://github.com/huggingface/transformers/blob/cd22550692cabffb037b7e5a956e8da3cbbb2b67/src/transformers/models/depth_pro/image_processing_depth_pro_fast.py#L109
### Expected behavior
The type annotation should be consistent with the type annotation in the docstring, i.e., `List[Dict[str, TensorType]]`, which provides the correct return type | {
"login": "qubvel",
"id": 31920396,
"node_id": "MDQ6VXNlcjMxOTIwMzk2",
"avatar_url": "https://avatars.githubusercontent.com/u/31920396?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/qubvel",
"html_url": "https://github.com/qubvel",
"followers_url": "https://api.github.com/users/qubvel/followers",
"following_url": "https://api.github.com/users/qubvel/following{/other_user}",
"gists_url": "https://api.github.com/users/qubvel/gists{/gist_id}",
"starred_url": "https://api.github.com/users/qubvel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/qubvel/subscriptions",
"organizations_url": "https://api.github.com/users/qubvel/orgs",
"repos_url": "https://api.github.com/users/qubvel/repos",
"events_url": "https://api.github.com/users/qubvel/events{/privacy}",
"received_events_url": "https://api.github.com/users/qubvel/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40235/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40235/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40234 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40234/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40234/comments | https://api.github.com/repos/huggingface/transformers/issues/40234/events | https://github.com/huggingface/transformers/pull/40234 | 3,328,748,027 | PR_kwDOCUB6oc6kAhV9 | 40,234 | Correct typo and update notes in docs Readme | {
"login": "PavloFesenko",
"id": 16855796,
"node_id": "MDQ6VXNlcjE2ODU1Nzk2",
"avatar_url": "https://avatars.githubusercontent.com/u/16855796?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/PavloFesenko",
"html_url": "https://github.com/PavloFesenko",
"followers_url": "https://api.github.com/users/PavloFesenko/followers",
"following_url": "https://api.github.com/users/PavloFesenko/following{/other_user}",
"gists_url": "https://api.github.com/users/PavloFesenko/gists{/gist_id}",
"starred_url": "https://api.github.com/users/PavloFesenko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/PavloFesenko/subscriptions",
"organizations_url": "https://api.github.com/users/PavloFesenko/orgs",
"repos_url": "https://api.github.com/users/PavloFesenko/repos",
"events_url": "https://api.github.com/users/PavloFesenko/events{/privacy}",
"received_events_url": "https://api.github.com/users/PavloFesenko/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-17T23:17:33 | 2025-08-18T18:02:05 | 2025-08-18T17:31:12 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40234",
"html_url": "https://github.com/huggingface/transformers/pull/40234",
"diff_url": "https://github.com/huggingface/transformers/pull/40234.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40234.patch",
"merged_at": "2025-08-18T17:31:12"
} | Fixes #40229
## Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
## Who can review?
@stevhliu
## Changes
- Corrected the typo for the deprecated flag `[docs]` and added the note for possible dependency issues.
- Updated the note formatting to the [GitHub alerts style](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts).
- Added the important remark for `[[autodoc]]` that was breaking CI/CD tests in this PR #40074. | {
"login": "stevhliu",
"id": 59462357,
"node_id": "MDQ6VXNlcjU5NDYyMzU3",
"avatar_url": "https://avatars.githubusercontent.com/u/59462357?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stevhliu",
"html_url": "https://github.com/stevhliu",
"followers_url": "https://api.github.com/users/stevhliu/followers",
"following_url": "https://api.github.com/users/stevhliu/following{/other_user}",
"gists_url": "https://api.github.com/users/stevhliu/gists{/gist_id}",
"starred_url": "https://api.github.com/users/stevhliu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stevhliu/subscriptions",
"organizations_url": "https://api.github.com/users/stevhliu/orgs",
"repos_url": "https://api.github.com/users/stevhliu/repos",
"events_url": "https://api.github.com/users/stevhliu/events{/privacy}",
"received_events_url": "https://api.github.com/users/stevhliu/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40234/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40234/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40233 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40233/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40233/comments | https://api.github.com/repos/huggingface/transformers/issues/40233/events | https://github.com/huggingface/transformers/pull/40233 | 3,328,703,574 | PR_kwDOCUB6oc6kAYms | 40,233 | docs: Update OLMo model card | {
"login": "rafakatri",
"id": 81170796,
"node_id": "MDQ6VXNlcjgxMTcwNzk2",
"avatar_url": "https://avatars.githubusercontent.com/u/81170796?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rafakatri",
"html_url": "https://github.com/rafakatri",
"followers_url": "https://api.github.com/users/rafakatri/followers",
"following_url": "https://api.github.com/users/rafakatri/following{/other_user}",
"gists_url": "https://api.github.com/users/rafakatri/gists{/gist_id}",
"starred_url": "https://api.github.com/users/rafakatri/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rafakatri/subscriptions",
"organizations_url": "https://api.github.com/users/rafakatri/orgs",
"repos_url": "https://api.github.com/users/rafakatri/repos",
"events_url": "https://api.github.com/users/rafakatri/events{/privacy}",
"received_events_url": "https://api.github.com/users/rafakatri/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-17T22:05:50 | 2025-08-18T20:35:40 | 2025-08-18T20:35:40 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40233",
"html_url": "https://github.com/huggingface/transformers/pull/40233",
"diff_url": "https://github.com/huggingface/transformers/pull/40233.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40233.patch",
"merged_at": "2025-08-18T20:35:40"
} | # What does this PR do?
<!--
Congratulations! You've made it this far! You're not quite done yet though.
Once 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.
Then, 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.
Once 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.
-->
<!-- Remove if not applicable -->
#36979
This PR updates the OLMo model card according to the guidelines of #36979.
## Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case. https://github.com/huggingface/transformers/issues/36979
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Models:
- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier
Library:
- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
Documentation: @stevhliu
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
Maintained examples (not research project or legacy):
- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1
-->
| {
"login": "stevhliu",
"id": 59462357,
"node_id": "MDQ6VXNlcjU5NDYyMzU3",
"avatar_url": "https://avatars.githubusercontent.com/u/59462357?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stevhliu",
"html_url": "https://github.com/stevhliu",
"followers_url": "https://api.github.com/users/stevhliu/followers",
"following_url": "https://api.github.com/users/stevhliu/following{/other_user}",
"gists_url": "https://api.github.com/users/stevhliu/gists{/gist_id}",
"starred_url": "https://api.github.com/users/stevhliu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stevhliu/subscriptions",
"organizations_url": "https://api.github.com/users/stevhliu/orgs",
"repos_url": "https://api.github.com/users/stevhliu/repos",
"events_url": "https://api.github.com/users/stevhliu/events{/privacy}",
"received_events_url": "https://api.github.com/users/stevhliu/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40233/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40233/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40232 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40232/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40232/comments | https://api.github.com/repos/huggingface/transformers/issues/40232/events | https://github.com/huggingface/transformers/pull/40232 | 3,328,702,781 | PR_kwDOCUB6oc6kAYcp | 40,232 | Fix chat CLI GPU loading and request_id validation issues (#40230) | {
"login": "robin-ede",
"id": 115729295,
"node_id": "U_kgDOBuXjjw",
"avatar_url": "https://avatars.githubusercontent.com/u/115729295?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/robin-ede",
"html_url": "https://github.com/robin-ede",
"followers_url": "https://api.github.com/users/robin-ede/followers",
"following_url": "https://api.github.com/users/robin-ede/following{/other_user}",
"gists_url": "https://api.github.com/users/robin-ede/gists{/gist_id}",
"starred_url": "https://api.github.com/users/robin-ede/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/robin-ede/subscriptions",
"organizations_url": "https://api.github.com/users/robin-ede/orgs",
"repos_url": "https://api.github.com/users/robin-ede/repos",
"events_url": "https://api.github.com/users/robin-ede/events{/privacy}",
"received_events_url": "https://api.github.com/users/robin-ede/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-17T22:04:31 | 2025-08-28T12:01:50 | 2025-08-19T15:33:44 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40232",
"html_url": "https://github.com/huggingface/transformers/pull/40232",
"diff_url": "https://github.com/huggingface/transformers/pull/40232.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40232.patch",
"merged_at": "2025-08-19T15:33:44"
} | ## What does this PR do?
This PR fixes two critical bugs in the `transformers chat` CLI that prevent users from using chat:
### Issue 1: Chat CLI doesn't use GPU by default
**Problem**: The chat CLI was defaulting to CPU inference even when GPUs are available, leading to slow performance.
**Root Cause**: The `device` parameter in `ChatArguments` was hardcoded to `"cpu"` instead of `"auto"`.
**Solution**: Changed the default from `"cpu"` to `"auto"` in `src/transformers/commands/chat.py:249` to match the serving backend behavior.
### Issue 2: Chat breaks on second message with validation error
**Problem**: After the first message, subsequent messages fail with error: `"Unexpected keys in the request: {'request_id'}"`
**Root Cause**: The chat client sends a `request_id` field in the request body, but the server's validation schema (`TransformersCompletionCreateParamsStreaming`) doesn't recognize this field as valid.
**Solution**: Added `request_id: Optional[str] = None` to the schema in `src/transformers/commands/serving.py:128` to allow this field to pass validation.
## Testing
- ✅ Code quality checks passed (`ruff check`, `ruff format`)
- ✅ Existing chat CLI tests continue to pass
- ✅ Verified device default now returns "auto" instead of "cpu"
- ✅ Verified request_id field is properly added to validation schema
Fixes #40230
## Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [x] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?
## Who can review?
- @SunMarc (CLI and serving infrastructure)
- @Rocketknight1 (CLI tools and user experience) | {
"login": "gante",
"id": 12240844,
"node_id": "MDQ6VXNlcjEyMjQwODQ0",
"avatar_url": "https://avatars.githubusercontent.com/u/12240844?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/gante",
"html_url": "https://github.com/gante",
"followers_url": "https://api.github.com/users/gante/followers",
"following_url": "https://api.github.com/users/gante/following{/other_user}",
"gists_url": "https://api.github.com/users/gante/gists{/gist_id}",
"starred_url": "https://api.github.com/users/gante/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gante/subscriptions",
"organizations_url": "https://api.github.com/users/gante/orgs",
"repos_url": "https://api.github.com/users/gante/repos",
"events_url": "https://api.github.com/users/gante/events{/privacy}",
"received_events_url": "https://api.github.com/users/gante/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40232/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40232/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40231 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40231/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40231/comments | https://api.github.com/repos/huggingface/transformers/issues/40231/events | https://github.com/huggingface/transformers/issues/40231 | 3,328,660,185 | I_kwDOCUB6oc7GZ1LZ | 40,231 | pytest-* dependencies shouldn't be run-time dependencies | {
"login": "yurivict",
"id": 271906,
"node_id": "MDQ6VXNlcjI3MTkwNg==",
"avatar_url": "https://avatars.githubusercontent.com/u/271906?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yurivict",
"html_url": "https://github.com/yurivict",
"followers_url": "https://api.github.com/users/yurivict/followers",
"following_url": "https://api.github.com/users/yurivict/following{/other_user}",
"gists_url": "https://api.github.com/users/yurivict/gists{/gist_id}",
"starred_url": "https://api.github.com/users/yurivict/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yurivict/subscriptions",
"organizations_url": "https://api.github.com/users/yurivict/orgs",
"repos_url": "https://api.github.com/users/yurivict/repos",
"events_url": "https://api.github.com/users/yurivict/events{/privacy}",
"received_events_url": "https://api.github.com/users/yurivict/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-17T20:54:49 | 2025-08-18T12:44:37 | 2025-08-18T12:44:37 | NONE | null | null | null | null | ### System Info
any
### Who can help?
[here](https://github.com/huggingface/transformers/blob/main/setup.py#L154)
pytest is a test framework and pytest-* packages should be test dependencies, not run-time dependencies.
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
n/a
### Expected behavior
n/a | {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40231/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40231/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40230 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40230/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40230/comments | https://api.github.com/repos/huggingface/transformers/issues/40230/events | https://github.com/huggingface/transformers/issues/40230 | 3,328,624,927 | I_kwDOCUB6oc7GZskf | 40,230 | Transfomers chat cli doesnt load on gpu and breaks on second message | {
"login": "Mcilie",
"id": 25804313,
"node_id": "MDQ6VXNlcjI1ODA0MzEz",
"avatar_url": "https://avatars.githubusercontent.com/u/25804313?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Mcilie",
"html_url": "https://github.com/Mcilie",
"followers_url": "https://api.github.com/users/Mcilie/followers",
"following_url": "https://api.github.com/users/Mcilie/following{/other_user}",
"gists_url": "https://api.github.com/users/Mcilie/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Mcilie/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Mcilie/subscriptions",
"organizations_url": "https://api.github.com/users/Mcilie/orgs",
"repos_url": "https://api.github.com/users/Mcilie/repos",
"events_url": "https://api.github.com/users/Mcilie/events{/privacy}",
"received_events_url": "https://api.github.com/users/Mcilie/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-17T19:59:42 | 2025-08-19T15:33:45 | 2025-08-19T15:33:45 | NONE | null | null | null | null | ### System Info
Env output:
```
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
I0000 00:00:1755460445.899071 9198 gpu_device.cc:2019] Created device /device:GPU:0 with 94404 MB memory: -> device: 0, name: NVIDIA GH200 480GB, pci bus id: 0000:dd:00.0, compute capability: 9.0
Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.
- `transformers` version: 4.55.2
- Platform: Linux-6.8.0-1013-nvidia-64k-aarch64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.34.4
- Safetensors version: 0.6.2
- Accelerate version: 1.10.0
- Accelerate config: - compute_environment: LOCAL_MACHINE
- distributed_type: NO
- mixed_precision: bf16
- use_cpu: False
- debug: False
- num_processes: 1
- machine_rank: 0
- num_machines: 1
- gpu_ids: all
- rdzv_backend: static
- same_network: True
- main_training_function: main
- enable_cpu_affinity: False
- downcast_bf16: no
- tpu_use_cluster: False
- tpu_use_sudo: False
- tpu_env: []
- DeepSpeed version: not installed
- PyTorch version (accelerator?): 2.7.0 (CUDA)
- Tensorflow version (GPU?): 2.19.0 (True)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?: <fill in>
- Using GPU in script?: <fill in>
- GPU type: NVIDIA GH200 480GB
```
### Who can help?
_No response_
### Information
- [x] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [x] My own task or dataset (give details below)
### Reproduction
2 issues:
1) whenever i run `transformers chat .` on the model I just finetuned it doesn't load on the gpu for some reason.
2) When i submit the second message, the cli chat breaks and gives me the following error:
Steps to repro:
run `transformers chat .` on a local model/finetune (in this case gemma3 270m, but any model should do this) and try sending atleast 2 messages.
```
Unexpected keys in the request: {'request_id'}
Traceback (most recent call last):
File "/home/ubuntu/.local/bin/transformers", line 8, in <module>
sys.exit(main())
File "/home/ubuntu/.local/lib/python3.10/site-packages/transformers/commands/transformers_cli.py", line 59, in main
service.run()
File "/home/ubuntu/.local/lib/python3.10/site-packages/transformers/commands/chat.py", line 643, in run
asyncio.run(self._inner_run())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/ubuntu/.local/lib/python3.10/site-packages/transformers/commands/chat.py", line 728, in _inner_run
model_output, request_id = await interface.stream_output(stream)
File "/home/ubuntu/.local/lib/python3.10/site-packages/transformers/commands/chat.py", line 129, in stream_output
async for token in await stream:
File "/home/ubuntu/.local/lib/python3.10/site-packages/huggingface_hub/inference/_generated/_async_client.py", line 963, in chat_completion
data = await self._inner_post(request_parameters, stream=stream)
File "/home/ubuntu/.local/lib/python3.10/site-packages/huggingface_hub/inference/_generated/_async_client.py", line 289, in _inner_post
raise error
File "/home/ubuntu/.local/lib/python3.10/site-packages/huggingface_hub/inference/_generated/_async_client.py", line 275, in _inner_post
response.raise_for_status()
File "/home/ubuntu/.local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 629, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 422, message='Unprocessable Entity', url='http://localhost:8000/v1/chat/completions'
```
### Expected behavior
its expected to load the model on GPU and not break after 2 messages | {
"login": "gante",
"id": 12240844,
"node_id": "MDQ6VXNlcjEyMjQwODQ0",
"avatar_url": "https://avatars.githubusercontent.com/u/12240844?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/gante",
"html_url": "https://github.com/gante",
"followers_url": "https://api.github.com/users/gante/followers",
"following_url": "https://api.github.com/users/gante/following{/other_user}",
"gists_url": "https://api.github.com/users/gante/gists{/gist_id}",
"starred_url": "https://api.github.com/users/gante/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gante/subscriptions",
"organizations_url": "https://api.github.com/users/gante/orgs",
"repos_url": "https://api.github.com/users/gante/repos",
"events_url": "https://api.github.com/users/gante/events{/privacy}",
"received_events_url": "https://api.github.com/users/gante/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40230/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40230/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40229 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40229/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40229/comments | https://api.github.com/repos/huggingface/transformers/issues/40229/events | https://github.com/huggingface/transformers/issues/40229 | 3,328,587,733 | I_kwDOCUB6oc7GZjfV | 40,229 | Typo in the docs/README.md | {
"login": "PavloFesenko",
"id": 16855796,
"node_id": "MDQ6VXNlcjE2ODU1Nzk2",
"avatar_url": "https://avatars.githubusercontent.com/u/16855796?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/PavloFesenko",
"html_url": "https://github.com/PavloFesenko",
"followers_url": "https://api.github.com/users/PavloFesenko/followers",
"following_url": "https://api.github.com/users/PavloFesenko/following{/other_user}",
"gists_url": "https://api.github.com/users/PavloFesenko/gists{/gist_id}",
"starred_url": "https://api.github.com/users/PavloFesenko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/PavloFesenko/subscriptions",
"organizations_url": "https://api.github.com/users/PavloFesenko/orgs",
"repos_url": "https://api.github.com/users/PavloFesenko/repos",
"events_url": "https://api.github.com/users/PavloFesenko/events{/privacy}",
"received_events_url": "https://api.github.com/users/PavloFesenko/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-17T19:02:53 | 2025-08-18T17:31:13 | 2025-08-18T17:31:13 | CONTRIBUTOR | null | null | null | null | As discovered by @sahil-kabir, the first paragraph in `docs/README.md` mentions the flag `[docs]` but this flag has been removed long time ago from `setup.py` (see [this commit](https://github.com/huggingface/transformers/commit/307f632bb2fa39f6f8dcd54644d55edd461d73d0)).
https://github.com/huggingface/transformers/blob/cd22550692cabffb037b7e5a956e8da3cbbb2b67/docs/README.md?plain=1#L19-L24
Instead the correct flag should be `[dev]` but with the remark about dependency issues for other OS than Linux according to the section "Create a Pull Request" (point 4) in `CONTRIBUTING.md`
https://github.com/huggingface/transformers/blob/cd22550692cabffb037b7e5a956e8da3cbbb2b67/CONTRIBUTING.md?plain=1#L157-L175
@stevhliu I'm happy to submit a quick PR to correct this typo if you agree. 😊 | {
"login": "stevhliu",
"id": 59462357,
"node_id": "MDQ6VXNlcjU5NDYyMzU3",
"avatar_url": "https://avatars.githubusercontent.com/u/59462357?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stevhliu",
"html_url": "https://github.com/stevhliu",
"followers_url": "https://api.github.com/users/stevhliu/followers",
"following_url": "https://api.github.com/users/stevhliu/following{/other_user}",
"gists_url": "https://api.github.com/users/stevhliu/gists{/gist_id}",
"starred_url": "https://api.github.com/users/stevhliu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stevhliu/subscriptions",
"organizations_url": "https://api.github.com/users/stevhliu/orgs",
"repos_url": "https://api.github.com/users/stevhliu/repos",
"events_url": "https://api.github.com/users/stevhliu/events{/privacy}",
"received_events_url": "https://api.github.com/users/stevhliu/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40229/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40229/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40228 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40228/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40228/comments | https://api.github.com/repos/huggingface/transformers/issues/40228/events | https://github.com/huggingface/transformers/pull/40228 | 3,328,504,121 | PR_kwDOCUB6oc6j_xtL | 40,228 | Make dataclasses dependency conditional for python<3.7 | {
"login": "badwriter123",
"id": 91039605,
"node_id": "MDQ6VXNlcjkxMDM5NjA1",
"avatar_url": "https://avatars.githubusercontent.com/u/91039605?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/badwriter123",
"html_url": "https://github.com/badwriter123",
"followers_url": "https://api.github.com/users/badwriter123/followers",
"following_url": "https://api.github.com/users/badwriter123/following{/other_user}",
"gists_url": "https://api.github.com/users/badwriter123/gists{/gist_id}",
"starred_url": "https://api.github.com/users/badwriter123/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/badwriter123/subscriptions",
"organizations_url": "https://api.github.com/users/badwriter123/orgs",
"repos_url": "https://api.github.com/users/badwriter123/repos",
"events_url": "https://api.github.com/users/badwriter123/events{/privacy}",
"received_events_url": "https://api.github.com/users/badwriter123/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-17T17:11:17 | 2025-08-18T11:49:13 | 2025-08-18T11:49:13 | NONE | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40228",
"html_url": "https://github.com/huggingface/transformers/pull/40228",
"diff_url": "https://github.com/huggingface/transformers/pull/40228.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40228.patch",
"merged_at": null
} | ### Summary ###
This PR updates the dataclasses dependency to only be installed for Python versions less than 3.7, since dataclasses became part of the Python standard library starting with Python 3.7.
### Changes ###
1. Modified setup.py to add python_version<'3.7' marker to the dataclasses dependency.
2. Updated dependency_versions_table.py via make deps_table_update.
### Why This Change ###
1. The dataclasses package is only needed as a backport for Python < 3.7
2. For Python 3.7+, the built-in dataclasses module should be used instead.
3. This reduces unnecessary dependencies for modern Python versions.
4. The project already requires Python >= 3.9.0, so this dependency is currently redundant for all supported versions.
Before : "dataclasses",
After : "dataclasses;python_version<'3.7'",
| {
"login": "vasqu",
"id": 73884904,
"node_id": "MDQ6VXNlcjczODg0OTA0",
"avatar_url": "https://avatars.githubusercontent.com/u/73884904?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vasqu",
"html_url": "https://github.com/vasqu",
"followers_url": "https://api.github.com/users/vasqu/followers",
"following_url": "https://api.github.com/users/vasqu/following{/other_user}",
"gists_url": "https://api.github.com/users/vasqu/gists{/gist_id}",
"starred_url": "https://api.github.com/users/vasqu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vasqu/subscriptions",
"organizations_url": "https://api.github.com/users/vasqu/orgs",
"repos_url": "https://api.github.com/users/vasqu/repos",
"events_url": "https://api.github.com/users/vasqu/events{/privacy}",
"received_events_url": "https://api.github.com/users/vasqu/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40228/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40228/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40227 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40227/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40227/comments | https://api.github.com/repos/huggingface/transformers/issues/40227/events | https://github.com/huggingface/transformers/issues/40227 | 3,328,116,426 | I_kwDOCUB6oc7GXwbK | 40,227 | The 'dataclasses' dependency should be marked for python<3.7 | {
"login": "yurivict",
"id": 271906,
"node_id": "MDQ6VXNlcjI3MTkwNg==",
"avatar_url": "https://avatars.githubusercontent.com/u/271906?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yurivict",
"html_url": "https://github.com/yurivict",
"followers_url": "https://api.github.com/users/yurivict/followers",
"following_url": "https://api.github.com/users/yurivict/following{/other_user}",
"gists_url": "https://api.github.com/users/yurivict/gists{/gist_id}",
"starred_url": "https://api.github.com/users/yurivict/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yurivict/subscriptions",
"organizations_url": "https://api.github.com/users/yurivict/orgs",
"repos_url": "https://api.github.com/users/yurivict/repos",
"events_url": "https://api.github.com/users/yurivict/events{/privacy}",
"received_events_url": "https://api.github.com/users/yurivict/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-17T08:30:03 | 2025-08-18T11:51:47 | 2025-08-18T11:51:46 | NONE | null | null | null | null | ### System Info
Currently this dependency is unconditional.
See https://pypi.org/project/dataclasses/
### Who can help?
_No response_
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
n/a
### Expected behavior
n/a | {
"login": "vasqu",
"id": 73884904,
"node_id": "MDQ6VXNlcjczODg0OTA0",
"avatar_url": "https://avatars.githubusercontent.com/u/73884904?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vasqu",
"html_url": "https://github.com/vasqu",
"followers_url": "https://api.github.com/users/vasqu/followers",
"following_url": "https://api.github.com/users/vasqu/following{/other_user}",
"gists_url": "https://api.github.com/users/vasqu/gists{/gist_id}",
"starred_url": "https://api.github.com/users/vasqu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vasqu/subscriptions",
"organizations_url": "https://api.github.com/users/vasqu/orgs",
"repos_url": "https://api.github.com/users/vasqu/repos",
"events_url": "https://api.github.com/users/vasqu/events{/privacy}",
"received_events_url": "https://api.github.com/users/vasqu/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40227/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40227/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40226 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40226/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40226/comments | https://api.github.com/repos/huggingface/transformers/issues/40226/events | https://github.com/huggingface/transformers/pull/40226 | 3,328,077,406 | PR_kwDOCUB6oc6j-j0H | 40,226 | Use correct `model_input_names` for PixtralImageProcessor | {
"login": "rohitrango",
"id": 15312514,
"node_id": "MDQ6VXNlcjE1MzEyNTE0",
"avatar_url": "https://avatars.githubusercontent.com/u/15312514?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rohitrango",
"html_url": "https://github.com/rohitrango",
"followers_url": "https://api.github.com/users/rohitrango/followers",
"following_url": "https://api.github.com/users/rohitrango/following{/other_user}",
"gists_url": "https://api.github.com/users/rohitrango/gists{/gist_id}",
"starred_url": "https://api.github.com/users/rohitrango/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rohitrango/subscriptions",
"organizations_url": "https://api.github.com/users/rohitrango/orgs",
"repos_url": "https://api.github.com/users/rohitrango/repos",
"events_url": "https://api.github.com/users/rohitrango/events{/privacy}",
"received_events_url": "https://api.github.com/users/rohitrango/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-17T07:44:05 | 2025-08-18T08:07:34 | 2025-08-18T08:06:53 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40226",
"html_url": "https://github.com/huggingface/transformers/pull/40226",
"diff_url": "https://github.com/huggingface/transformers/pull/40226.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40226.patch",
"merged_at": "2025-08-18T08:06:53"
} | # What does this PR do?
Returned tensors from the PixtralProcessor does not match the list in `model_input_names` (useful for inferring expected tensor keys).
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Models:
- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier
Library:
- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
Documentation: @stevhliu
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
Maintained examples (not research project or legacy):
- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1
-->
| {
"login": "zucchini-nlp",
"id": 100715397,
"node_id": "U_kgDOBgDLhQ",
"avatar_url": "https://avatars.githubusercontent.com/u/100715397?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/zucchini-nlp",
"html_url": "https://github.com/zucchini-nlp",
"followers_url": "https://api.github.com/users/zucchini-nlp/followers",
"following_url": "https://api.github.com/users/zucchini-nlp/following{/other_user}",
"gists_url": "https://api.github.com/users/zucchini-nlp/gists{/gist_id}",
"starred_url": "https://api.github.com/users/zucchini-nlp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/zucchini-nlp/subscriptions",
"organizations_url": "https://api.github.com/users/zucchini-nlp/orgs",
"repos_url": "https://api.github.com/users/zucchini-nlp/repos",
"events_url": "https://api.github.com/users/zucchini-nlp/events{/privacy}",
"received_events_url": "https://api.github.com/users/zucchini-nlp/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40226/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40226/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40225 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40225/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40225/comments | https://api.github.com/repos/huggingface/transformers/issues/40225/events | https://github.com/huggingface/transformers/pull/40225 | 3,327,980,335 | PR_kwDOCUB6oc6j-UdB | 40,225 | docs: clarify decoder_input_ids vs decoder_inputs_embeds usage (#39542) | {
"login": "Wricha",
"id": 113756570,
"node_id": "U_kgDOBsfJmg",
"avatar_url": "https://avatars.githubusercontent.com/u/113756570?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Wricha",
"html_url": "https://github.com/Wricha",
"followers_url": "https://api.github.com/users/Wricha/followers",
"following_url": "https://api.github.com/users/Wricha/following{/other_user}",
"gists_url": "https://api.github.com/users/Wricha/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Wricha/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Wricha/subscriptions",
"organizations_url": "https://api.github.com/users/Wricha/orgs",
"repos_url": "https://api.github.com/users/Wricha/repos",
"events_url": "https://api.github.com/users/Wricha/events{/privacy}",
"received_events_url": "https://api.github.com/users/Wricha/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | [] | 2025-08-17T05:31:33 | 2025-08-17T05:31:33 | null | NONE | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40225",
"html_url": "https://github.com/huggingface/transformers/pull/40225",
"diff_url": "https://github.com/huggingface/transformers/pull/40225.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40225.patch",
"merged_at": null
} | This PR adds a note under PreTrainedModel clarifying that seq2seq models
such as MarianMT, BART, and T5 accept either decoder_input_ids or
decoder_inputs_embeds, but not both. Passing both arguments raises a
ValueError.
This addresses issue #39542.
| null | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40225/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40225/timeline | null | null | null | null | true | false |
https://api.github.com/repos/huggingface/transformers/issues/40224 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40224/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40224/comments | https://api.github.com/repos/huggingface/transformers/issues/40224/events | https://github.com/huggingface/transformers/issues/40224 | 3,327,558,664 | I_kwDOCUB6oc7GVoQI | 40,224 | Gemma RMSNorm weight init should init with 0 | {
"login": "albertz",
"id": 59132,
"node_id": "MDQ6VXNlcjU5MTMy",
"avatar_url": "https://avatars.githubusercontent.com/u/59132?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/albertz",
"html_url": "https://github.com/albertz",
"followers_url": "https://api.github.com/users/albertz/followers",
"following_url": "https://api.github.com/users/albertz/following{/other_user}",
"gists_url": "https://api.github.com/users/albertz/gists{/gist_id}",
"starred_url": "https://api.github.com/users/albertz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertz/subscriptions",
"organizations_url": "https://api.github.com/users/albertz/orgs",
"repos_url": "https://api.github.com/users/albertz/repos",
"events_url": "https://api.github.com/users/albertz/events{/privacy}",
"received_events_url": "https://api.github.com/users/albertz/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-16T19:11:03 | 2025-09-30T12:17:52 | 2025-09-30T12:17:52 | NONE | null | null | null | null | ### System Info
Looking at current master code.
### Who can help?
@ArthurZucker
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
The current code for weight initialization:
```python
def _init_weights(self, module):
...
elif (
isinstance(
module, (nn.LayerNorm, nn.RMSNorm, nn.GroupNorm, nn.BatchNorm1d, nn.BatchNorm2d, nn.BatchNorm3d)
)
or "LayerNorm" in module.__class__.__name__
or "RMSNorm" in module.__class__.__name__
):
# Norms can exist without weights (in which case they are None from torch primitives)
if hasattr(module, "weight") and module.weight is not None:
module.weight.data.fill_(1.0)
...
```
That was recently changed in b16688e96a3b3e1e7a701cd5284a850c696c108e. Before, e.g. Gemma3 had this custom code:
```python
elif isinstance(module, Gemma3RMSNorm):
module.weight.data.fill_(1.0)
```
So the behavior has not changed (in this case).
However, this initialization is wrong (both now and before b16688e96), at least for `Gemma3RMSNorm`. This is because `Gemma3RMSNorm.forward` uses this code:
```python
output = output * (1.0 + self.weight.float())
```
The `weight` should be initialized to 0, not 1.
`Gemma3RMSNorm.__init__` actually does it correctly:
```python
self.weight = nn.Parameter(torch.zeros(dim))
```
Gemma2 and Gemma have the same issue. (But Gemma3n does not.) RecurrentGemma as well.
I browsed through a couple other model implementations but have not seen this issue elsewhere.
### Expected behavior
Param init of `Gemma3RMSNorm.weight` (and also other Gemmas except Gemma3n) should init with 0. | {
"login": "albertz",
"id": 59132,
"node_id": "MDQ6VXNlcjU5MTMy",
"avatar_url": "https://avatars.githubusercontent.com/u/59132?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/albertz",
"html_url": "https://github.com/albertz",
"followers_url": "https://api.github.com/users/albertz/followers",
"following_url": "https://api.github.com/users/albertz/following{/other_user}",
"gists_url": "https://api.github.com/users/albertz/gists{/gist_id}",
"starred_url": "https://api.github.com/users/albertz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertz/subscriptions",
"organizations_url": "https://api.github.com/users/albertz/orgs",
"repos_url": "https://api.github.com/users/albertz/repos",
"events_url": "https://api.github.com/users/albertz/events{/privacy}",
"received_events_url": "https://api.github.com/users/albertz/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40224/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40224/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40223 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40223/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40223/comments | https://api.github.com/repos/huggingface/transformers/issues/40223/events | https://github.com/huggingface/transformers/pull/40223 | 3,327,435,141 | PR_kwDOCUB6oc6j8tPb | 40,223 | Fix typo and improved documentation formatting | {
"login": "sreenathab95",
"id": 54317472,
"node_id": "MDQ6VXNlcjU0MzE3NDcy",
"avatar_url": "https://avatars.githubusercontent.com/u/54317472?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sreenathab95",
"html_url": "https://github.com/sreenathab95",
"followers_url": "https://api.github.com/users/sreenathab95/followers",
"following_url": "https://api.github.com/users/sreenathab95/following{/other_user}",
"gists_url": "https://api.github.com/users/sreenathab95/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sreenathab95/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sreenathab95/subscriptions",
"organizations_url": "https://api.github.com/users/sreenathab95/orgs",
"repos_url": "https://api.github.com/users/sreenathab95/repos",
"events_url": "https://api.github.com/users/sreenathab95/events{/privacy}",
"received_events_url": "https://api.github.com/users/sreenathab95/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-16T16:41:41 | 2025-08-18T12:36:18 | 2025-08-18T12:36:02 | NONE | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40223",
"html_url": "https://github.com/huggingface/transformers/pull/40223",
"diff_url": "https://github.com/huggingface/transformers/pull/40223.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40223.patch",
"merged_at": null
} | # What does this PR do?
This pull request includes minor edits to the Transformers documentation:
- Adjusted formatting for clarity and readability
- Ensures consistency with existing documentation style
These changes are only documentation edits and do not affect any code.
<!-- Remove if not applicable -->
Fixes # (issue)
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Models:
- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier
Library:
- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
Documentation: @stevhliu
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
Maintained examples (not research project or legacy):
- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1
-->
| {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40223/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40223/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40222 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40222/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40222/comments | https://api.github.com/repos/huggingface/transformers/issues/40222/events | https://github.com/huggingface/transformers/pull/40222 | 3,327,416,919 | PR_kwDOCUB6oc6j8pr9 | 40,222 | Standardize RAG model card | {
"login": "aayush226",
"id": 44861043,
"node_id": "MDQ6VXNlcjQ0ODYxMDQz",
"avatar_url": "https://avatars.githubusercontent.com/u/44861043?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/aayush226",
"html_url": "https://github.com/aayush226",
"followers_url": "https://api.github.com/users/aayush226/followers",
"following_url": "https://api.github.com/users/aayush226/following{/other_user}",
"gists_url": "https://api.github.com/users/aayush226/gists{/gist_id}",
"starred_url": "https://api.github.com/users/aayush226/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aayush226/subscriptions",
"organizations_url": "https://api.github.com/users/aayush226/orgs",
"repos_url": "https://api.github.com/users/aayush226/repos",
"events_url": "https://api.github.com/users/aayush226/events{/privacy}",
"received_events_url": "https://api.github.com/users/aayush226/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-16T16:17:16 | 2025-08-19T16:16:10 | 2025-08-19T16:16:10 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40222",
"html_url": "https://github.com/huggingface/transformers/pull/40222",
"diff_url": "https://github.com/huggingface/transformers/pull/40222.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40222.patch",
"merged_at": "2025-08-19T16:16:10"
} | # What does this PR do?
<!--
Congratulations! You've made it this far! You're not quite done yet though.
Once 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.
Then, 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.
Once 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.
-->
This PR updates rag.md to follow the new Hugging Face model card template.
What & why
- Add friendly overview written for new users
- Add AutoModel usage examples
- Include a quantization snippet with BitsAndBytesConfig
Scope
- Docs only: docs/source/en/model_doc/rag.md
- Autodoc/API sections are unchanged as mentioned in the guidelines
Related
- Part of the “standardize model cards” effort (#36979).
## Before submitting
- [x] This PR fixes a typo or improves the docs
- [x] Did I read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
## Who can review?
@stevhliu
| {
"login": "stevhliu",
"id": 59462357,
"node_id": "MDQ6VXNlcjU5NDYyMzU3",
"avatar_url": "https://avatars.githubusercontent.com/u/59462357?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stevhliu",
"html_url": "https://github.com/stevhliu",
"followers_url": "https://api.github.com/users/stevhliu/followers",
"following_url": "https://api.github.com/users/stevhliu/following{/other_user}",
"gists_url": "https://api.github.com/users/stevhliu/gists{/gist_id}",
"starred_url": "https://api.github.com/users/stevhliu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stevhliu/subscriptions",
"organizations_url": "https://api.github.com/users/stevhliu/orgs",
"repos_url": "https://api.github.com/users/stevhliu/repos",
"events_url": "https://api.github.com/users/stevhliu/events{/privacy}",
"received_events_url": "https://api.github.com/users/stevhliu/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40222/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40222/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40221 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40221/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40221/comments | https://api.github.com/repos/huggingface/transformers/issues/40221/events | https://github.com/huggingface/transformers/pull/40221 | 3,327,328,354 | PR_kwDOCUB6oc6j8YEL | 40,221 | FIX: enable load_best_model_at_end within SaveStrategy.BEST and initialize metric_for_best_model as loss when SaveStrategy.BEST | {
"login": "thechaos16",
"id": 16028452,
"node_id": "MDQ6VXNlcjE2MDI4NDUy",
"avatar_url": "https://avatars.githubusercontent.com/u/16028452?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/thechaos16",
"html_url": "https://github.com/thechaos16",
"followers_url": "https://api.github.com/users/thechaos16/followers",
"following_url": "https://api.github.com/users/thechaos16/following{/other_user}",
"gists_url": "https://api.github.com/users/thechaos16/gists{/gist_id}",
"starred_url": "https://api.github.com/users/thechaos16/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/thechaos16/subscriptions",
"organizations_url": "https://api.github.com/users/thechaos16/orgs",
"repos_url": "https://api.github.com/users/thechaos16/repos",
"events_url": "https://api.github.com/users/thechaos16/events{/privacy}",
"received_events_url": "https://api.github.com/users/thechaos16/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | [] | 2025-08-16T14:28:33 | 2025-08-30T05:11:27 | null | NONE | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40221",
"html_url": "https://github.com/huggingface/transformers/pull/40221",
"diff_url": "https://github.com/huggingface/transformers/pull/40221.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40221.patch",
"merged_at": null
} | # What does this PR do?
- enable `load_best_model_at_end` when even if `save_strategy` is `best`
- beforehand, it doesn't show any error, but it doesn't load the best, but the last (because `self.state.best_global_step` wasn't updated)
- enable `metric_for_best_model` when `save_strategy` is `best`
- `metric_for_best_model` is initialized as `loss` when `load_best_model_at_end` is enabled, but not if `save_strategy` is set as `best`. I think these two behaviors should be the same.
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@zach-huggingface, @SunMarc and @qgallouedec
| null | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40221/reactions",
"total_count": 1,
"+1": 1,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40221/timeline | null | null | null | null | true | false |
https://api.github.com/repos/huggingface/transformers/issues/40220 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40220/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40220/comments | https://api.github.com/repos/huggingface/transformers/issues/40220/events | https://github.com/huggingface/transformers/pull/40220 | 3,327,291,497 | PR_kwDOCUB6oc6j8Q4Y | 40,220 | fix: adjust cache_position handling with attention_mask | {
"login": "Krish0909",
"id": 134591243,
"node_id": "U_kgDOCAWzCw",
"avatar_url": "https://avatars.githubusercontent.com/u/134591243?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Krish0909",
"html_url": "https://github.com/Krish0909",
"followers_url": "https://api.github.com/users/Krish0909/followers",
"following_url": "https://api.github.com/users/Krish0909/following{/other_user}",
"gists_url": "https://api.github.com/users/Krish0909/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Krish0909/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Krish0909/subscriptions",
"organizations_url": "https://api.github.com/users/Krish0909/orgs",
"repos_url": "https://api.github.com/users/Krish0909/repos",
"events_url": "https://api.github.com/users/Krish0909/events{/privacy}",
"received_events_url": "https://api.github.com/users/Krish0909/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-16T13:41:23 | 2025-08-22T06:14:09 | 2025-08-22T06:14:09 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40220",
"html_url": "https://github.com/huggingface/transformers/pull/40220",
"diff_url": "https://github.com/huggingface/transformers/pull/40220.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40220.patch",
"merged_at": null
} | What does this PR do?
This PR fixes an issue with incorrect masking behavior in the model.
The fix ensures that masked tokens are correctly handled during training and inference.
Fixes #40214
Motivation
Previously, the masking logic led to unintended behavior, which could cause incorrect attention patterns. This PR introduces the proper masking mechanism to align with expected model functionality.
Before submitting
This PR fixes a bug (masking issue).
I have read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request).
Who can review?
@ArthurZucker (text models)
@Rocketknight1 (trainer / general review) | {
"login": "Krish0909",
"id": 134591243,
"node_id": "U_kgDOCAWzCw",
"avatar_url": "https://avatars.githubusercontent.com/u/134591243?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Krish0909",
"html_url": "https://github.com/Krish0909",
"followers_url": "https://api.github.com/users/Krish0909/followers",
"following_url": "https://api.github.com/users/Krish0909/following{/other_user}",
"gists_url": "https://api.github.com/users/Krish0909/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Krish0909/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Krish0909/subscriptions",
"organizations_url": "https://api.github.com/users/Krish0909/orgs",
"repos_url": "https://api.github.com/users/Krish0909/repos",
"events_url": "https://api.github.com/users/Krish0909/events{/privacy}",
"received_events_url": "https://api.github.com/users/Krish0909/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40220/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40220/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40219 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40219/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40219/comments | https://api.github.com/repos/huggingface/transformers/issues/40219/events | https://github.com/huggingface/transformers/issues/40219 | 3,327,192,171 | I_kwDOCUB6oc7GUOxr | 40,219 | Non-deterministic Trainer behavior | {
"login": "AmitMY",
"id": 5757359,
"node_id": "MDQ6VXNlcjU3NTczNTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/5757359?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/AmitMY",
"html_url": "https://github.com/AmitMY",
"followers_url": "https://api.github.com/users/AmitMY/followers",
"following_url": "https://api.github.com/users/AmitMY/following{/other_user}",
"gists_url": "https://api.github.com/users/AmitMY/gists{/gist_id}",
"starred_url": "https://api.github.com/users/AmitMY/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AmitMY/subscriptions",
"organizations_url": "https://api.github.com/users/AmitMY/orgs",
"repos_url": "https://api.github.com/users/AmitMY/repos",
"events_url": "https://api.github.com/users/AmitMY/events{/privacy}",
"received_events_url": "https://api.github.com/users/AmitMY/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-16T11:30:36 | 2025-09-24T09:49:26 | 2025-09-24T09:49:26 | NONE | null | null | null | null | ### System Info
- `transformers` version: 4.55.0.dev0
- Platform: macOS-15.6-arm64-arm-64bit
- Python version: 3.12.2
- Huggingface_hub version: 0.34.3
- Safetensors version: 0.5.3
- Accelerate version: 1.9.0
- Accelerate config: not found
- DeepSpeed version: not installed
- PyTorch version (accelerator?): 2.7.1 (NA)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?: <fill in>
### Who can help?
@zach-huggingface @SunMarc
### Information
- [ ] The official example scripts
- [x] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [x] My own task or dataset (give details below)
### Reproduction
I am setting up and training the same model twice.
The setup is identical, and I first [set the seed](https://github.com/sign/image-latent-transformer/blob/main/image_latent_transformer/test_model.py#L33-L34) for each of them using both `set_seed` and `enable_full_determinism`. Each model is then trained independently, with the same parameters. So the steps are:
- Set seed
- Set up model
- Train model
I have confirmed [the model setup itself is deterministic](https://github.com/sign/image-latent-transformer/blob/main/image_latent_transformer/test_model_deterministic.py#L7-L33).
Code snippet from:
https://github.com/sign/image-latent-transformer/blob/main/tests/test_model_deterministic.py#L36-L51
```py
def test_train_model_is_deterministic():
print("Setting up models for training determinism test...")
for _ in range(2):
train_model(setup_tiny_model, num_epochs=50)
```
My results are the following: You can see a 1e-4 different from time to time, growing to 2e-3 which should not be the case.
The final models give different losses to the same inputs.
| Epoch | Model 1 Loss | Model 2 Loss |
|-------|--------------|--------------|
| 1 | 18.2498 | 18.2498 |
| 2 | 11.0250 | 11.0250 |
| 3 | 8.4378 | 8.4378 |
| 4 | 7.1108 | 7.1108 |
| 5 | 5.5779 | 5.5779 |
| 6 | 4.6169 | 4.6169 |
| 7 | 4.2842 | 4.2842 |
| 8 | 4.0113 | 4.0113 |
| 9 | 3.7851 | 3.7851 |
| 10 | 3.6345 | 3.6345 |
| 11 | 3.4782 | 3.4782 |
| 12 | 3.3546 | 3.3546 |
| 13 | 3.2956 | 3.2956 |
| 14 | 3.1307 | 3.1307 |
| 15 | 3.0394 | 3.0394 |
| 16 | 2.9380 | 2.9380 |
| 17 | 2.8490 | 2.8490 |
| 18 | 2.7632 | 2.7632 |
| 19 | 2.8377 | 2.8377 |
| 20 | 2.6242 | 2.6242 |
| 21 | 2.5485 | 2.5485 |
| 22 | 2.4791 | 2.4791 |
| 23 | 2.4007 | 2.4007 |
| 24 | 2.5276 | 2.5276 |
| 25 | 2.4568 | 2.4567 |
| 26 | 2.2207 | 2.2207 |
| 27 | 2.3313 | 2.3313 |
| 28 | 2.2258 | 2.2258 |
| 29 | 2.1106 | 2.1106 |
| 30 | 2.0853 | 2.0853 |
| 31 | 2.0151 | 2.0152 |
| 32 | 1.9600 | 1.9600 |
| 33 | 1.8902 | 1.8902 |
| 34 | 1.8494 | 1.8494 |
| 35 | 1.7963 | 1.7963 |
| 36 | 1.7733 | 1.7734 |
| 37 | 1.7270 | 1.7269 |
| 38 | 1.6766 | 1.6766 |
| 39 | 1.6460 | 1.6458 |
| 40 | 1.5938 | 1.5937 |
| 41 | 1.5792 | 1.5789 |
| 42 | 1.5257 | 1.5258 |
| 43 | 1.4935 | 1.4933 |
| 44 | 1.4619 | 1.4623 |
| 45 | 1.4237 | 1.4238 |
| 46 | 1.4354 | 1.4362 |
| 47 | 1.3818 | 1.3834 |
| 48 | 1.3582 | 1.3564 |
| 49 | 1.3412 | 1.3395 |
### Expected behavior
Both models being equal, when trained with full determinism, should have the exact same loss. | {
"login": "AmitMY",
"id": 5757359,
"node_id": "MDQ6VXNlcjU3NTczNTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/5757359?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/AmitMY",
"html_url": "https://github.com/AmitMY",
"followers_url": "https://api.github.com/users/AmitMY/followers",
"following_url": "https://api.github.com/users/AmitMY/following{/other_user}",
"gists_url": "https://api.github.com/users/AmitMY/gists{/gist_id}",
"starred_url": "https://api.github.com/users/AmitMY/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AmitMY/subscriptions",
"organizations_url": "https://api.github.com/users/AmitMY/orgs",
"repos_url": "https://api.github.com/users/AmitMY/repos",
"events_url": "https://api.github.com/users/AmitMY/events{/privacy}",
"received_events_url": "https://api.github.com/users/AmitMY/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40219/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40219/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40218 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40218/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40218/comments | https://api.github.com/repos/huggingface/transformers/issues/40218/events | https://github.com/huggingface/transformers/pull/40218 | 3,327,049,525 | PR_kwDOCUB6oc6j7huE | 40,218 | Fix #40067: Add dedicated UMT5 support to GGUF loader (config, tokenizer, test) | {
"login": "akshay-babbar",
"id": 19975437,
"node_id": "MDQ6VXNlcjE5OTc1NDM3",
"avatar_url": "https://avatars.githubusercontent.com/u/19975437?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/akshay-babbar",
"html_url": "https://github.com/akshay-babbar",
"followers_url": "https://api.github.com/users/akshay-babbar/followers",
"following_url": "https://api.github.com/users/akshay-babbar/following{/other_user}",
"gists_url": "https://api.github.com/users/akshay-babbar/gists{/gist_id}",
"starred_url": "https://api.github.com/users/akshay-babbar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/akshay-babbar/subscriptions",
"organizations_url": "https://api.github.com/users/akshay-babbar/orgs",
"repos_url": "https://api.github.com/users/akshay-babbar/repos",
"events_url": "https://api.github.com/users/akshay-babbar/events{/privacy}",
"received_events_url": "https://api.github.com/users/akshay-babbar/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-16T08:45:26 | 2025-09-17T09:15:56 | 2025-09-17T09:15:55 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40218",
"html_url": "https://github.com/huggingface/transformers/pull/40218",
"diff_url": "https://github.com/huggingface/transformers/pull/40218.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40218.patch",
"merged_at": "2025-09-17T09:15:55"
} | ### PR Description
### Problem
**Fixes #40067**
UMT5EncoderModel.from_pretrained() fails when loading GGUF files, defaulting to T5 configuration and producing the warning:
```
You are using a model of type t5 to instantiate a model of type umt5. This is not supported for all configurations of models and can yield errors.
```
### Solution
Adds dedicated UMT5 architecture support to the GGUF loader:
- **Detection**: Identifies UMT5 models by name pattern in GGUF files
- **Configuration**: Maps GGUF parameters to UMT5Config instead of falling back to T5
- **Integration**: Registers UMT5 with tokenizer conversion and architecture mapping
### Changes
- `src/transformers/modeling_gguf_pytorch_utils.py`: Added UMT5 model detection and config/architecture mapping
- `src/transformers/integrations/ggml.py`: Added UMT5 config mapping and tokenizer support
- `tests/models/t5/test_modeling_t5.py`: Added integration test for UMT5 GGUF loading
### Testing
✅ New integration test validates UMT5EncoderModel loads correctly from GGUF
✅ Verifies proper config type (UMT5Config, not T5Config)
✅ Confirms weights map without tensor mismatches
✅ Ensures forward pass returns valid last_hidden_state
### Impact
Enables users to load UMT5 encoder models from GGUF format without configuration warnings or errors.
This is not only a warning fix — it ensures GGUF UMT5 models load into the correct architecture + tokenizer, preventing subtle runtime errors.
**Scope**: This patch adds GGUF support for UMT5 encoder models only. Decoder/Seq2Seq GGUF support is out of scope and can be addressed in a separate follow-up.
**Before**: ❌
UMT5EncoderModel.from_pretrained("city96/umt5-xxl-encoder-gguf", gguf_file="...") # fails
**After**: ✅
UMT5EncoderModel.from_pretrained("city96/umt5-xxl-encoder-gguf", gguf_file="...") # works correctly
Thanks! | {
"login": "MekkCyber",
"id": 93391238,
"node_id": "U_kgDOBZEJhg",
"avatar_url": "https://avatars.githubusercontent.com/u/93391238?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/MekkCyber",
"html_url": "https://github.com/MekkCyber",
"followers_url": "https://api.github.com/users/MekkCyber/followers",
"following_url": "https://api.github.com/users/MekkCyber/following{/other_user}",
"gists_url": "https://api.github.com/users/MekkCyber/gists{/gist_id}",
"starred_url": "https://api.github.com/users/MekkCyber/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MekkCyber/subscriptions",
"organizations_url": "https://api.github.com/users/MekkCyber/orgs",
"repos_url": "https://api.github.com/users/MekkCyber/repos",
"events_url": "https://api.github.com/users/MekkCyber/events{/privacy}",
"received_events_url": "https://api.github.com/users/MekkCyber/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40218/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40218/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40217 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40217/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40217/comments | https://api.github.com/repos/huggingface/transformers/issues/40217/events | https://github.com/huggingface/transformers/issues/40217 | 3,327,001,483 | I_kwDOCUB6oc7GTgOL | 40,217 | metric_for_best_model set to eval_f1 raises KeyError because metric is not found in evaluation results | {
"login": "monochandan",
"id": 29684226,
"node_id": "MDQ6VXNlcjI5Njg0MjI2",
"avatar_url": "https://avatars.githubusercontent.com/u/29684226?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/monochandan",
"html_url": "https://github.com/monochandan",
"followers_url": "https://api.github.com/users/monochandan/followers",
"following_url": "https://api.github.com/users/monochandan/following{/other_user}",
"gists_url": "https://api.github.com/users/monochandan/gists{/gist_id}",
"starred_url": "https://api.github.com/users/monochandan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/monochandan/subscriptions",
"organizations_url": "https://api.github.com/users/monochandan/orgs",
"repos_url": "https://api.github.com/users/monochandan/repos",
"events_url": "https://api.github.com/users/monochandan/events{/privacy}",
"received_events_url": "https://api.github.com/users/monochandan/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-16T07:36:18 | 2025-08-22T00:19:06 | 2025-08-22T00:19:06 | NONE | null | null | null | null | ### System Info
# Environment: (Google Colab)
Python 3.11.13
torch==2.6.0+cu124
transformers==4.55.2
bitsandbytes==0.47.0
peft==0.17.0
accelerate==1.10.0
numpy==1.26.4
scipy==1.14.1
GPU
NVIDIA L4
Driver Version: 550.54.15
CUDA Version: 12.4
Model Quantized with QLoRA
# Dataset:
Train Dataset
{'text': Value('string'), 'embeddings': List(Value('float64')), 'tfidf_vector': List(Value('float64')), 'roberta_sent_neg': Value('float64'), 'roberta_sent_pos': Value('float64'), 'names': Value('int64'), 'organizations': Value('int64'), 'dates': Value('int64'), 'count_tokens': Value('int64'), 'label': Value('int64'), 'input_ids': List(Value('int32')), 'token_type_ids': List(Value('int8')), 'attention_mask': List(Value('int8'))}
Val Dataset
{'text': Value('string'), 'embeddings': List(Value('float64')), 'tfidf_vector': List(Value('float64')), 'roberta_sent_neg': Value('float64'), 'roberta_sent_pos': Value('float64'), 'names': Value('int64'), 'organizations': Value('int64'), 'dates': Value('int64'), 'count_tokens': Value('int64'), 'label': Value('int64'), 'input_ids': List(Value('int32')), 'token_type_ids': List(Value('int8')), 'attention_mask': List(Value('int8'))}
### Who can help?
_No response_
### Information
- [ ] The official example scripts
- [x] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [x] My own task or dataset (give details below)
### Reproduction
# Code Setup
```
model = "google-bert/bert-base-uncased"
tokenizer_bert = AutoTokenizer.from_pretrained(model)
if tokenizer_bert.pad_token is None:
tokenizer_bert.pad_token = tokenizer_bert.eos_token
tokenizer_bert.padding_side = "right"
compute_dtype = getattr(torch, "float16")
bnb_config = BitsAndBytesConfig(
load_in_4bit = True,
bnb_4bit_quant_type = "nf4",
bnb_4bit_use_double_quant = True,
bnb_4bit_compute_dtype = compute_dtype,
)
original_model_bert = AutoModelForSequenceClassification.from_pretrained(
model,
num_labels = 2,
quantization_config= bnb_config,
)
lora_config = LoraConfig(
r = 8,
lora_alpha = 16,
lora_dropout=0.1,
bias = "none",
task_type=TaskType.SEQ_CLS,
)
kbit_model_bert = prepare_model_for_kbit_training(original_model_bert)
kbit_model_bert.gradient_checkpointing_enable()
peft_model_bert = get_peft_model(kbit_model_bert, lora_config)
def compute_metrics(eval_pred):
logits, labels = eval_pred
predictions = np.argmax(logits, axis = -1)
accuracy = accuracy_score(labels, predictions)
precision = precision_score(labels, predictions)
recall = recall_score(labels, predictions)
f1 = f1_score(labels, predictions, average = "binary")
print(f1)
print("\n")
return {"accuracy": accuracy,
"precision": precision,
"recall": recall,
"f1": f1
}
output_dir = f'/content/drive/}'
args = TrainingArguments(
output_dir = output_dir,
weight_decay=0.22511642804764023,
warmup_ratio=0.12890328790683203,
adam_beta1=0.9348819720458172,
adam_beta2=0.9285998615546803,
adam_epsilon=1.9972958061508847e-07,
max_grad_norm=4.222172817940239,
gradient_accumulation_steps=2,
max_steps=712,
do_train = True,
do_eval = True,
lr_scheduler_type='polynomial',
warmup_steps=488,
metric_for_best_model = "eval_f1",
optim='paged_adamw_32bit',
learning_rate = 2.1106713456200193e-05,
num_train_epochs = 40,
logging_dir = "./logs/",
logging_strategy = "epoch",
eval_strategy = "epoch",
save_strategy = "epoch",
label_names = ["label"],
load_best_model_at_end = True,
save_total_limit = 3,
)
trainer = Trainer(
model = peft_model_bert,
args = args,
train_dataset = train_dataset,
eval_dataset = dev_train_dataset,
compute_metrics = compute_metrics,
data_collator = DataCollatorWithPadding(tokenizer = tokenizer_bert, padding=True),
callbacks = [EarlyStoppingCallback(early_stopping_patience=3)]
)
trainer.train()
```
### Expected behavior
# Error Message:
<img width="1080" height="960" alt="Image" src="https://github.com/user-attachments/assets/db917ede-5549-427a-8cec-a64ca749cc42" />
# Expected Behavior:
Train the model.
| {
"login": "stevhliu",
"id": 59462357,
"node_id": "MDQ6VXNlcjU5NDYyMzU3",
"avatar_url": "https://avatars.githubusercontent.com/u/59462357?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stevhliu",
"html_url": "https://github.com/stevhliu",
"followers_url": "https://api.github.com/users/stevhliu/followers",
"following_url": "https://api.github.com/users/stevhliu/following{/other_user}",
"gists_url": "https://api.github.com/users/stevhliu/gists{/gist_id}",
"starred_url": "https://api.github.com/users/stevhliu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stevhliu/subscriptions",
"organizations_url": "https://api.github.com/users/stevhliu/orgs",
"repos_url": "https://api.github.com/users/stevhliu/repos",
"events_url": "https://api.github.com/users/stevhliu/events{/privacy}",
"received_events_url": "https://api.github.com/users/stevhliu/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40217/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40217/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40216 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40216/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40216/comments | https://api.github.com/repos/huggingface/transformers/issues/40216/events | https://github.com/huggingface/transformers/pull/40216 | 3,326,997,646 | PR_kwDOCUB6oc6j7XiU | 40,216 | Setting MPS flag check for bf16 training issue | {
"login": "debasisdwivedy",
"id": 20119757,
"node_id": "MDQ6VXNlcjIwMTE5NzU3",
"avatar_url": "https://avatars.githubusercontent.com/u/20119757?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/debasisdwivedy",
"html_url": "https://github.com/debasisdwivedy",
"followers_url": "https://api.github.com/users/debasisdwivedy/followers",
"following_url": "https://api.github.com/users/debasisdwivedy/following{/other_user}",
"gists_url": "https://api.github.com/users/debasisdwivedy/gists{/gist_id}",
"starred_url": "https://api.github.com/users/debasisdwivedy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/debasisdwivedy/subscriptions",
"organizations_url": "https://api.github.com/users/debasisdwivedy/orgs",
"repos_url": "https://api.github.com/users/debasisdwivedy/repos",
"events_url": "https://api.github.com/users/debasisdwivedy/events{/privacy}",
"received_events_url": "https://api.github.com/users/debasisdwivedy/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-16T07:31:10 | 2025-09-02T16:00:52 | 2025-09-02T16:00:52 | NONE | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40216",
"html_url": "https://github.com/huggingface/transformers/pull/40216",
"diff_url": "https://github.com/huggingface/transformers/pull/40216.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40216.patch",
"merged_at": null
} | # What does this PR do?
Adds a check for MPS availability for training BF16 `torch_dtype=torch.bfloat16`
<!-- Remove if not applicable -->
Fixes #39935
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
[GITHUB_ISSUE_TRANSFORMER](https://github.com/huggingface/transformers/issues/39935)
[GITHUB_ISSUE_ACCELERATE](https://github.com/huggingface/accelerate/issues/3718)
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@renet10
@ArthurZucker
@zach-huggingface
@SunMarc
@qgallouedec
I have attached a code sample to that was tested on my mac. Please feel free todo a round of testing from your side.
```
def train():
import os
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import LoraConfig, TaskType
from trl import SFTTrainer,SFTConfig
from dotenv import load_dotenv
import json
torch.mps.empty_cache()
load_dotenv()
from huggingface_hub import login
login(token=os.getenv("HUGGINGFACE_API_TOKEN"))
model_name = "google/gemma-3-270m-it"
dataset_name = "<TAKE_ANY_SAMPLE_DATASET>"
# 1. Load the model and tokenizer
model = AutoModelForCausalLM.from_pretrained(
model_name,
attn_implementation='eager',
token=os.getenv("HUGGINGFACE_API_TOKEN"),
device_map='mps',
torch_dtype=torch.bfloat16,
)
# Use AutoTokenizer to add special tokens
tokenizer = AutoTokenizer.from_pretrained(
model_name,
token=os.getenv("HUGGINGFACE_API_TOKEN"),
)
##############################################################################################################
from datasets import load_dataset
def preprocess(sample):
messages = sample["messages"]
return {"text": tokenizer.apply_chat_template(messages, add_generation_prompt=False,tokenize=False)}
dataset = load_dataset(dataset_name,split="train[:500]")
dataset = dataset.rename_column("conversations", "messages")
dataset = dataset.map(preprocess, remove_columns="messages")
dataset = dataset.train_test_split(0.1)
print(dataset)
print(dataset["train"][5]["text"])
##############################################################################################################
username="JOHN_DOE"# REPLACE with your Hugging Face username
output_dir = "gemma-3-270m-it-fine-tuned" # The directory where the trained model checkpoints, logs, and other artifacts will be saved. It will also be the default name of the model when pushed to the hub if not redefined later.
per_device_train_batch_size = 2
per_device_eval_batch_size = 2
gradient_accumulation_steps = 8
logging_steps = 5
learning_rate = 1e-5 # The initial learning rate for the optimizer.
max_grad_norm = 1.0
num_train_epochs=1
warmup_ratio = 0.1
lr_scheduler_type = "cosine"
max_seq_length = 1024
# 3. Configure PEFT with LoraConfig
# Crucially, include the embedding layers in modules_to_save
peft_config = LoraConfig(r=32,
lora_alpha=64,
lora_dropout=0.05,
target_modules=["gate_proj","q_proj","o_proj","k_proj","down_proj","up_proj","v_proj"],
modules_to_save=["embed_tokens", "lm_head"],
task_type=TaskType.CAUSAL_LM)
training_arguments = SFTConfig(
output_dir=output_dir,
do_train=True,
per_device_train_batch_size=per_device_train_batch_size,
do_eval=True,
per_device_eval_batch_size=per_device_eval_batch_size,
gradient_accumulation_steps=gradient_accumulation_steps,
save_strategy="no",
eval_strategy="epoch",
logging_steps=logging_steps,
learning_rate=learning_rate,
max_grad_norm=max_grad_norm,
weight_decay=0.1,
warmup_ratio=warmup_ratio,
lr_scheduler_type=lr_scheduler_type,
report_to="tensorboard",
bf16=True,
use_mps_device=True,
seed=123,
hub_private_repo=False,
push_to_hub=False,
num_train_epochs=num_train_epochs,
gradient_checkpointing=True,
gradient_checkpointing_kwargs={"use_reentrant": False},
#packing=True,
max_length=max_seq_length,
remove_unused_columns=False,
dataset_text_field = "text",
optim="adamw_torch",
adam_beta1=0.9,
adam_beta2=0.95,
adam_epsilon=1e-8,
label_smoothing_factor=0.1,
)
##############################################################################################################
trainer = SFTTrainer(
model=model,
args=training_arguments,
train_dataset=dataset["train"],
eval_dataset=dataset["test"],
processing_class=tokenizer,
peft_config=peft_config,
)
##############################################################################################################
torch.mps.empty_cache()
trainer.train()
trainer.save_model(output_dir="./trainer_output")
```
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Models:
- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier
Library:
- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
Documentation: @stevhliu
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
Maintained examples (not research project or legacy):
- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1
-->
Regards, | {
"login": "SunMarc",
"id": 57196510,
"node_id": "MDQ6VXNlcjU3MTk2NTEw",
"avatar_url": "https://avatars.githubusercontent.com/u/57196510?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/SunMarc",
"html_url": "https://github.com/SunMarc",
"followers_url": "https://api.github.com/users/SunMarc/followers",
"following_url": "https://api.github.com/users/SunMarc/following{/other_user}",
"gists_url": "https://api.github.com/users/SunMarc/gists{/gist_id}",
"starred_url": "https://api.github.com/users/SunMarc/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/SunMarc/subscriptions",
"organizations_url": "https://api.github.com/users/SunMarc/orgs",
"repos_url": "https://api.github.com/users/SunMarc/repos",
"events_url": "https://api.github.com/users/SunMarc/events{/privacy}",
"received_events_url": "https://api.github.com/users/SunMarc/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40216/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40216/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40215 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40215/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40215/comments | https://api.github.com/repos/huggingface/transformers/issues/40215/events | https://github.com/huggingface/transformers/pull/40215 | 3,326,979,901 | PR_kwDOCUB6oc6j7UFT | 40,215 | Add EfficientLoFTRImageProcessorFast for GPU-accelerated image processing | {
"login": "LawJarp-A",
"id": 34590600,
"node_id": "MDQ6VXNlcjM0NTkwNjAw",
"avatar_url": "https://avatars.githubusercontent.com/u/34590600?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/LawJarp-A",
"html_url": "https://github.com/LawJarp-A",
"followers_url": "https://api.github.com/users/LawJarp-A/followers",
"following_url": "https://api.github.com/users/LawJarp-A/following{/other_user}",
"gists_url": "https://api.github.com/users/LawJarp-A/gists{/gist_id}",
"starred_url": "https://api.github.com/users/LawJarp-A/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/LawJarp-A/subscriptions",
"organizations_url": "https://api.github.com/users/LawJarp-A/orgs",
"repos_url": "https://api.github.com/users/LawJarp-A/repos",
"events_url": "https://api.github.com/users/LawJarp-A/events{/privacy}",
"received_events_url": "https://api.github.com/users/LawJarp-A/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-16T07:06:54 | 2025-09-08T21:08:49 | 2025-09-08T21:08:03 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40215",
"html_url": "https://github.com/huggingface/transformers/pull/40215",
"diff_url": "https://github.com/huggingface/transformers/pull/40215.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40215.patch",
"merged_at": "2025-09-08T21:08:03"
} | Adds `EfficientLoFTRImageProcessorFast` for GPU-accelerated image processing using PyTorch/torchvision operations.
Closes https://github.com/huggingface/transformers/issues/36978
- Maintains full API compatibility with slow processor
- Includes comprehensive tests and documentation updates
- All 76 tests pass with proper image pair handling | {
"login": "yonigozlan",
"id": 74535834,
"node_id": "MDQ6VXNlcjc0NTM1ODM0",
"avatar_url": "https://avatars.githubusercontent.com/u/74535834?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yonigozlan",
"html_url": "https://github.com/yonigozlan",
"followers_url": "https://api.github.com/users/yonigozlan/followers",
"following_url": "https://api.github.com/users/yonigozlan/following{/other_user}",
"gists_url": "https://api.github.com/users/yonigozlan/gists{/gist_id}",
"starred_url": "https://api.github.com/users/yonigozlan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yonigozlan/subscriptions",
"organizations_url": "https://api.github.com/users/yonigozlan/orgs",
"repos_url": "https://api.github.com/users/yonigozlan/repos",
"events_url": "https://api.github.com/users/yonigozlan/events{/privacy}",
"received_events_url": "https://api.github.com/users/yonigozlan/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40215/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40215/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40214 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40214/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40214/comments | https://api.github.com/repos/huggingface/transformers/issues/40214/events | https://github.com/huggingface/transformers/issues/40214 | 3,326,964,399 | I_kwDOCUB6oc7GTXKv | 40,214 | Chunked Attention with left padding causes train–inference mismatch (first chunk truncated) | {
"login": "xiazhuo",
"id": 79448622,
"node_id": "MDQ6VXNlcjc5NDQ4NjIy",
"avatar_url": "https://avatars.githubusercontent.com/u/79448622?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/xiazhuo",
"html_url": "https://github.com/xiazhuo",
"followers_url": "https://api.github.com/users/xiazhuo/followers",
"following_url": "https://api.github.com/users/xiazhuo/following{/other_user}",
"gists_url": "https://api.github.com/users/xiazhuo/gists{/gist_id}",
"starred_url": "https://api.github.com/users/xiazhuo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/xiazhuo/subscriptions",
"organizations_url": "https://api.github.com/users/xiazhuo/orgs",
"repos_url": "https://api.github.com/users/xiazhuo/repos",
"events_url": "https://api.github.com/users/xiazhuo/events{/privacy}",
"received_events_url": "https://api.github.com/users/xiazhuo/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-16T06:43:00 | 2025-08-21T08:52:50 | 2025-08-21T08:52:50 | NONE | null | null | null | null | ## **Describe the bug**
When using **chunked attention** with **left padding**, the first chunk may contain fewer valid tokens than `chunk_size`, which introduces a distribution mismatch between training and inference.
Since training typically uses right padding or no padding, the model never sees a chunk where most positions are padding. This may degrade performance, especially for shorter sequences.
---
## **To Reproduce**
### Example:
* `chunk_size = 4`
* Two sequences: length = 8 and length = 15
With **right padding** (common during training):
```
Seq (len=8): [x1 x2 x3 x4] [x5 x6 x7 x8, PAD ...]
Seq (len=15): [x1 x2 x3 x4] [x5 x6 x7 x8] [x9..x12] [x13..x15, PAD]
```
👉 Each chunk contains up to 4 valid tokens, consistent with training.
With **left padding** (common in batched inference):
```
Seq (len=8, padded to 15): [PAD PAD PAD x1] [x2 x3 x4 x5] [x6 x7 x8 PAD]
Seq (len=15): [x1 x2 x3 x4] [x5 x6 x7 x8] [x9..x12] [x13..x15]
```
👉 The first chunk of the shorter sequence contains only **1 valid token (`x1`)**, which never happens during training.
### Minimal code sample:
```python
from transformers import Llama4TextConfig, Llama4TextModel
from transformers.masking_utils import create_chunked_causal_mask
import torch
configuration = Llama4TextConfig(
hidden_size=512,
intermediate_size=2048,
intermediate_size_mlp=4096,
num_hidden_layers=4,
num_attention_heads=40,
num_key_value_heads=8,
use_cache=True,
attention_chunk_size=4,
)
model = Llama4TextModel(configuration)
input_ids = torch.tensor([[151643, 151643, 151643, 151643, 151643, 151643, 151643, 151643, 9707,
11, 1246, 525, 498, 30, 28],
[ 3838, 374, 279, 6722, 315, 9625, 30, 3555, 374,
279, 6722, 315, 9856, 30, 28]])
attention_mask = torch.tensor([[0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]])
inputs_embeds = model.embed_tokens(input_ids)
cache_position = torch.tensor([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14])
position_ids = torch.tensor([[ 1, 1, 1, 1, 1, 1, 1, 0, 1, 2, 3, 4, 5, 6, 7],
[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]])
mask_kwargs = {
"config": configuration,
"input_embeds": inputs_embeds,
"attention_mask": attention_mask,
"cache_position": cache_position,
"past_key_values": None,
"position_ids": position_ids,
}
chunked_attention= create_chunked_causal_mask(**mask_kwargs)
print(chunked_attention[0])
```
Output:
```
tensor([[[[False, False, False, False, False, False, False, False, False, False,
False, False, False, False, False],
[False, False, False, False, False, False, False, False, False, False,
False, False, False, False, False],
[False, False, False, False, False, False, False, False, False, False,
False, False, False, False, False],
[False, False, False, False, False, False, False, False, False, False,
False, False, False, False, False],
[False, False, False, False, False, False, False, False, False, False,
False, False, False, False, False],
[False, False, False, False, False, False, False, False, False, False,
False, False, False, False, False],
[False, False, False, False, False, False, False, False, False, False,
False, False, False, False, False],
[False, False, False, False, False, False, False, True, False, False,
False, False, False, False, False],
[False, False, False, False, False, False, False, False, True, False,
False, False, False, False, False],
[False, False, False, False, False, False, False, False, True, True,
False, False, False, False, False],
[False, False, False, False, False, False, False, False, True, True,
True, False, False, False, False],
[False, False, False, False, False, False, False, False, True, True,
True, True, False, False, False],
[False, False, False, False, False, False, False, False, False, False,
False, False, True, False, False],
[False, False, False, False, False, False, False, False, False, False,
False, False, True, True, False],
[False, False, False, False, False, False, False, False, False, False,
False, False, True, True, True]]]])
```
---
## **Expected behavior**
Chunk partitioning should skip leading padding so that the effective sequence is partitioned as if no left pads existed. This would ensure that all chunks contain up to chunk_size valid tokens, aligning inference with training behavior.
---
## **Environment info**
- `transformers` version: 4.56.0.dev0
- Platform: Linux-5.10.134-008.16.kangaroo.al8.x86_64-x86_64-with-glibc2.39
- Python version: 3.10.18
- Huggingface_hub version: 0.34.4
- Safetensors version: 0.5.3
- Accelerate version: 1.8.0
- Accelerate config: not found
- DeepSpeed version: not installed
- PyTorch version (accelerator?): 2.7.1+cu126 (CUDA)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): 0.7.0 (cpu)
- Jax version: 0.4.13
- JaxLib version: 0.4.13
- Using distributed or parallel set-up in script?: no
- Using GPU in script?: no
- Model: Llama 4 (or other models using chunked attention)
---
## **Additional context**
* Right padding avoids this issue, but some workflows (e.g. batched decoding, GPT-style left padding) rely on left padding.
* Skipping leading pads when chunking could be a simple fix.
* This may be especially relevant for short sequences, where the first chunk is disproportionately affected.
Would you consider adjusting the chunked attention implementation to handle this case? | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40214/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40214/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40213 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40213/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40213/comments | https://api.github.com/repos/huggingface/transformers/issues/40213/events | https://github.com/huggingface/transformers/pull/40213 | 3,326,724,910 | PR_kwDOCUB6oc6j6gOa | 40,213 | [SAM 2] Change checkpoints in docs and tests | {
"login": "yonigozlan",
"id": 74535834,
"node_id": "MDQ6VXNlcjc0NTM1ODM0",
"avatar_url": "https://avatars.githubusercontent.com/u/74535834?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yonigozlan",
"html_url": "https://github.com/yonigozlan",
"followers_url": "https://api.github.com/users/yonigozlan/followers",
"following_url": "https://api.github.com/users/yonigozlan/following{/other_user}",
"gists_url": "https://api.github.com/users/yonigozlan/gists{/gist_id}",
"starred_url": "https://api.github.com/users/yonigozlan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yonigozlan/subscriptions",
"organizations_url": "https://api.github.com/users/yonigozlan/orgs",
"repos_url": "https://api.github.com/users/yonigozlan/repos",
"events_url": "https://api.github.com/users/yonigozlan/events{/privacy}",
"received_events_url": "https://api.github.com/users/yonigozlan/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-16T01:42:10 | 2025-08-18T09:21:34 | 2025-08-18T09:21:34 | MEMBER | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40213",
"html_url": "https://github.com/huggingface/transformers/pull/40213",
"diff_url": "https://github.com/huggingface/transformers/pull/40213.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40213.patch",
"merged_at": "2025-08-18T09:21:34"
} | # What does this PR do?
As the title says, change checkpoints to the official facebook ones.
Feel free to merge without me as I'll be off, Cc @ArthurZucker @Cyrilvallez @ydshieh. | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40213/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40213/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40212 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40212/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40212/comments | https://api.github.com/repos/huggingface/transformers/issues/40212/events | https://github.com/huggingface/transformers/pull/40212 | 3,326,724,034 | PR_kwDOCUB6oc6j6gCe | 40,212 | Fix more typos | {
"login": "cyyever",
"id": 17618148,
"node_id": "MDQ6VXNlcjE3NjE4MTQ4",
"avatar_url": "https://avatars.githubusercontent.com/u/17618148?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cyyever",
"html_url": "https://github.com/cyyever",
"followers_url": "https://api.github.com/users/cyyever/followers",
"following_url": "https://api.github.com/users/cyyever/following{/other_user}",
"gists_url": "https://api.github.com/users/cyyever/gists{/gist_id}",
"starred_url": "https://api.github.com/users/cyyever/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cyyever/subscriptions",
"organizations_url": "https://api.github.com/users/cyyever/orgs",
"repos_url": "https://api.github.com/users/cyyever/repos",
"events_url": "https://api.github.com/users/cyyever/events{/privacy}",
"received_events_url": "https://api.github.com/users/cyyever/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-16T01:40:38 | 2025-08-18T12:59:18 | 2025-08-18T12:52:13 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40212",
"html_url": "https://github.com/huggingface/transformers/pull/40212",
"diff_url": "https://github.com/huggingface/transformers/pull/40212.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40212.patch",
"merged_at": "2025-08-18T12:52:13"
} | # What does this PR do?
Fix more typos | {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40212/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40212/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40211 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40211/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40211/comments | https://api.github.com/repos/huggingface/transformers/issues/40211/events | https://github.com/huggingface/transformers/pull/40211 | 3,326,469,382 | PR_kwDOCUB6oc6j5rbJ | 40,211 | [WIP] ESM-2 Attention interface refactor | {
"login": "pstjohn",
"id": 2576846,
"node_id": "MDQ6VXNlcjI1NzY4NDY=",
"avatar_url": "https://avatars.githubusercontent.com/u/2576846?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pstjohn",
"html_url": "https://github.com/pstjohn",
"followers_url": "https://api.github.com/users/pstjohn/followers",
"following_url": "https://api.github.com/users/pstjohn/following{/other_user}",
"gists_url": "https://api.github.com/users/pstjohn/gists{/gist_id}",
"starred_url": "https://api.github.com/users/pstjohn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pstjohn/subscriptions",
"organizations_url": "https://api.github.com/users/pstjohn/orgs",
"repos_url": "https://api.github.com/users/pstjohn/repos",
"events_url": "https://api.github.com/users/pstjohn/events{/privacy}",
"received_events_url": "https://api.github.com/users/pstjohn/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-15T22:02:37 | 2025-09-02T13:31:25 | 2025-09-02T13:31:28 | CONTRIBUTOR | null | null | true | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40211",
"html_url": "https://github.com/huggingface/transformers/pull/40211",
"diff_url": "https://github.com/huggingface/transformers/pull/40211.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40211.patch",
"merged_at": null
} | Refectors the ESM-2 model to use the new ATTENTION_INTERFACE api.
Some of the unit tests are still failing, need to debug. | {
"login": "pstjohn",
"id": 2576846,
"node_id": "MDQ6VXNlcjI1NzY4NDY=",
"avatar_url": "https://avatars.githubusercontent.com/u/2576846?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pstjohn",
"html_url": "https://github.com/pstjohn",
"followers_url": "https://api.github.com/users/pstjohn/followers",
"following_url": "https://api.github.com/users/pstjohn/following{/other_user}",
"gists_url": "https://api.github.com/users/pstjohn/gists{/gist_id}",
"starred_url": "https://api.github.com/users/pstjohn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pstjohn/subscriptions",
"organizations_url": "https://api.github.com/users/pstjohn/orgs",
"repos_url": "https://api.github.com/users/pstjohn/repos",
"events_url": "https://api.github.com/users/pstjohn/events{/privacy}",
"received_events_url": "https://api.github.com/users/pstjohn/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40211/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40211/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40210 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40210/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40210/comments | https://api.github.com/repos/huggingface/transformers/issues/40210/events | https://github.com/huggingface/transformers/pull/40210 | 3,326,467,029 | PR_kwDOCUB6oc6j5q-d | 40,210 | remove transpose_for_scores call in ESM-2 | {
"login": "pstjohn",
"id": 2576846,
"node_id": "MDQ6VXNlcjI1NzY4NDY=",
"avatar_url": "https://avatars.githubusercontent.com/u/2576846?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pstjohn",
"html_url": "https://github.com/pstjohn",
"followers_url": "https://api.github.com/users/pstjohn/followers",
"following_url": "https://api.github.com/users/pstjohn/following{/other_user}",
"gists_url": "https://api.github.com/users/pstjohn/gists{/gist_id}",
"starred_url": "https://api.github.com/users/pstjohn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pstjohn/subscriptions",
"organizations_url": "https://api.github.com/users/pstjohn/orgs",
"repos_url": "https://api.github.com/users/pstjohn/repos",
"events_url": "https://api.github.com/users/pstjohn/events{/privacy}",
"received_events_url": "https://api.github.com/users/pstjohn/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-15T22:00:52 | 2025-08-18T14:29:25 | 2025-08-18T14:28:59 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40210",
"html_url": "https://github.com/huggingface/transformers/pull/40210",
"diff_url": "https://github.com/huggingface/transformers/pull/40210.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40210.patch",
"merged_at": "2025-08-18T14:28:59"
} | #38751 broke the flash-attention 2 backend for ESM-2 by removing transpose_for_scores, this fixes the few places in ESM flash attention that still reference that removed function.
@ArthurZucker, @Rocketknight1
I'm also working on the attention_interface version here #40211, but having this fixed will help in debugging where some of those functions are being called incorrectly | {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40210/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40210/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40209 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40209/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40209/comments | https://api.github.com/repos/huggingface/transformers/issues/40209/events | https://github.com/huggingface/transformers/pull/40209 | 3,326,362,773 | PR_kwDOCUB6oc6j5Vop | 40,209 | Add fast image processor for ViViT | {
"login": "msminhas93",
"id": 6465972,
"node_id": "MDQ6VXNlcjY0NjU5NzI=",
"avatar_url": "https://avatars.githubusercontent.com/u/6465972?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/msminhas93",
"html_url": "https://github.com/msminhas93",
"followers_url": "https://api.github.com/users/msminhas93/followers",
"following_url": "https://api.github.com/users/msminhas93/following{/other_user}",
"gists_url": "https://api.github.com/users/msminhas93/gists{/gist_id}",
"starred_url": "https://api.github.com/users/msminhas93/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/msminhas93/subscriptions",
"organizations_url": "https://api.github.com/users/msminhas93/orgs",
"repos_url": "https://api.github.com/users/msminhas93/repos",
"events_url": "https://api.github.com/users/msminhas93/events{/privacy}",
"received_events_url": "https://api.github.com/users/msminhas93/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | [] | 2025-08-15T21:02:35 | 2025-09-08T21:19:49 | null | NONE | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40209",
"html_url": "https://github.com/huggingface/transformers/pull/40209",
"diff_url": "https://github.com/huggingface/transformers/pull/40209.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40209.patch",
"merged_at": null
} | ## What does this PR do?
This PR implements a fast PyTorch image processor for ViViT (`VivitImageProcessorFast`) that extends the existing `BaseImageProcessorFast` class. The new processor provides optimized image processing capabilities specifically designed for video understanding tasks using the ViViT model.
## Key Features
- **Fast PyTorch-native implementation**: Leverages PyTorch operations for efficient video frame processing
- **Video structure handling**: Supports nested video inputs (batch of videos, each video is a list of frames)
- **Custom rescaling with offset**: Implements ViViT's unique rescaling behavior with optional offset parameter for [-1, 1] range
- **Channel dimension handling**: Automatic detection and conversion between different channel formats (CHW vs HWC)
- **Optimized preprocessing pipeline**: Sequential application of resize, center crop, rescale, and normalize operations
- **Batch processing support**: Efficient handling of multiple video inputs with proper tensor stacking
- **AutoImageProcessor integration**: Properly registered in the auto mapping system for seamless usage
## Before submitting
- [x] This PR implements a new fast image processor for ViViT
- [x] Did you read the contributor guideline, Pull Request section?
- [x] Was this discussed/approved via a Github issue or the forum? Please add a link to it if that's the case. [Contributions Welcome] Add Fast Image Processors #36978
- [x] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
- [x] Did you write any new necessary tests? Updated test suite to run against both slow and fast processors with 23/23 tests passing
## Who can review?
@yonigozlan | null | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40209/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40209/timeline | null | null | null | null | true | false |
https://api.github.com/repos/huggingface/transformers/issues/40208 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40208/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40208/comments | https://api.github.com/repos/huggingface/transformers/issues/40208/events | https://github.com/huggingface/transformers/pull/40208 | 3,326,142,712 | PR_kwDOCUB6oc6j4lkY | 40,208 | Save only model sharded sd | {
"login": "winglian",
"id": 381258,
"node_id": "MDQ6VXNlcjM4MTI1OA==",
"avatar_url": "https://avatars.githubusercontent.com/u/381258?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/winglian",
"html_url": "https://github.com/winglian",
"followers_url": "https://api.github.com/users/winglian/followers",
"following_url": "https://api.github.com/users/winglian/following{/other_user}",
"gists_url": "https://api.github.com/users/winglian/gists{/gist_id}",
"starred_url": "https://api.github.com/users/winglian/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/winglian/subscriptions",
"organizations_url": "https://api.github.com/users/winglian/orgs",
"repos_url": "https://api.github.com/users/winglian/repos",
"events_url": "https://api.github.com/users/winglian/events{/privacy}",
"received_events_url": "https://api.github.com/users/winglian/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | [] | 2025-08-15T19:38:23 | 2025-08-20T11:30:12 | null | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40208",
"html_url": "https://github.com/huggingface/transformers/pull/40208",
"diff_url": "https://github.com/huggingface/transformers/pull/40208.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40208.patch",
"merged_at": null
} | # What does this PR do?
Follow up to #36627 (issue #36626) where that PR misdiagnosed the underlying issue. The reason it wouldn't save is that the output_dir didn't exist yet because it was created in the checkpoint/optimizer save method. This fixes the issue by moving the checkpoint dir creation to the top.
Additionally, because `self.save_model` only handles FSDP FULL_STATE_DICT, and SHARDED_STATE_DICT is only handled during `_save_optimizer_and_scheduler` which is gated by `not self.args.save_only_model`, we also need to manually handle saving the SHARDED_STATE_DICT for the edge case.
<!--
Congratulations! You've made it this far! You're not quite done yet though.
Once 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.
Then, 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.
Once 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.
-->
<!-- Remove if not applicable -->
Fixes # (issue)
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
@ArthurZucker @S1ro1
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Models:
- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier
Library:
- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
Documentation: @stevhliu
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
Maintained examples (not research project or legacy):
- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1
-->
| null | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40208/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40208/timeline | null | null | null | null | true | false |
https://api.github.com/repos/huggingface/transformers/issues/40207 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40207/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40207/comments | https://api.github.com/repos/huggingface/transformers/issues/40207/events | https://github.com/huggingface/transformers/pull/40207 | 3,325,878,029 | PR_kwDOCUB6oc6j3tJI | 40,207 | remove FSDP prefix when using save_pretrained with FSDP2 | {
"login": "winglian",
"id": 381258,
"node_id": "MDQ6VXNlcjM4MTI1OA==",
"avatar_url": "https://avatars.githubusercontent.com/u/381258?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/winglian",
"html_url": "https://github.com/winglian",
"followers_url": "https://api.github.com/users/winglian/followers",
"following_url": "https://api.github.com/users/winglian/following{/other_user}",
"gists_url": "https://api.github.com/users/winglian/gists{/gist_id}",
"starred_url": "https://api.github.com/users/winglian/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/winglian/subscriptions",
"organizations_url": "https://api.github.com/users/winglian/orgs",
"repos_url": "https://api.github.com/users/winglian/repos",
"events_url": "https://api.github.com/users/winglian/events{/privacy}",
"received_events_url": "https://api.github.com/users/winglian/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-15T17:33:29 | 2025-10-01T01:21:26 | 2025-09-08T12:52:31 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40207",
"html_url": "https://github.com/huggingface/transformers/pull/40207",
"diff_url": "https://github.com/huggingface/transformers/pull/40207.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40207.patch",
"merged_at": "2025-09-08T12:52:31"
} | # What does this PR do?
<!--
Congratulations! You've made it this far! You're not quite done yet though.
Once 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.
Then, 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.
Once 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.
-->
<!-- Remove if not applicable -->
Fixes # (issue)
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Models:
- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier
Library:
- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
Documentation: @stevhliu
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
Maintained examples (not research project or legacy):
- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1
-->
| {
"login": "S1ro1",
"id": 54212263,
"node_id": "MDQ6VXNlcjU0MjEyMjYz",
"avatar_url": "https://avatars.githubusercontent.com/u/54212263?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/S1ro1",
"html_url": "https://github.com/S1ro1",
"followers_url": "https://api.github.com/users/S1ro1/followers",
"following_url": "https://api.github.com/users/S1ro1/following{/other_user}",
"gists_url": "https://api.github.com/users/S1ro1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/S1ro1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/S1ro1/subscriptions",
"organizations_url": "https://api.github.com/users/S1ro1/orgs",
"repos_url": "https://api.github.com/users/S1ro1/repos",
"events_url": "https://api.github.com/users/S1ro1/events{/privacy}",
"received_events_url": "https://api.github.com/users/S1ro1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40207/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40207/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40206 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40206/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40206/comments | https://api.github.com/repos/huggingface/transformers/issues/40206/events | https://github.com/huggingface/transformers/pull/40206 | 3,325,865,817 | PR_kwDOCUB6oc6j3qeC | 40,206 | chore: fix typo in `find_executable_batch_size` to match new 0.9 ratio | {
"login": "MilkClouds",
"id": 26109705,
"node_id": "MDQ6VXNlcjI2MTA5NzA1",
"avatar_url": "https://avatars.githubusercontent.com/u/26109705?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/MilkClouds",
"html_url": "https://github.com/MilkClouds",
"followers_url": "https://api.github.com/users/MilkClouds/followers",
"following_url": "https://api.github.com/users/MilkClouds/following{/other_user}",
"gists_url": "https://api.github.com/users/MilkClouds/gists{/gist_id}",
"starred_url": "https://api.github.com/users/MilkClouds/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MilkClouds/subscriptions",
"organizations_url": "https://api.github.com/users/MilkClouds/orgs",
"repos_url": "https://api.github.com/users/MilkClouds/repos",
"events_url": "https://api.github.com/users/MilkClouds/events{/privacy}",
"received_events_url": "https://api.github.com/users/MilkClouds/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-15T17:28:19 | 2025-08-20T12:18:42 | 2025-08-20T12:18:07 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40206",
"html_url": "https://github.com/huggingface/transformers/pull/40206",
"diff_url": "https://github.com/huggingface/transformers/pull/40206.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40206.patch",
"merged_at": "2025-08-20T12:18:06"
} | # What does this PR do?
<!--
Congratulations! You've made it this far! You're not quite done yet though.
Once 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.
Then, 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.
Once 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.
-->
<!-- Remove if not applicable -->
Fix typo of tranformers' `find_executable_batch_size` to match https://github.com/huggingface/accelerate/pull/3684
## Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
@SunMarc may be able to review this. | {
"login": "SunMarc",
"id": 57196510,
"node_id": "MDQ6VXNlcjU3MTk2NTEw",
"avatar_url": "https://avatars.githubusercontent.com/u/57196510?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/SunMarc",
"html_url": "https://github.com/SunMarc",
"followers_url": "https://api.github.com/users/SunMarc/followers",
"following_url": "https://api.github.com/users/SunMarc/following{/other_user}",
"gists_url": "https://api.github.com/users/SunMarc/gists{/gist_id}",
"starred_url": "https://api.github.com/users/SunMarc/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/SunMarc/subscriptions",
"organizations_url": "https://api.github.com/users/SunMarc/orgs",
"repos_url": "https://api.github.com/users/SunMarc/repos",
"events_url": "https://api.github.com/users/SunMarc/events{/privacy}",
"received_events_url": "https://api.github.com/users/SunMarc/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40206/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40206/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40205 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40205/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40205/comments | https://api.github.com/repos/huggingface/transformers/issues/40205/events | https://github.com/huggingface/transformers/pull/40205 | 3,325,411,270 | PR_kwDOCUB6oc6j2K9R | 40,205 | [Trainer] accelerate contextparallel support in trainer | {
"login": "kashif",
"id": 8100,
"node_id": "MDQ6VXNlcjgxMDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/8100?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kashif",
"html_url": "https://github.com/kashif",
"followers_url": "https://api.github.com/users/kashif/followers",
"following_url": "https://api.github.com/users/kashif/following{/other_user}",
"gists_url": "https://api.github.com/users/kashif/gists{/gist_id}",
"starred_url": "https://api.github.com/users/kashif/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kashif/subscriptions",
"organizations_url": "https://api.github.com/users/kashif/orgs",
"repos_url": "https://api.github.com/users/kashif/repos",
"events_url": "https://api.github.com/users/kashif/events{/privacy}",
"received_events_url": "https://api.github.com/users/kashif/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-15T14:18:41 | 2025-10-25T14:33:25 | 2025-08-26T09:28:48 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40205",
"html_url": "https://github.com/huggingface/transformers/pull/40205",
"diff_url": "https://github.com/huggingface/transformers/pull/40205.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40205.patch",
"merged_at": "2025-08-26T09:28:48"
} | # What does this PR do?
Add support for context parallel in the Trainer | {
"login": "SunMarc",
"id": 57196510,
"node_id": "MDQ6VXNlcjU3MTk2NTEw",
"avatar_url": "https://avatars.githubusercontent.com/u/57196510?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/SunMarc",
"html_url": "https://github.com/SunMarc",
"followers_url": "https://api.github.com/users/SunMarc/followers",
"following_url": "https://api.github.com/users/SunMarc/following{/other_user}",
"gists_url": "https://api.github.com/users/SunMarc/gists{/gist_id}",
"starred_url": "https://api.github.com/users/SunMarc/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/SunMarc/subscriptions",
"organizations_url": "https://api.github.com/users/SunMarc/orgs",
"repos_url": "https://api.github.com/users/SunMarc/repos",
"events_url": "https://api.github.com/users/SunMarc/events{/privacy}",
"received_events_url": "https://api.github.com/users/SunMarc/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40205/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40205/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40204 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40204/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40204/comments | https://api.github.com/repos/huggingface/transformers/issues/40204/events | https://github.com/huggingface/transformers/pull/40204 | 3,325,374,924 | PR_kwDOCUB6oc6j2DTR | 40,204 | Fix more pylint warnings | {
"login": "cyyever",
"id": 17618148,
"node_id": "MDQ6VXNlcjE3NjE4MTQ4",
"avatar_url": "https://avatars.githubusercontent.com/u/17618148?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cyyever",
"html_url": "https://github.com/cyyever",
"followers_url": "https://api.github.com/users/cyyever/followers",
"following_url": "https://api.github.com/users/cyyever/following{/other_user}",
"gists_url": "https://api.github.com/users/cyyever/gists{/gist_id}",
"starred_url": "https://api.github.com/users/cyyever/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cyyever/subscriptions",
"organizations_url": "https://api.github.com/users/cyyever/orgs",
"repos_url": "https://api.github.com/users/cyyever/repos",
"events_url": "https://api.github.com/users/cyyever/events{/privacy}",
"received_events_url": "https://api.github.com/users/cyyever/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-15T14:02:37 | 2025-08-18T15:07:21 | 2025-08-18T14:17:17 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40204",
"html_url": "https://github.com/huggingface/transformers/pull/40204",
"diff_url": "https://github.com/huggingface/transformers/pull/40204.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40204.patch",
"merged_at": "2025-08-18T14:17:16"
} | # What does this PR do?
Fix more pylint warnings.
| {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40204/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40204/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40203 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40203/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40203/comments | https://api.github.com/repos/huggingface/transformers/issues/40203/events | https://github.com/huggingface/transformers/pull/40203 | 3,325,360,743 | PR_kwDOCUB6oc6j2Aoi | 40,203 | Fix mamba caches | {
"login": "manueldeprada",
"id": 6536835,
"node_id": "MDQ6VXNlcjY1MzY4MzU=",
"avatar_url": "https://avatars.githubusercontent.com/u/6536835?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/manueldeprada",
"html_url": "https://github.com/manueldeprada",
"followers_url": "https://api.github.com/users/manueldeprada/followers",
"following_url": "https://api.github.com/users/manueldeprada/following{/other_user}",
"gists_url": "https://api.github.com/users/manueldeprada/gists{/gist_id}",
"starred_url": "https://api.github.com/users/manueldeprada/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/manueldeprada/subscriptions",
"organizations_url": "https://api.github.com/users/manueldeprada/orgs",
"repos_url": "https://api.github.com/users/manueldeprada/repos",
"events_url": "https://api.github.com/users/manueldeprada/events{/privacy}",
"received_events_url": "https://api.github.com/users/manueldeprada/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 8103865784,
"node_id": "LA_kwDOCUB6oc8AAAAB4wctuA",
"url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch",
"name": "for patch",
"color": "D93F0B",
"default": false,
"description": "Tag issues / labels that should be included in the next patch"
}
] | closed | false | null | [] | null | [] | 2025-08-15T13:56:52 | 2025-08-18T12:27:04 | 2025-08-18T12:27:04 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40203",
"html_url": "https://github.com/huggingface/transformers/pull/40203",
"diff_url": "https://github.com/huggingface/transformers/pull/40203.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40203.patch",
"merged_at": "2025-08-18T12:27:04"
} | This PR takes as base v4.55.2 and adds the fix for mamba-style caches from https://github.com/huggingface/transformers/pull/39797
Tested with vllm-main. | {
"login": "ArthurZucker",
"id": 48595927,
"node_id": "MDQ6VXNlcjQ4NTk1OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArthurZucker",
"html_url": "https://github.com/ArthurZucker",
"followers_url": "https://api.github.com/users/ArthurZucker/followers",
"following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}",
"gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions",
"organizations_url": "https://api.github.com/users/ArthurZucker/orgs",
"repos_url": "https://api.github.com/users/ArthurZucker/repos",
"events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArthurZucker/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40203/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40203/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40202 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40202/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40202/comments | https://api.github.com/repos/huggingface/transformers/issues/40202/events | https://github.com/huggingface/transformers/issues/40202 | 3,325,308,975 | I_kwDOCUB6oc7GNDAv | 40,202 | Transformer serve gpt oss 20b cannot support multi-turn chat | {
"login": "Taimin",
"id": 6102931,
"node_id": "MDQ6VXNlcjYxMDI5MzE=",
"avatar_url": "https://avatars.githubusercontent.com/u/6102931?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Taimin",
"html_url": "https://github.com/Taimin",
"followers_url": "https://api.github.com/users/Taimin/followers",
"following_url": "https://api.github.com/users/Taimin/following{/other_user}",
"gists_url": "https://api.github.com/users/Taimin/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Taimin/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Taimin/subscriptions",
"organizations_url": "https://api.github.com/users/Taimin/orgs",
"repos_url": "https://api.github.com/users/Taimin/repos",
"events_url": "https://api.github.com/users/Taimin/events{/privacy}",
"received_events_url": "https://api.github.com/users/Taimin/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-15T13:35:19 | 2025-09-29T08:02:35 | 2025-09-29T08:02:35 | NONE | null | null | null | null | ### System Info
I installed the environment to run gpt-oss-20b using the following command:
> uv pip install --pre vllm==0.10.1+gptoss \
--extra-index-url https://wheels.vllm.ai/gpt-oss/ \
--extra-index-url https://download.pytorch.org/whl/nightly/cu128 \
--index-strategy unsafe-best-match
My GPU is 5090 and vllm still has difficulty in support it so I tried transformers serve openai/gpt-oss-20b. I cna use the transformer chat command to chat with the model for one turn but as long as I entered the second turn then the following error will occur:
> Traceback (most recent call last):
File "/home/yang/.local/share/uv/python/cpython-3.12.10-linux-x86_64-gnu/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
self.run()
File "/home/yang/.local/share/uv/python/cpython-3.12.10-linux-x86_64-gnu/lib/python3.12/threading.py", line 1012, in run
self._target(*self._args, **self._kwargs)
File "/home/yang/.gptoss/lib/python3.12/site-packages/transformers/commands/serving.py", line 947, in generate_with_cache
generate_output = model.generate(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/transformers/generation/utils.py", line 2629, in generate
result = self._sample(
^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/transformers/generation/utils.py", line 3610, in _sample
outputs = self(**model_inputs, return_dict=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1773, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1784, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/transformers/utils/generic.py", line 959, in wrapper
output = func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/transformers/models/gpt_oss/modeling_gpt_oss.py", line 658, in forward
outputs: MoeModelOutputWithPast = self.model(
^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1773, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1784, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/transformers/utils/generic.py", line 1083, in wrapper
outputs = func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/transformers/models/gpt_oss/modeling_gpt_oss.py", line 491, in forward
hidden_states = decoder_layer(
^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/transformers/modeling_layers.py", line 94, in __call__
return super().__call__(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1773, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1784, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/transformers/models/gpt_oss/modeling_gpt_oss.py", line 370, in forward
hidden_states, _ = self.mlp(hidden_states) # diff with llama: router scores
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1773, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1784, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/transformers/integrations/mxfp4.py", line 300, in mlp_forward
routed_out = self.experts(hidden_states, routing_data, gather_idx, scatter_idx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1773, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1784, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.gptoss/lib/python3.12/site-packages/transformers/integrations/mxfp4.py", line 190, in forward
intermediate_cache1 = matmul_ogs(
^^^^^^^^^^^
File "/home/yang/.cache/huggingface/hub/models--kernels-community--triton_kernels/snapshots/1d2e9557ac0d4c651055a209055748d4db0fe65b/build/torch-universal/triton_kernels/matmul_ogs.py", line 444, in matmul_ogs
opt_flags = make_opt_flags(out_dtype, x.dtype, w.dtype, precision_config,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.cache/huggingface/hub/models--kernels-community--triton_kernels/snapshots/1d2e9557ac0d4c651055a209055748d4db0fe65b/build/torch-universal/triton_kernels/matmul_ogs_details/opt_flags.py", line 297, in make_opt_flags
return make_default_opt_flags_nvidia(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yang/.cache/huggingface/hub/models--kernels-community--triton_kernels/snapshots/1d2e9557ac0d4c651055a209055748d4db0fe65b/build/torch-universal/triton_kernels/matmul_ogs_details/opt_flags.py", line 214, in make_default_opt_flags_nvidia
assert num_stages >= 1
^^^^^^^^^^^^^^^
AssertionError
### Who can help?
_No response_
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
uv venv
uv pip install --pre vllm==0.10.1+gptoss
--extra-index-url https://wheels.vllm.ai/gpt-oss/
--extra-index-url https://download.pytorch.org/whl/nightly/cu128
--index-strategy unsafe-best-match
transformers serve
transformers chat localhost:8000 --model-name-or-path openai/gpt-oss-20b
### Expected behavior
Should support multiturn chat. | {
"login": "github-actions[bot]",
"id": 41898282,
"node_id": "MDM6Qm90NDE4OTgyODI=",
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"html_url": "https://github.com/apps/github-actions",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"type": "Bot",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40202/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40202/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40201 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40201/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40201/comments | https://api.github.com/repos/huggingface/transformers/issues/40201/events | https://github.com/huggingface/transformers/pull/40201 | 3,325,289,021 | PR_kwDOCUB6oc6j1zak | 40,201 | Revert "Pin torch to 2.7.1 on CircleCI for now" + Final fix for `too long with no output` | {
"login": "ydshieh",
"id": 2521628,
"node_id": "MDQ6VXNlcjI1MjE2Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ydshieh",
"html_url": "https://github.com/ydshieh",
"followers_url": "https://api.github.com/users/ydshieh/followers",
"following_url": "https://api.github.com/users/ydshieh/following{/other_user}",
"gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions",
"organizations_url": "https://api.github.com/users/ydshieh/orgs",
"repos_url": "https://api.github.com/users/ydshieh/repos",
"events_url": "https://api.github.com/users/ydshieh/events{/privacy}",
"received_events_url": "https://api.github.com/users/ydshieh/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-15T13:26:40 | 2025-08-18T06:40:55 | 2025-08-18T06:40:53 | COLLABORATOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40201",
"html_url": "https://github.com/huggingface/transformers/pull/40201",
"diff_url": "https://github.com/huggingface/transformers/pull/40201.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40201.patch",
"merged_at": "2025-08-18T06:40:53"
} | Reverts huggingface/transformers#40174 + Final fix for `too long with no output`
This will use a custom pytest where we replace
> raise SystemExit(pytest.console_main())
to
> os._exit(pytest.console_main())
to force exit immediately, without calling exit (cleanup) handlers and flush the buffers. | {
"login": "ydshieh",
"id": 2521628,
"node_id": "MDQ6VXNlcjI1MjE2Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ydshieh",
"html_url": "https://github.com/ydshieh",
"followers_url": "https://api.github.com/users/ydshieh/followers",
"following_url": "https://api.github.com/users/ydshieh/following{/other_user}",
"gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions",
"organizations_url": "https://api.github.com/users/ydshieh/orgs",
"repos_url": "https://api.github.com/users/ydshieh/repos",
"events_url": "https://api.github.com/users/ydshieh/events{/privacy}",
"received_events_url": "https://api.github.com/users/ydshieh/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40201/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40201/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40200 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40200/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40200/comments | https://api.github.com/repos/huggingface/transformers/issues/40200/events | https://github.com/huggingface/transformers/pull/40200 | 3,325,112,140 | PR_kwDOCUB6oc6j1Q9X | 40,200 | Add DeepseekV3ForSequenceClassification for Deepseek V3 models | {
"login": "abdokaseb",
"id": 22381101,
"node_id": "MDQ6VXNlcjIyMzgxMTAx",
"avatar_url": "https://avatars.githubusercontent.com/u/22381101?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/abdokaseb",
"html_url": "https://github.com/abdokaseb",
"followers_url": "https://api.github.com/users/abdokaseb/followers",
"following_url": "https://api.github.com/users/abdokaseb/following{/other_user}",
"gists_url": "https://api.github.com/users/abdokaseb/gists{/gist_id}",
"starred_url": "https://api.github.com/users/abdokaseb/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/abdokaseb/subscriptions",
"organizations_url": "https://api.github.com/users/abdokaseb/orgs",
"repos_url": "https://api.github.com/users/abdokaseb/repos",
"events_url": "https://api.github.com/users/abdokaseb/events{/privacy}",
"received_events_url": "https://api.github.com/users/abdokaseb/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-15T11:56:15 | 2025-08-21T10:01:33 | 2025-08-21T10:01:33 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40200",
"html_url": "https://github.com/huggingface/transformers/pull/40200",
"diff_url": "https://github.com/huggingface/transformers/pull/40200.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40200.patch",
"merged_at": "2025-08-21T10:01:33"
} | # What does this PR do?
Add DeepseekV3ForSequenceClassification for DeepseekV3 models following generic practice
Testing:
Tested with single-node option, loss curve and AUC are all expected with no issue.
- All testes passed
- make fixup passed
Fixes #40199
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ x Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. #40199
- [x] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@ArthurZucker
| {
"login": "ArthurZucker",
"id": 48595927,
"node_id": "MDQ6VXNlcjQ4NTk1OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArthurZucker",
"html_url": "https://github.com/ArthurZucker",
"followers_url": "https://api.github.com/users/ArthurZucker/followers",
"following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}",
"gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions",
"organizations_url": "https://api.github.com/users/ArthurZucker/orgs",
"repos_url": "https://api.github.com/users/ArthurZucker/repos",
"events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArthurZucker/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40200/reactions",
"total_count": 1,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 1,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40200/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40199 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40199/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40199/comments | https://api.github.com/repos/huggingface/transformers/issues/40199/events | https://github.com/huggingface/transformers/issues/40199 | 3,325,085,359 | I_kwDOCUB6oc7GMMav | 40,199 | Add Deepseek v3 For Sequence Classification | {
"login": "AhmedHashish123",
"id": 33344853,
"node_id": "MDQ6VXNlcjMzMzQ0ODUz",
"avatar_url": "https://avatars.githubusercontent.com/u/33344853?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/AhmedHashish123",
"html_url": "https://github.com/AhmedHashish123",
"followers_url": "https://api.github.com/users/AhmedHashish123/followers",
"following_url": "https://api.github.com/users/AhmedHashish123/following{/other_user}",
"gists_url": "https://api.github.com/users/AhmedHashish123/gists{/gist_id}",
"starred_url": "https://api.github.com/users/AhmedHashish123/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AhmedHashish123/subscriptions",
"organizations_url": "https://api.github.com/users/AhmedHashish123/orgs",
"repos_url": "https://api.github.com/users/AhmedHashish123/repos",
"events_url": "https://api.github.com/users/AhmedHashish123/events{/privacy}",
"received_events_url": "https://api.github.com/users/AhmedHashish123/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 2648621985,
"node_id": "MDU6TGFiZWwyNjQ4NjIxOTg1",
"url": "https://api.github.com/repos/huggingface/transformers/labels/Feature%20request",
"name": "Feature request",
"color": "FBCA04",
"default": false,
"description": "Request for a new feature"
}
] | closed | false | null | [] | null | [] | 2025-08-15T11:39:57 | 2025-08-21T10:01:34 | 2025-08-21T10:01:34 | NONE | null | null | null | null | ### Feature request
Hello,
Thanks for your efforts, greatly appreciated. I was wondering when will you add support for a sequence classification for Deepseek v3.
### Motivation
This would be extremely helpful for the tiny model of Deepseek v3 which uses the same class as the original model.
### Your contribution
. | {
"login": "ArthurZucker",
"id": 48595927,
"node_id": "MDQ6VXNlcjQ4NTk1OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArthurZucker",
"html_url": "https://github.com/ArthurZucker",
"followers_url": "https://api.github.com/users/ArthurZucker/followers",
"following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}",
"gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions",
"organizations_url": "https://api.github.com/users/ArthurZucker/orgs",
"repos_url": "https://api.github.com/users/ArthurZucker/repos",
"events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArthurZucker/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40199/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40199/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40198 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40198/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40198/comments | https://api.github.com/repos/huggingface/transformers/issues/40198/events | https://github.com/huggingface/transformers/pull/40198 | 3,325,070,156 | PR_kwDOCUB6oc6j1JRV | 40,198 | Fix mamba caches | {
"login": "manueldeprada",
"id": 6536835,
"node_id": "MDQ6VXNlcjY1MzY4MzU=",
"avatar_url": "https://avatars.githubusercontent.com/u/6536835?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/manueldeprada",
"html_url": "https://github.com/manueldeprada",
"followers_url": "https://api.github.com/users/manueldeprada/followers",
"following_url": "https://api.github.com/users/manueldeprada/following{/other_user}",
"gists_url": "https://api.github.com/users/manueldeprada/gists{/gist_id}",
"starred_url": "https://api.github.com/users/manueldeprada/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/manueldeprada/subscriptions",
"organizations_url": "https://api.github.com/users/manueldeprada/orgs",
"repos_url": "https://api.github.com/users/manueldeprada/repos",
"events_url": "https://api.github.com/users/manueldeprada/events{/privacy}",
"received_events_url": "https://api.github.com/users/manueldeprada/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 8103865784,
"node_id": "LA_kwDOCUB6oc8AAAAB4wctuA",
"url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch",
"name": "for patch",
"color": "D93F0B",
"default": false,
"description": "Tag issues / labels that should be included in the next patch"
}
] | closed | false | null | [] | null | [] | 2025-08-15T11:32:15 | 2025-08-15T13:56:11 | 2025-08-15T13:56:11 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40198",
"html_url": "https://github.com/huggingface/transformers/pull/40198",
"diff_url": "https://github.com/huggingface/transformers/pull/40198.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40198.patch",
"merged_at": null
} | This PR takes as base v4.55.2 and adds the fix for mamba-style caches from https://github.com/huggingface/transformers/pull/39797
Tested with vllm-main. | {
"login": "manueldeprada",
"id": 6536835,
"node_id": "MDQ6VXNlcjY1MzY4MzU=",
"avatar_url": "https://avatars.githubusercontent.com/u/6536835?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/manueldeprada",
"html_url": "https://github.com/manueldeprada",
"followers_url": "https://api.github.com/users/manueldeprada/followers",
"following_url": "https://api.github.com/users/manueldeprada/following{/other_user}",
"gists_url": "https://api.github.com/users/manueldeprada/gists{/gist_id}",
"starred_url": "https://api.github.com/users/manueldeprada/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/manueldeprada/subscriptions",
"organizations_url": "https://api.github.com/users/manueldeprada/orgs",
"repos_url": "https://api.github.com/users/manueldeprada/repos",
"events_url": "https://api.github.com/users/manueldeprada/events{/privacy}",
"received_events_url": "https://api.github.com/users/manueldeprada/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40198/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40198/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40197 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40197/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40197/comments | https://api.github.com/repos/huggingface/transformers/issues/40197/events | https://github.com/huggingface/transformers/pull/40197 | 3,325,045,329 | PR_kwDOCUB6oc6j1Ec8 | 40,197 | Fix GPT-OSS `swiglu_limit` not passed in for MXFP4 | {
"login": "danielhanchen",
"id": 23090290,
"node_id": "MDQ6VXNlcjIzMDkwMjkw",
"avatar_url": "https://avatars.githubusercontent.com/u/23090290?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/danielhanchen",
"html_url": "https://github.com/danielhanchen",
"followers_url": "https://api.github.com/users/danielhanchen/followers",
"following_url": "https://api.github.com/users/danielhanchen/following{/other_user}",
"gists_url": "https://api.github.com/users/danielhanchen/gists{/gist_id}",
"starred_url": "https://api.github.com/users/danielhanchen/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/danielhanchen/subscriptions",
"organizations_url": "https://api.github.com/users/danielhanchen/orgs",
"repos_url": "https://api.github.com/users/danielhanchen/repos",
"events_url": "https://api.github.com/users/danielhanchen/events{/privacy}",
"received_events_url": "https://api.github.com/users/danielhanchen/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 8103865784,
"node_id": "LA_kwDOCUB6oc8AAAAB4wctuA",
"url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch",
"name": "for patch",
"color": "D93F0B",
"default": false,
"description": "Tag issues / labels that should be included in the next patch"
}
] | closed | false | null | [] | null | [] | 2025-08-15T11:18:20 | 2025-08-15T15:04:27 | 2025-08-15T15:04:25 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40197",
"html_url": "https://github.com/huggingface/transformers/pull/40197",
"diff_url": "https://github.com/huggingface/transformers/pull/40197.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40197.patch",
"merged_at": "2025-08-15T15:04:25"
} | `swiglu_limit = 7.0` was not passed in when doing MXFP4 inference when using OpenAI's triton_kernels library. | {
"login": "ArthurZucker",
"id": 48595927,
"node_id": "MDQ6VXNlcjQ4NTk1OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArthurZucker",
"html_url": "https://github.com/ArthurZucker",
"followers_url": "https://api.github.com/users/ArthurZucker/followers",
"following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}",
"gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions",
"organizations_url": "https://api.github.com/users/ArthurZucker/orgs",
"repos_url": "https://api.github.com/users/ArthurZucker/repos",
"events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArthurZucker/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40197/reactions",
"total_count": 1,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 1,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40197/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40196 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40196/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40196/comments | https://api.github.com/repos/huggingface/transformers/issues/40196/events | https://github.com/huggingface/transformers/pull/40196 | 3,325,018,060 | PR_kwDOCUB6oc6j0_VB | 40,196 | Fix mamba caches | {
"login": "manueldeprada",
"id": 6536835,
"node_id": "MDQ6VXNlcjY1MzY4MzU=",
"avatar_url": "https://avatars.githubusercontent.com/u/6536835?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/manueldeprada",
"html_url": "https://github.com/manueldeprada",
"followers_url": "https://api.github.com/users/manueldeprada/followers",
"following_url": "https://api.github.com/users/manueldeprada/following{/other_user}",
"gists_url": "https://api.github.com/users/manueldeprada/gists{/gist_id}",
"starred_url": "https://api.github.com/users/manueldeprada/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/manueldeprada/subscriptions",
"organizations_url": "https://api.github.com/users/manueldeprada/orgs",
"repos_url": "https://api.github.com/users/manueldeprada/repos",
"events_url": "https://api.github.com/users/manueldeprada/events{/privacy}",
"received_events_url": "https://api.github.com/users/manueldeprada/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 8103865784,
"node_id": "LA_kwDOCUB6oc8AAAAB4wctuA",
"url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch",
"name": "for patch",
"color": "D93F0B",
"default": false,
"description": "Tag issues / labels that should be included in the next patch"
}
] | closed | false | null | [] | null | [] | 2025-08-15T11:05:42 | 2025-08-15T11:24:51 | 2025-08-15T11:24:51 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40196",
"html_url": "https://github.com/huggingface/transformers/pull/40196",
"diff_url": "https://github.com/huggingface/transformers/pull/40196.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40196.patch",
"merged_at": null
} | This PR takes as base v4.55.2 and adds the fix for mamba-style caches from #[39797](https://github.com/huggingface/transformers/pull/39797)
Tested with vllm-main. | {
"login": "manueldeprada",
"id": 6536835,
"node_id": "MDQ6VXNlcjY1MzY4MzU=",
"avatar_url": "https://avatars.githubusercontent.com/u/6536835?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/manueldeprada",
"html_url": "https://github.com/manueldeprada",
"followers_url": "https://api.github.com/users/manueldeprada/followers",
"following_url": "https://api.github.com/users/manueldeprada/following{/other_user}",
"gists_url": "https://api.github.com/users/manueldeprada/gists{/gist_id}",
"starred_url": "https://api.github.com/users/manueldeprada/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/manueldeprada/subscriptions",
"organizations_url": "https://api.github.com/users/manueldeprada/orgs",
"repos_url": "https://api.github.com/users/manueldeprada/repos",
"events_url": "https://api.github.com/users/manueldeprada/events{/privacy}",
"received_events_url": "https://api.github.com/users/manueldeprada/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40196/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40196/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40195 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40195/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40195/comments | https://api.github.com/repos/huggingface/transformers/issues/40195/events | https://github.com/huggingface/transformers/pull/40195 | 3,324,990,356 | PR_kwDOCUB6oc6j05v3 | 40,195 | Add repr to EncoderDecoderCache | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-15T10:48:22 | 2025-08-15T11:03:16 | 2025-08-15T10:57:49 | MEMBER | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40195",
"html_url": "https://github.com/huggingface/transformers/pull/40195",
"diff_url": "https://github.com/huggingface/transformers/pull/40195.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40195.patch",
"merged_at": "2025-08-15T10:57:49"
} | # What does this PR do?
Without it, it would inherit the one from Cache, and fail because `self.layers` does not exist in `EncoderDecoderCache` | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40195/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40195/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40194 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40194/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40194/comments | https://api.github.com/repos/huggingface/transformers/issues/40194/events | https://github.com/huggingface/transformers/pull/40194 | 3,324,981,220 | PR_kwDOCUB6oc6j036- | 40,194 | fix to accept cumulative_seqlens from TransformersKwargs in FA | {
"login": "Kurt232",
"id": 71754918,
"node_id": "MDQ6VXNlcjcxNzU0OTE4",
"avatar_url": "https://avatars.githubusercontent.com/u/71754918?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Kurt232",
"html_url": "https://github.com/Kurt232",
"followers_url": "https://api.github.com/users/Kurt232/followers",
"following_url": "https://api.github.com/users/Kurt232/following{/other_user}",
"gists_url": "https://api.github.com/users/Kurt232/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Kurt232/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Kurt232/subscriptions",
"organizations_url": "https://api.github.com/users/Kurt232/orgs",
"repos_url": "https://api.github.com/users/Kurt232/repos",
"events_url": "https://api.github.com/users/Kurt232/events{/privacy}",
"received_events_url": "https://api.github.com/users/Kurt232/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-15T10:42:44 | 2025-08-25T09:02:44 | 2025-08-25T09:00:13 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40194",
"html_url": "https://github.com/huggingface/transformers/pull/40194",
"diff_url": "https://github.com/huggingface/transformers/pull/40194.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40194.patch",
"merged_at": "2025-08-25T09:00:13"
} | The helper _flash_attention_forward now falls back to the keys cumulative_seqlens_q/k that may arrive inside TransformersKwargs when the explicit cu_seq_lens_q/k arguments are absent
A warning is raised on conflict, ensuring users notice any override
# What does this PR do?
I note that current transformer use [TransformersKwargs](https://github.com/huggingface/transformers/blob/4912d5b490a39d621b9d6f1b80df446d99e6239a/src/transformers/utils/generic.py#L856) as extra, but it will refuse the cumulative_seqlens_q and cumulative_seqlens_k args in [flash_attention func](https://github.com/huggingface/transformers/blob/4912d5b490a39d621b9d6f1b80df446d99e6239a/src/transformers/modeling_flash_attention_utils.py#L563), as unmatched argument name.
So I updated `_flash_attention_forward` to ensure compatibility with TransformersKwargs.
Fixes #40193
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests? | {
"login": "ArthurZucker",
"id": 48595927,
"node_id": "MDQ6VXNlcjQ4NTk1OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArthurZucker",
"html_url": "https://github.com/ArthurZucker",
"followers_url": "https://api.github.com/users/ArthurZucker/followers",
"following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}",
"gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions",
"organizations_url": "https://api.github.com/users/ArthurZucker/orgs",
"repos_url": "https://api.github.com/users/ArthurZucker/repos",
"events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArthurZucker/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40194/reactions",
"total_count": 3,
"+1": 3,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40194/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40193 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40193/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40193/comments | https://api.github.com/repos/huggingface/transformers/issues/40193/events | https://github.com/huggingface/transformers/issues/40193 | 3,324,973,384 | I_kwDOCUB6oc7GLxFI | 40,193 | `_flash_attention_forward` can't receive `cumulative_seqlens_q` and `cumulative_seqlens_k` in TransformersKwargs from `Inputs` in forward | {
"login": "Kurt232",
"id": 71754918,
"node_id": "MDQ6VXNlcjcxNzU0OTE4",
"avatar_url": "https://avatars.githubusercontent.com/u/71754918?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Kurt232",
"html_url": "https://github.com/Kurt232",
"followers_url": "https://api.github.com/users/Kurt232/followers",
"following_url": "https://api.github.com/users/Kurt232/following{/other_user}",
"gists_url": "https://api.github.com/users/Kurt232/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Kurt232/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Kurt232/subscriptions",
"organizations_url": "https://api.github.com/users/Kurt232/orgs",
"repos_url": "https://api.github.com/users/Kurt232/repos",
"events_url": "https://api.github.com/users/Kurt232/events{/privacy}",
"received_events_url": "https://api.github.com/users/Kurt232/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-15T10:38:04 | 2025-08-25T09:00:14 | 2025-08-25T09:00:14 | CONTRIBUTOR | null | null | null | null | ### System Info
Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.
- `transformers` version: 4.54.0
- Platform: Linux-6.8.0-64-generic-x86_64-with-glibc2.35
- Python version: 3.10.18
- Huggingface_hub version: 0.34.4
- Safetensors version: 0.6.2
- Accelerate version: 1.10.0
- Accelerate config: not found
- DeepSpeed version: 0.17.4
- PyTorch version (accelerator?): 2.7.1+cu128 (CUDA)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?: <fill in>
- Using GPU in script?: <fill in>
- GPU type: NVIDIA GeForce RTX 5090
### Who can help?
_No response_
### Information
- [ ] The official example scripts
- [x] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [x] My own task or dataset (give details below)
### Reproduction
I note that current transformer use [`TransformersKwargs`](https://github.com/huggingface/transformers/blob/4912d5b490a39d621b9d6f1b80df446d99e6239a/src/transformers/utils/generic.py#L856) as extra, but it will refuse the `cumulative_seqlens_q` and `cumulative_seqlens_k` args in [flash_attention func](https://github.com/huggingface/transformers/blob/4912d5b490a39d621b9d6f1b80df446d99e6239a/src/transformers/modeling_flash_attention_utils.py#L563), as unmatched argument name.
You can run this python script to observe this problem.
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
import pdb
from transformers.modeling_flash_attention_utils import _flash_attention_forward
def _debug(*args, **kwargs):
pdb.set_trace()
return _flash_attention_forward(*args, **kwargs)
import transformers.modeling_flash_attention_utils as m
m._flash_attention_forward = _debug
model_name = "meta-llama/Llama-3.1-8B-Instruct"
tokenizer = AutoTokenizer.from_pretrained(model_name)
tokenizer.pad_token = tokenizer.eos_token
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
low_cpu_mem_usage=True,
device_map="auto",
attn_implementation="flash_attention_2",
)
input_texts = [
"Once upon a time in a faraway land, there lived a wise sage who",
"Once upon a time in a faraway land, there lived a wise sage who"
]
inputs = tokenizer(input_texts, return_tensors="pt", padding=True).to(model.device)
# Construct cumulative_seqlens_q based on attention mask.
# This computes the token count per sample and the cumulative sum, starting with 0.
seq_lengths = inputs["attention_mask"].sum(dim=1)
cumulative_seqlens_q = torch.cat([torch.tensor([0], device=seq_lengths.device), seq_lengths.cumsum(dim=0)])
# For testing, use the same cumulative for k and set max lengths accordingly.
cumulative_seqlens_k = cumulative_seqlens_q # adjust if different logic is needed
max_length_q = inputs["input_ids"].shape[1]
max_length_k = inputs["input_ids"].shape[1]
inputs["cumulative_seqlens_q"] = cumulative_seqlens_q
inputs["cumulative_seqlens_k"] = cumulative_seqlens_k
inputs["max_length_q"] = max_length_q
inputs["max_length_k"] = max_length_k
outputs = model(
**inputs,
)
```
1. step in function and to see locals
(Pdb) where
...
-> return _flash_attention_forward(*args, **kwargs)
(Pdb) s
-> def _flash_attention_forward(
(Pdb) p locals()
...
'softmax_scale': 0.08838834764831845, 'sliding_window': None, 'use_top_left_mask': False, 'softcap': None, 'deterministic': None, **'cu_seq_lens_q': None, 'cu_seq_lens_k': None, 'max_length_q': 17, 'max_length_k': 17,** 'target_dtype': None, 'implementation': None, 'kwargs': {'attn_implementation': 'flash_attention_2', 'layer_idx': 0, 'use_cache': False, **'cumulative_seqlens_q': tensor([ 0, 17, 34], device='cuda:0'), 'cumulative_seqlens_k': tensor([ 0, 17, 34], device='cuda:0')**}}
(Pdb) s
...
-> if not all(k in globals() for k in ("_flash_fn", "_flash_varlen_fn", "_pad_fn", "_unpad_fn", "_is_fa3")):
(Pdb) p cumulative_seqlens_q
*** NameError: name 'cumulative_seqlens_q' is not defined
(Pdb) p cumulative_seqlens_k
*** NameError: name 'cumulative_seqlens_k' is not defined
(Pdb) p max_length_q
17
(Pdb) p max_length_k
17
(Pdb) p cu_seq_lens_q
None
(Pdb) p cu_seq_lens_k
None
### Expected behavior
`cu_seq_lens_q` receives `cumulative_seqlens_q`
`cu_seq_lens_k` receives `cumulative_seqlens_k`
I also created a PR to fix this bug. | {
"login": "ArthurZucker",
"id": 48595927,
"node_id": "MDQ6VXNlcjQ4NTk1OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArthurZucker",
"html_url": "https://github.com/ArthurZucker",
"followers_url": "https://api.github.com/users/ArthurZucker/followers",
"following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}",
"gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions",
"organizations_url": "https://api.github.com/users/ArthurZucker/orgs",
"repos_url": "https://api.github.com/users/ArthurZucker/repos",
"events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArthurZucker/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40193/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40193/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40192 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40192/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40192/comments | https://api.github.com/repos/huggingface/transformers/issues/40192/events | https://github.com/huggingface/transformers/pull/40192 | 3,324,944,624 | PR_kwDOCUB6oc6j0wiI | 40,192 | FIX EncoderDecoderCache broken repr | {
"login": "BenjaminBossan",
"id": 6229650,
"node_id": "MDQ6VXNlcjYyMjk2NTA=",
"avatar_url": "https://avatars.githubusercontent.com/u/6229650?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/BenjaminBossan",
"html_url": "https://github.com/BenjaminBossan",
"followers_url": "https://api.github.com/users/BenjaminBossan/followers",
"following_url": "https://api.github.com/users/BenjaminBossan/following{/other_user}",
"gists_url": "https://api.github.com/users/BenjaminBossan/gists{/gist_id}",
"starred_url": "https://api.github.com/users/BenjaminBossan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/BenjaminBossan/subscriptions",
"organizations_url": "https://api.github.com/users/BenjaminBossan/orgs",
"repos_url": "https://api.github.com/users/BenjaminBossan/repos",
"events_url": "https://api.github.com/users/BenjaminBossan/events{/privacy}",
"received_events_url": "https://api.github.com/users/BenjaminBossan/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-15T10:21:21 | 2025-08-18T15:02:23 | 2025-08-18T15:02:23 | MEMBER | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40192",
"html_url": "https://github.com/huggingface/transformers/pull/40192",
"diff_url": "https://github.com/huggingface/transformers/pull/40192.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40192.patch",
"merged_at": null
} | # What does this PR do?
Currently, trying to print `EncoderDecoderCache` instances results in an error:
> AttributeError: 'EncoderDecoderCache' object has no attribute 'layers'
This PR fixes the error. It adds a couple of tests for `repr`s of cache instances. The tests are not exhaustive but focus on the cache classes already being tested in `test_cache_utils.py`.
Reproducer:
```python
from transformers import DynamicCache, EncoderDecoderCache
print(EncoderDecoderCache(DynamicCache(), DynamicCache()))
```
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests? | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40192/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40192/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40191 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40191/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40191/comments | https://api.github.com/repos/huggingface/transformers/issues/40191/events | https://github.com/huggingface/transformers/pull/40191 | 3,324,853,395 | PR_kwDOCUB6oc6j0fMj | 40,191 | Fix fsdp for generic-task models | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 8103865784,
"node_id": "LA_kwDOCUB6oc8AAAAB4wctuA",
"url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch",
"name": "for patch",
"color": "D93F0B",
"default": false,
"description": "Tag issues / labels that should be included in the next patch"
}
] | closed | false | null | [] | null | [] | 2025-08-15T09:44:08 | 2025-08-15T10:28:18 | 2025-08-15T10:28:16 | MEMBER | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40191",
"html_url": "https://github.com/huggingface/transformers/pull/40191",
"diff_url": "https://github.com/huggingface/transformers/pull/40191.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40191.patch",
"merged_at": "2025-08-15T10:28:16"
} | # What does this PR do?
As per the title. Fixes https://github.com/huggingface/transformers/issues/39977
Inheriting from `ABC` would result in this kind of errors when using fsdp: `TypeError: __class__ assignment: 'FSDPQwen2ForTokenClassification' object layout differs from 'Qwen2ForTokenClassification'`.
As having them inherit from `ABC` was sugar to indicate they should only be used through proper inheritance, it's safe to remove it | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40191/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40191/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40190 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40190/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40190/comments | https://api.github.com/repos/huggingface/transformers/issues/40190/events | https://github.com/huggingface/transformers/pull/40190 | 3,324,853,383 | PR_kwDOCUB6oc6j0fMY | 40,190 | Add GptOssForTokenClassification for GPT-OSS models | {
"login": "abdokaseb",
"id": 22381101,
"node_id": "MDQ6VXNlcjIyMzgxMTAx",
"avatar_url": "https://avatars.githubusercontent.com/u/22381101?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/abdokaseb",
"html_url": "https://github.com/abdokaseb",
"followers_url": "https://api.github.com/users/abdokaseb/followers",
"following_url": "https://api.github.com/users/abdokaseb/following{/other_user}",
"gists_url": "https://api.github.com/users/abdokaseb/gists{/gist_id}",
"starred_url": "https://api.github.com/users/abdokaseb/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/abdokaseb/subscriptions",
"organizations_url": "https://api.github.com/users/abdokaseb/orgs",
"repos_url": "https://api.github.com/users/abdokaseb/repos",
"events_url": "https://api.github.com/users/abdokaseb/events{/privacy}",
"received_events_url": "https://api.github.com/users/abdokaseb/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-15T09:44:08 | 2025-08-22T13:14:46 | 2025-08-22T13:14:46 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40190",
"html_url": "https://github.com/huggingface/transformers/pull/40190",
"diff_url": "https://github.com/huggingface/transformers/pull/40190.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40190.patch",
"merged_at": "2025-08-22T13:14:46"
} | # What does this PR do?
Add GptOssForTokenClassification for GPT-OSS models following generic practice
Testing:
Tested with single-node option, loss curve and AUC are all expected with no issue.
- All testes passed
- make fixup passed
Fixes #40189
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. Link #40189
- [x] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@ArthurZucker
| {
"login": "ArthurZucker",
"id": 48595927,
"node_id": "MDQ6VXNlcjQ4NTk1OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArthurZucker",
"html_url": "https://github.com/ArthurZucker",
"followers_url": "https://api.github.com/users/ArthurZucker/followers",
"following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}",
"gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions",
"organizations_url": "https://api.github.com/users/ArthurZucker/orgs",
"repos_url": "https://api.github.com/users/ArthurZucker/repos",
"events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArthurZucker/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40190/reactions",
"total_count": 1,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 1,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40190/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40189 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40189/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40189/comments | https://api.github.com/repos/huggingface/transformers/issues/40189/events | https://github.com/huggingface/transformers/issues/40189 | 3,324,785,466 | I_kwDOCUB6oc7GLDM6 | 40,189 | Support token classification with GPT-OSS models | {
"login": "abdokaseb",
"id": 22381101,
"node_id": "MDQ6VXNlcjIyMzgxMTAx",
"avatar_url": "https://avatars.githubusercontent.com/u/22381101?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/abdokaseb",
"html_url": "https://github.com/abdokaseb",
"followers_url": "https://api.github.com/users/abdokaseb/followers",
"following_url": "https://api.github.com/users/abdokaseb/following{/other_user}",
"gists_url": "https://api.github.com/users/abdokaseb/gists{/gist_id}",
"starred_url": "https://api.github.com/users/abdokaseb/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/abdokaseb/subscriptions",
"organizations_url": "https://api.github.com/users/abdokaseb/orgs",
"repos_url": "https://api.github.com/users/abdokaseb/repos",
"events_url": "https://api.github.com/users/abdokaseb/events{/privacy}",
"received_events_url": "https://api.github.com/users/abdokaseb/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 2648621985,
"node_id": "MDU6TGFiZWwyNjQ4NjIxOTg1",
"url": "https://api.github.com/repos/huggingface/transformers/labels/Feature%20request",
"name": "Feature request",
"color": "FBCA04",
"default": false,
"description": "Request for a new feature"
}
] | closed | false | null | [] | null | [] | 2025-08-15T09:13:14 | 2025-08-22T13:14:47 | 2025-08-22T13:14:47 | CONTRIBUTOR | null | null | null | null | ### Feature request
Support token classification with GPT-OSS models
### Motivation
Let GPT-OSS models dealing with token classification problems more efficiently
### Your contribution
PR submission | {
"login": "ArthurZucker",
"id": 48595927,
"node_id": "MDQ6VXNlcjQ4NTk1OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArthurZucker",
"html_url": "https://github.com/ArthurZucker",
"followers_url": "https://api.github.com/users/ArthurZucker/followers",
"following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}",
"gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions",
"organizations_url": "https://api.github.com/users/ArthurZucker/orgs",
"repos_url": "https://api.github.com/users/ArthurZucker/repos",
"events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArthurZucker/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40189/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40189/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40188 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40188/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40188/comments | https://api.github.com/repos/huggingface/transformers/issues/40188/events | https://github.com/huggingface/transformers/issues/40188 | 3,324,644,206 | I_kwDOCUB6oc7GKgtu | 40,188 | occur bugs 'CONFIG_MAPPING[vision_config["model_type"]] KeyError: 'vision'' when using deepseek-vl pipeline | {
"login": "WongGawa",
"id": 170488314,
"node_id": "U_kgDOCilx-g",
"avatar_url": "https://avatars.githubusercontent.com/u/170488314?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/WongGawa",
"html_url": "https://github.com/WongGawa",
"followers_url": "https://api.github.com/users/WongGawa/followers",
"following_url": "https://api.github.com/users/WongGawa/following{/other_user}",
"gists_url": "https://api.github.com/users/WongGawa/gists{/gist_id}",
"starred_url": "https://api.github.com/users/WongGawa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/WongGawa/subscriptions",
"organizations_url": "https://api.github.com/users/WongGawa/orgs",
"repos_url": "https://api.github.com/users/WongGawa/repos",
"events_url": "https://api.github.com/users/WongGawa/events{/privacy}",
"received_events_url": "https://api.github.com/users/WongGawa/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-15T08:05:54 | 2025-09-23T08:02:53 | 2025-09-23T08:02:53 | NONE | null | null | null | null | ### System Info
transformers ==4.55.2 on A100, python=3.10
### Who can help?
_No response_
### Information
- [x] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
https://huggingface.co/docs/transformers/main/model_doc/deepseek_vl?usage=AutoModel#notes
1、using huggingface deepseekvl Automodel pipeline example, on python=3.10 & torch=2.6.0 on A100
2、it happens a bug that is
<img width="1681" height="381" alt="Image" src="https://github.com/user-attachments/assets/b13469d7-8fc2-4434-b01f-e943969a9be9" />
### Expected behavior
Thanks | {
"login": "github-actions[bot]",
"id": 41898282,
"node_id": "MDM6Qm90NDE4OTgyODI=",
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"html_url": "https://github.com/apps/github-actions",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"type": "Bot",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40188/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40188/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40187 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40187/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40187/comments | https://api.github.com/repos/huggingface/transformers/issues/40187/events | https://github.com/huggingface/transformers/issues/40187 | 3,324,349,140 | I_kwDOCUB6oc7GJYrU | 40,187 | load_sharded_checkpoint doesn't abide by _checkpoint_conversion_mapping, causing issues when resuming from checkpoint. | {
"login": "reubenvanammers",
"id": 21954459,
"node_id": "MDQ6VXNlcjIxOTU0NDU5",
"avatar_url": "https://avatars.githubusercontent.com/u/21954459?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/reubenvanammers",
"html_url": "https://github.com/reubenvanammers",
"followers_url": "https://api.github.com/users/reubenvanammers/followers",
"following_url": "https://api.github.com/users/reubenvanammers/following{/other_user}",
"gists_url": "https://api.github.com/users/reubenvanammers/gists{/gist_id}",
"starred_url": "https://api.github.com/users/reubenvanammers/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/reubenvanammers/subscriptions",
"organizations_url": "https://api.github.com/users/reubenvanammers/orgs",
"repos_url": "https://api.github.com/users/reubenvanammers/repos",
"events_url": "https://api.github.com/users/reubenvanammers/events{/privacy}",
"received_events_url": "https://api.github.com/users/reubenvanammers/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-15T04:59:16 | 2025-09-22T08:02:56 | 2025-09-22T08:02:56 | NONE | null | null | null | null | ### System Info
- `transformers` version: 4.53.3
- Platform: Linux-6.8.0-1033-aws-x86_64-with-glibc2.35
- Python version: 3.11.9
- Huggingface_hub version: 0.32.2
- Safetensors version: 0.4.3
- Accelerate version: 1.6.0
- Accelerate config: not found
- DeepSpeed version: not installed
- PyTorch version (accelerator?): 2.6.0+cu124 (CUDA)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?: no
- Using GPU in script?: yes
- GPU type: NVIDIA L40S
### Who can help?
_No response_
### Information
- [x] My own modified scripts
### Tasks
- [x] My own task or dataset (give details below)
Finetuning Gemma3, and resuming via an intermediate checkpoint.
### Reproduction
1. Train a model which has a non-empty `_checkpoint_conversion_mapping` attribute. (e.g gemma3)
2. Attempt to resume a checkpoint via the `resume_from_checkpoint` argument
```
trainer.train(resume_from_checkpoint=restore_checkpoint_path)
```
At which point the keys in the state_dict aren't correct, as the weights have been renamed.
### Expected behavior
Behaviour should match from_pretrained, and the checkpoint should just load with the correct weights.
| {
"login": "github-actions[bot]",
"id": 41898282,
"node_id": "MDM6Qm90NDE4OTgyODI=",
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"html_url": "https://github.com/apps/github-actions",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"type": "Bot",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40187/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40187/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40186 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40186/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40186/comments | https://api.github.com/repos/huggingface/transformers/issues/40186/events | https://github.com/huggingface/transformers/issues/40186 | 3,324,060,323 | I_kwDOCUB6oc7GISKj | 40,186 | nccl time out | {
"login": "nicefuture2016",
"id": 18341440,
"node_id": "MDQ6VXNlcjE4MzQxNDQw",
"avatar_url": "https://avatars.githubusercontent.com/u/18341440?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/nicefuture2016",
"html_url": "https://github.com/nicefuture2016",
"followers_url": "https://api.github.com/users/nicefuture2016/followers",
"following_url": "https://api.github.com/users/nicefuture2016/following{/other_user}",
"gists_url": "https://api.github.com/users/nicefuture2016/gists{/gist_id}",
"starred_url": "https://api.github.com/users/nicefuture2016/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nicefuture2016/subscriptions",
"organizations_url": "https://api.github.com/users/nicefuture2016/orgs",
"repos_url": "https://api.github.com/users/nicefuture2016/repos",
"events_url": "https://api.github.com/users/nicefuture2016/events{/privacy}",
"received_events_url": "https://api.github.com/users/nicefuture2016/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-15T01:30:38 | 2025-08-20T05:51:22 | 2025-08-20T05:51:22 | NONE | null | null | null | null | [inference-8B-infer-CoT-multi_5fold_lr_qwen.py](https://github.com/user-attachments/files/21782336/inference-8B-infer-CoT-multi_5fold_lr_qwen.py)
[inference-8B-infer-CoT-multi_5fold_lr_qwen_4.log](https://github.com/user-attachments/files/21782345/inference-8B-infer-CoT-multi_5fold_lr_qwen_4.log)
Please help me check the inference failure on the 8-card H200 server. Attached are the code and logs. Thank you very much. | {
"login": "nicefuture2016",
"id": 18341440,
"node_id": "MDQ6VXNlcjE4MzQxNDQw",
"avatar_url": "https://avatars.githubusercontent.com/u/18341440?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/nicefuture2016",
"html_url": "https://github.com/nicefuture2016",
"followers_url": "https://api.github.com/users/nicefuture2016/followers",
"following_url": "https://api.github.com/users/nicefuture2016/following{/other_user}",
"gists_url": "https://api.github.com/users/nicefuture2016/gists{/gist_id}",
"starred_url": "https://api.github.com/users/nicefuture2016/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nicefuture2016/subscriptions",
"organizations_url": "https://api.github.com/users/nicefuture2016/orgs",
"repos_url": "https://api.github.com/users/nicefuture2016/repos",
"events_url": "https://api.github.com/users/nicefuture2016/events{/privacy}",
"received_events_url": "https://api.github.com/users/nicefuture2016/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40186/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40186/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40185 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40185/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40185/comments | https://api.github.com/repos/huggingface/transformers/issues/40185/events | https://github.com/huggingface/transformers/pull/40185 | 3,323,872,589 | PR_kwDOCUB6oc6jxSYF | 40,185 | Fixed Wrong loss computation for VisionEncoderDecoderModel | {
"login": "Flakes342",
"id": 60060568,
"node_id": "MDQ6VXNlcjYwMDYwNTY4",
"avatar_url": "https://avatars.githubusercontent.com/u/60060568?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Flakes342",
"html_url": "https://github.com/Flakes342",
"followers_url": "https://api.github.com/users/Flakes342/followers",
"following_url": "https://api.github.com/users/Flakes342/following{/other_user}",
"gists_url": "https://api.github.com/users/Flakes342/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Flakes342/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Flakes342/subscriptions",
"organizations_url": "https://api.github.com/users/Flakes342/orgs",
"repos_url": "https://api.github.com/users/Flakes342/repos",
"events_url": "https://api.github.com/users/Flakes342/events{/privacy}",
"received_events_url": "https://api.github.com/users/Flakes342/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T23:26:59 | 2025-09-02T13:47:15 | 2025-09-02T13:47:15 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40185",
"html_url": "https://github.com/huggingface/transformers/pull/40185",
"diff_url": "https://github.com/huggingface/transformers/pull/40185.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40185.patch",
"merged_at": null
} | # What does this PR do?
Fixes #40111
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case. #40111
- [x] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Models:
- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier
Library:
- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
Documentation: @stevhliu
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
Maintained examples (not research project or legacy):
- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1
-->
This PR addresses a critical bug in `VisionEncoderDecoderModel` where loss computation was incorrect due to double-shifting of labels, causing poor training convergence since version 4.50.0.
## Problem
The issue occurred because:
1. `decoder_input_ids` is already shifted right w.r.t the labels in the model
2. The `ForCausalLMLoss` function also shifts labels left internally
3. This double-shifting resulted in misaligned logits and labels, leading to incorrect loss computation
## Solution
- **When `decoder_input_ids` is None**: Manually compute loss using properly shifted logits and labels to avoid double-shifting
- **When `decoder_input_ids` is provided**: Use existing loss function but add a warning about proper alignment
- This ensures correct loss computation in both scenarios while maintaining backward compatibility
## Changes
### Core Changes
- Modified loss computation logic in `VisionEncoderDecoderModel.forward()`
- Added conditional path for manual loss calculation when `decoder_input_ids` is None
- Added warning when `decoder_input_ids` is manually provided
### Test Coverage
- `test_loss_calculation_without_decoder_input_ids`: Validates loss computation without decoder_input_ids
- `test_loss_calculation_paths_comparison`: Ensures both loss calculation paths produce valid results
- Tests added to all relevant encoder-decoder test classes
## Before/After Behavior
**Before**: Double-shifting caused misaligned logits/labels → poor training convergence
**After**: Proper alignment ensures correct loss computation → normal training convergence
## Testing
- All existing tests pass
- New tests validate both loss computation paths
- Backward compatibility maintained
- Warning system alerts users about manual decoder_input_ids usage
I am very new to open source contribution so please let me know if there are any issues or any fixing is required. Thanks! | {
"login": "Flakes342",
"id": 60060568,
"node_id": "MDQ6VXNlcjYwMDYwNTY4",
"avatar_url": "https://avatars.githubusercontent.com/u/60060568?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Flakes342",
"html_url": "https://github.com/Flakes342",
"followers_url": "https://api.github.com/users/Flakes342/followers",
"following_url": "https://api.github.com/users/Flakes342/following{/other_user}",
"gists_url": "https://api.github.com/users/Flakes342/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Flakes342/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Flakes342/subscriptions",
"organizations_url": "https://api.github.com/users/Flakes342/orgs",
"repos_url": "https://api.github.com/users/Flakes342/repos",
"events_url": "https://api.github.com/users/Flakes342/events{/privacy}",
"received_events_url": "https://api.github.com/users/Flakes342/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40185/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40185/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40184 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40184/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40184/comments | https://api.github.com/repos/huggingface/transformers/issues/40184/events | https://github.com/huggingface/transformers/pull/40184 | 3,323,734,336 | PR_kwDOCUB6oc6jw0_z | 40,184 | [`fix`] Pass adamw optimizer parameters to StableAdamW | {
"login": "emapco",
"id": 4152448,
"node_id": "MDQ6VXNlcjQxNTI0NDg=",
"avatar_url": "https://avatars.githubusercontent.com/u/4152448?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/emapco",
"html_url": "https://github.com/emapco",
"followers_url": "https://api.github.com/users/emapco/followers",
"following_url": "https://api.github.com/users/emapco/following{/other_user}",
"gists_url": "https://api.github.com/users/emapco/gists{/gist_id}",
"starred_url": "https://api.github.com/users/emapco/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/emapco/subscriptions",
"organizations_url": "https://api.github.com/users/emapco/orgs",
"repos_url": "https://api.github.com/users/emapco/repos",
"events_url": "https://api.github.com/users/emapco/events{/privacy}",
"received_events_url": "https://api.github.com/users/emapco/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T22:15:25 | 2025-08-20T11:52:24 | 2025-08-20T11:52:24 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40184",
"html_url": "https://github.com/huggingface/transformers/pull/40184",
"diff_url": "https://github.com/huggingface/transformers/pull/40184.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40184.patch",
"merged_at": "2025-08-20T11:52:24"
} | # What does this PR do?
I was getting the following warning when training with `stable_adamw` and `decouple_lr=True`, even though the `TrainingArguments.weight_decay` was set to a different value.
```
optimi/optimizer.py:41: UserWarning: You are using weight_decay=0.01 which is potentially high for decouple_lr=True. Unlike decoupled weight decay, fully decoupled weight decay does not reduce weight decay by the learning rate.
```
I updated the `stable_adamw_kwargs` to include adamw-related TrainingArguments parameters.
https://optimi.benjaminwarner.dev/optimizers/stableadamw/
https://github.com/warner-benjamin/optimi/blob/main/optimi/stableadamw.py#L94
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?
## Who can review?
@SunMarc @qgallouedec
| {
"login": "SunMarc",
"id": 57196510,
"node_id": "MDQ6VXNlcjU3MTk2NTEw",
"avatar_url": "https://avatars.githubusercontent.com/u/57196510?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/SunMarc",
"html_url": "https://github.com/SunMarc",
"followers_url": "https://api.github.com/users/SunMarc/followers",
"following_url": "https://api.github.com/users/SunMarc/following{/other_user}",
"gists_url": "https://api.github.com/users/SunMarc/gists{/gist_id}",
"starred_url": "https://api.github.com/users/SunMarc/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/SunMarc/subscriptions",
"organizations_url": "https://api.github.com/users/SunMarc/orgs",
"repos_url": "https://api.github.com/users/SunMarc/repos",
"events_url": "https://api.github.com/users/SunMarc/events{/privacy}",
"received_events_url": "https://api.github.com/users/SunMarc/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40184/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40184/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40183 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40183/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40183/comments | https://api.github.com/repos/huggingface/transformers/issues/40183/events | https://github.com/huggingface/transformers/issues/40183 | 3,323,732,672 | I_kwDOCUB6oc7GHCLA | 40,183 | 5090 - Random triton kernel crashes depending on batch size on MXFP4 (gpt-oss) | {
"login": "cmp-nct",
"id": 78893154,
"node_id": "MDQ6VXNlcjc4ODkzMTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/78893154?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cmp-nct",
"html_url": "https://github.com/cmp-nct",
"followers_url": "https://api.github.com/users/cmp-nct/followers",
"following_url": "https://api.github.com/users/cmp-nct/following{/other_user}",
"gists_url": "https://api.github.com/users/cmp-nct/gists{/gist_id}",
"starred_url": "https://api.github.com/users/cmp-nct/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cmp-nct/subscriptions",
"organizations_url": "https://api.github.com/users/cmp-nct/orgs",
"repos_url": "https://api.github.com/users/cmp-nct/repos",
"events_url": "https://api.github.com/users/cmp-nct/events{/privacy}",
"received_events_url": "https://api.github.com/users/cmp-nct/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-14T22:14:43 | 2025-09-25T14:43:26 | 2025-09-25T14:43:26 | NONE | null | null | null | null | ### System Info
I do not have a POC, it's happening in a project I am working on.
```
return self.uncompiled_model.generate(
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context
return func(*args, **kwargs)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/transformers/generation/utils.py", line 2629, in generate
result = self._sample(
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/transformers/generation/utils.py", line 3610, in _sample
outputs = self(**model_inputs, return_dict=True)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1773, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1784, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/transformers/utils/generic.py", line 959, in wrapper
output = func(self, *args, **kwargs)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/transformers/models/gpt_oss/modeling_gpt_oss.py", line 658, in forward
outputs: MoeModelOutputWithPast = self.model(
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1773, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1784, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/transformers/utils/generic.py", line 1083, in wrapper
outputs = func(self, *args, **kwargs)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/transformers/models/gpt_oss/modeling_gpt_oss.py", line 491, in forward
hidden_states = decoder_layer(
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/transformers/modeling_layers.py", line 94, in __call__
return super().__call__(*args, **kwargs)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1773, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1784, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/transformers/models/gpt_oss/modeling_gpt_oss.py", line 370, in forward
hidden_states, _ = self.mlp(hidden_states) # diff with llama: router scores
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1773, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1784, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/transformers/integrations/mxfp4.py", line 300, in mlp_forward
routed_out = self.experts(hidden_states, routing_data, gather_idx, scatter_idx)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1773, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1784, in _call_impl
return forward_call(*args, **kwargs)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/transformers/integrations/mxfp4.py", line 190, in forward
intermediate_cache1 = matmul_ogs(
File "/root/.cache/huggingface/hub/models--kernels-community--triton_kernels/snapshots/1d2e9557ac0d4c651055a209055748d4db0fe65b/build/torch-universal/triton_kernels/matmul_ogs.py", line 444, in matmul_ogs
opt_flags = make_opt_flags(out_dtype, x.dtype, w.dtype, precision_config,
File "/root/.cache/huggingface/hub/models--kernels-community--triton_kernels/snapshots/1d2e9557ac0d4c651055a209055748d4db0fe65b/build/torch-universal/triton_kernels/matmul_ogs_details/opt_flags.py", line 297, in make_opt_flags
return make_default_opt_flags_nvidia(*args)
File "/root/.cache/huggingface/hub/models--kernels-community--triton_kernels/snapshots/1d2e9557ac0d4c651055a209055748d4db0fe65b/build/torch-universal/triton_kernels/matmul_ogs_details/opt_flags.py", line 214, in make_default_opt_flags_nvidia
assert num_stages >= 1
AssertionError
```
I've had this happen based on prompt length when doing batched processing as well as depending on batch size.
So switching batch size can make it go away.
However, I also had it work randomly without changing any parameters strangely.
This is with triton 3.4.0 using CU 12.9 and torch 2.8.0, transformers 4.55.2
I've also had this on 4.56.dev0
I tried reinstalling triton kernels, various combinations of versions.
Lastly - Very strangely this is not happening on my 4090 card.
I was under the impression that the 4090 does not even support the new 4 bit quantization, however it works (not defaulting to bf16) and I did not see that error on it.
When including my 5090 or single 5090 inference I get this error randomly - so it's probably related to the hopper kernel.
Sampling is turned off, flash attention not being used.
### Who can help?
_No response_
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
Don't have a POC available.
I thought the stacktrace maybe is already helpful.
I tested it with python 3.10 and 3.12
Here my requirements.txt for 3.12:
```
transformers>=4.55.0
kernels>=0.9.0
datasets==4.0.0
bitsandbytes==0.46.1
trl>=0.20.0
peft>=0.17.0
lighteval==0.10.0
hf-transfer==0.1.8
hf_xet
tensorboard
liger-kernel==0.6.1
deepspeed==0.17.4
lm-eval[api]==0.4.9
Pillow
mlflow
sagemaker-mlflow==0.1.0
triton
git+https://github.com/triton-lang/triton.git@main#subdirectory=python/triton_kernels
pynvml
```
### Expected behavior
no crash | {
"login": "cmp-nct",
"id": 78893154,
"node_id": "MDQ6VXNlcjc4ODkzMTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/78893154?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cmp-nct",
"html_url": "https://github.com/cmp-nct",
"followers_url": "https://api.github.com/users/cmp-nct/followers",
"following_url": "https://api.github.com/users/cmp-nct/following{/other_user}",
"gists_url": "https://api.github.com/users/cmp-nct/gists{/gist_id}",
"starred_url": "https://api.github.com/users/cmp-nct/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cmp-nct/subscriptions",
"organizations_url": "https://api.github.com/users/cmp-nct/orgs",
"repos_url": "https://api.github.com/users/cmp-nct/repos",
"events_url": "https://api.github.com/users/cmp-nct/events{/privacy}",
"received_events_url": "https://api.github.com/users/cmp-nct/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40183/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40183/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40182 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40182/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40182/comments | https://api.github.com/repos/huggingface/transformers/issues/40182/events | https://github.com/huggingface/transformers/pull/40182 | 3,323,531,495 | PR_kwDOCUB6oc6jwJwN | 40,182 | Added Marian encoder/decoder ONNX export helpers and fixed decoder start token/masks; ONNX output now matches PyTorch for OPUS en→ar (addresses #40122). Added SkyPilot job runner docs with single-node/multi-node examples (addresses #40179). | {
"login": "juyterman1000",
"id": 208309368,
"node_id": "U_kgDODGqMeA",
"avatar_url": "https://avatars.githubusercontent.com/u/208309368?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/juyterman1000",
"html_url": "https://github.com/juyterman1000",
"followers_url": "https://api.github.com/users/juyterman1000/followers",
"following_url": "https://api.github.com/users/juyterman1000/following{/other_user}",
"gists_url": "https://api.github.com/users/juyterman1000/gists{/gist_id}",
"starred_url": "https://api.github.com/users/juyterman1000/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/juyterman1000/subscriptions",
"organizations_url": "https://api.github.com/users/juyterman1000/orgs",
"repos_url": "https://api.github.com/users/juyterman1000/repos",
"events_url": "https://api.github.com/users/juyterman1000/events{/privacy}",
"received_events_url": "https://api.github.com/users/juyterman1000/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T20:34:03 | 2025-08-18T04:40:11 | 2025-08-15T12:01:31 | NONE | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40182",
"html_url": "https://github.com/huggingface/transformers/pull/40182",
"diff_url": "https://github.com/huggingface/transformers/pull/40182.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40182.patch",
"merged_at": null
} | …t; fix decoder start token and masks; resolves wrong ONNX output for OPUS en-ar (ref #40122)
# What does this PR do?
<!--
Congratulations! You've made it this far! You're not quite done yet though.
Once 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.
Then, 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.
Once 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.
-->
<!-- Remove if not applicable -->
Fixes # (issue)
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Models:
- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier
Library:
- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
Documentation: @stevhliu
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
Maintained examples (not research project or legacy):
- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1
-->
| {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40182/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40182/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40181 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40181/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40181/comments | https://api.github.com/repos/huggingface/transformers/issues/40181/events | https://github.com/huggingface/transformers/pull/40181 | 3,323,495,027 | PR_kwDOCUB6oc6jwBv1 | 40,181 | Fix ESM token_dropout crash when using inputs_embeds instead of input_ids | {
"login": "notkisk",
"id": 107971634,
"node_id": "U_kgDOBm-EMg",
"avatar_url": "https://avatars.githubusercontent.com/u/107971634?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/notkisk",
"html_url": "https://github.com/notkisk",
"followers_url": "https://api.github.com/users/notkisk/followers",
"following_url": "https://api.github.com/users/notkisk/following{/other_user}",
"gists_url": "https://api.github.com/users/notkisk/gists{/gist_id}",
"starred_url": "https://api.github.com/users/notkisk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/notkisk/subscriptions",
"organizations_url": "https://api.github.com/users/notkisk/orgs",
"repos_url": "https://api.github.com/users/notkisk/repos",
"events_url": "https://api.github.com/users/notkisk/events{/privacy}",
"received_events_url": "https://api.github.com/users/notkisk/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T20:21:16 | 2025-08-18T13:22:48 | 2025-08-18T13:22:10 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40181",
"html_url": "https://github.com/huggingface/transformers/pull/40181",
"diff_url": "https://github.com/huggingface/transformers/pull/40181.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40181.patch",
"merged_at": "2025-08-18T13:22:10"
} | ```markdown
# Fix ESM `token_dropout` crash when using `inputs_embeds` instead of `input_ids`
## Description
This PR fixes an issue in the ESM model where calling `forward` with `inputs_embeds` (and no `input_ids`) would trigger an `AttributeError` in the `token_dropout` logic:
```
AttributeError: 'bool' object has no attribute 'unsqueeze'
```
## Cause
The `token_dropout` block assumed `input_ids` was always provided.
When only `inputs_embeds` were passed, `input_ids` was `None`, leading to a failure when attempting to run `.unsqueeze(-1)`.
## Fix
Updated the conditional to:
```python
if self.token_dropout and input_ids is not None:
```
This ensures the masking logic is only applied when `input_ids` are available.
The behavior now mirrors other BERT-like models while retaining ESM's mask-dropout logic when possible.
## Impact
- `inputs_embeds`-only inference now works without disabling `token_dropout`.
- No change for the standard `input_ids` usage.
- Fully backward compatible.
## Reproduction
```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
esm_version = "facebook/esm2_t6_8M_UR50D"
tokenizer = AutoTokenizer.from_pretrained(esm_version)
model = AutoModelForSequenceClassification.from_pretrained(esm_version)
seq = ["HHASPRKQGKKENGPPHSHTLKGRRLVFDN"]
tok = tokenizer(seq, return_tensors="pt", truncation=True, max_length=1024)
embeds = model.esm.embeddings.word_embeddings(tok["input_ids"])
outputs = model(inputs_embeds=embeds) # ✅ No error after fix
```
## Related Issue
Fixes #40166
``` | {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40181/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40181/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40180 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40180/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40180/comments | https://api.github.com/repos/huggingface/transformers/issues/40180/events | https://github.com/huggingface/transformers/pull/40180 | 3,323,377,590 | PR_kwDOCUB6oc6jvn9z | 40,180 | Enable native mxfp4 training support for GPT-OSS models | {
"login": "akacmazz",
"id": 32853513,
"node_id": "MDQ6VXNlcjMyODUzNTEz",
"avatar_url": "https://avatars.githubusercontent.com/u/32853513?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/akacmazz",
"html_url": "https://github.com/akacmazz",
"followers_url": "https://api.github.com/users/akacmazz/followers",
"following_url": "https://api.github.com/users/akacmazz/following{/other_user}",
"gists_url": "https://api.github.com/users/akacmazz/gists{/gist_id}",
"starred_url": "https://api.github.com/users/akacmazz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/akacmazz/subscriptions",
"organizations_url": "https://api.github.com/users/akacmazz/orgs",
"repos_url": "https://api.github.com/users/akacmazz/repos",
"events_url": "https://api.github.com/users/akacmazz/events{/privacy}",
"received_events_url": "https://api.github.com/users/akacmazz/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | [] | 2025-08-14T19:38:13 | 2025-08-18T16:58:40 | null | NONE | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40180",
"html_url": "https://github.com/huggingface/transformers/pull/40180",
"diff_url": "https://github.com/huggingface/transformers/pull/40180.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40180.patch",
"merged_at": null
} | # Enable native mxfp4 training support for GPT-OSS models
Fixes #40170
## What does this PR do?
This PR adds the foundational infrastructure to enable native mxfp4 training for GPT-OSS models, addressing the issue where users currently must convert 4-bit weights to bfloat16 for training (using 4X more memory).
### Key Features:
- **Native mxfp4 training support** with `enable_training` flag
- **Hardware-aware execution** with automatic backend selection (FP4/FP8/BF16)
- **4X memory savings** during training by keeping weights quantized
## Implementation Details
### 1. Configuration Layer
- Added `enable_training` parameter to `Mxfp4Config`
- Updated `is_trainable` property in `Mxfp4HfQuantizer`
### 2. PyTorch Autograd Integration
- Created `MxFp4MatMulFunction` custom autograd function
- Implemented gradient flow through quantized weights
- Added `mxfp4_matmul_with_gradients` wrapper function
### 3. Hardware Detection & Fallback
- Automatic GPU capability detection (H100/A100/T4)
- Progressive fallback chain: FP4 → FP8 → BF16
- Performance estimation for different backends
### 4. Expert Module Enhancement
- Modified `Mxfp4GptOssExperts` with dual forward paths
- Added `enable_mxfp4_training()` method for gradient activation
- Separate paths for training vs inference
### 5. Testing Infrastructure
- Added comprehensive test suite in `tests/quantization/mxfp4/test_mxfp4.py`
- Hardware detection tests
- Training configuration tests
- Memory efficiency validation
## Usage Example
```python
from transformers import Mxfp4Config, GptOssForCausalLM
# Enable native mxfp4 training
config = Mxfp4Config(enable_training=True)
model = GptOssForCausalLM.from_pretrained(
"openai/gpt-oss-20b",
quantization_config=config,
torch_dtype=torch.bfloat16,
device_map="auto"
)
# Model is now ready for 4X memory-efficient training!
model.train()
```
## Hardware Support
| GPU | Backend | Performance | Memory Savings |
|-----|---------|------------|----------------|
| H100/B100/50xx | FP4 Native | ~95% | 4X |
| A100/L4 | FP8 Fallback | ~85% | 4X |
| T4/V100 | BF16 Fallback | ~70% | 4X |
## Design Documentation
A comprehensive design specification for Triton backward kernels has been created at `MXFP4_BACKWARD_KERNEL_DESIGN.md`, providing:
- Detailed kernel signatures and interfaces
- Hardware-specific optimization strategies
- Memory layout specifications
- Integration points with PyTorch autograd
## Current Status
✅ **Transformers Integration: Complete**
- All infrastructure for mxfp4 training is ready
- Hardware detection and fallback mechanisms working
- Tests passing (excluding model-specific tests that require GPT-OSS)
⏳ **Pending: Triton Kernel Implementation**
- Backward kernels need to be implemented in `kernels-community/triton_kernels`
- Once kernels are available, this infrastructure will automatically use them
- Currently falls back to BF16 computation for gradients
## Testing
```bash
# Run configuration tests
python -m pytest tests/quantization/mxfp4/test_mxfp4.py::Mxfp4ConfigTest -v
# Run hardware detection tests
python -m pytest tests/quantization/mxfp4/test_mxfp4.py::Mxfp4HardwareDetectionTest -v
# Run training tests
python -m pytest tests/quantization/mxfp4/test_mxfp4.py::Mxfp4TrainingConfigTest -v
```
## Before submitting
- [x] This PR fixes a specific issue (enables mxfp4 training as requested)
- [x] The code follows the repository's style guidelines
- [x] Tests have been added for new functionality
- [x] Documentation has been updated (design spec included)
- [x] The code is ready for review
## Who can review?
@SunMarc @MekkCyber @Rocketknight1
This PR provides the Transformers-side infrastructure for native mxfp4 training. The actual Triton backward kernels will need to be implemented separately in the `triton-kernels` repository, but once available, this infrastructure will automatically utilize them.
cc @Rocketknight1 (mentioned in the original issue as able to help with integration)
| null | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40180/reactions",
"total_count": 3,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 3,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40180/timeline | null | null | null | null | true | false |
https://api.github.com/repos/huggingface/transformers/issues/40179 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40179/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40179/comments | https://api.github.com/repos/huggingface/transformers/issues/40179/events | https://github.com/huggingface/transformers/issues/40179 | 3,323,270,819 | I_kwDOCUB6oc7GFRaj | 40,179 | [docs] Running jobs with SkyPilot | {
"login": "alex000kim",
"id": 17241029,
"node_id": "MDQ6VXNlcjE3MjQxMDI5",
"avatar_url": "https://avatars.githubusercontent.com/u/17241029?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alex000kim",
"html_url": "https://github.com/alex000kim",
"followers_url": "https://api.github.com/users/alex000kim/followers",
"following_url": "https://api.github.com/users/alex000kim/following{/other_user}",
"gists_url": "https://api.github.com/users/alex000kim/gists{/gist_id}",
"starred_url": "https://api.github.com/users/alex000kim/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alex000kim/subscriptions",
"organizations_url": "https://api.github.com/users/alex000kim/orgs",
"repos_url": "https://api.github.com/users/alex000kim/repos",
"events_url": "https://api.github.com/users/alex000kim/events{/privacy}",
"received_events_url": "https://api.github.com/users/alex000kim/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 2648621985,
"node_id": "MDU6TGFiZWwyNjQ4NjIxOTg1",
"url": "https://api.github.com/repos/huggingface/transformers/labels/Feature%20request",
"name": "Feature request",
"color": "FBCA04",
"default": false,
"description": "Request for a new feature"
}
] | open | false | null | [] | null | [] | 2025-08-14T18:59:12 | 2025-08-15T13:52:27 | null | NONE | null | null | null | null | ### Feature request
There are SLURM examples in your docs e.g. https://github.com/huggingface/transformers/blob/31b6e6e1dac0d32f74ec5cd6b3c1868534ccd7b5/docs/source/en/deepspeed.md
but I am a [SkyPilot](https://docs.skypilot.co/en/latest/docs/index.html) user and would like to have those as well.
### Motivation
SkyPilot is used by/integrated with most major hyperscalers and neoclouds and it'd be good to have SkyPilot examples in your docs.
- https://docs.nvidia.com/nemo-framework/user-guide/24.09/nemorun/guides/execution.html
- https://aws.amazon.com/blogs/machine-learning/streamline-machine-learning-workflows-with-skypilot-on-amazon-sagemaker-hyperpod/
- https://gke-ai-labs.dev/docs/tutorials/workflow-orchestration/skypilot/cross-region-capacity-chasing/
- https://cloud.google.com/blog/topics/hpc/salk-institute-brain-mapping-on-google-cloud-with-skypilot
- https://nebius.com/blog/posts/nebius-ai-cloud-skypilot-integration
- https://a16z.com/announcing-our-latest-open-source-ai-grants/
### Your contribution
If you want to can pick up the task and create a PR. LMK, thanks! | null | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40179/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40179/timeline | null | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | false |
https://api.github.com/repos/huggingface/transformers/issues/40178 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40178/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40178/comments | https://api.github.com/repos/huggingface/transformers/issues/40178/events | https://github.com/huggingface/transformers/pull/40178 | 3,323,163,301 | PR_kwDOCUB6oc6ju6yG | 40,178 | [`kernels`] If flash attention2 is not installed / fails to import (cc on our cluster) default to kernels | {
"login": "ArthurZucker",
"id": 48595927,
"node_id": "MDQ6VXNlcjQ4NTk1OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArthurZucker",
"html_url": "https://github.com/ArthurZucker",
"followers_url": "https://api.github.com/users/ArthurZucker/followers",
"following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}",
"gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions",
"organizations_url": "https://api.github.com/users/ArthurZucker/orgs",
"repos_url": "https://api.github.com/users/ArthurZucker/repos",
"events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArthurZucker/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 6202871275,
"node_id": "LA_kwDOCUB6oc8AAAABcbhN6w",
"url": "https://api.github.com/repos/huggingface/transformers/labels/Flash%20Attention",
"name": "Flash Attention",
"color": "201FF8",
"default": false,
"description": ""
},
{
"id": 8439734066,
"node_id": "LA_kwDOCUB6oc8AAAAB9wwfMg",
"url": "https://api.github.com/repos/huggingface/transformers/labels/kernels",
"name": "kernels",
"color": "4C3716",
"default": false,
"description": ""
}
] | closed | false | null | [] | null | [] | 2025-08-14T18:17:40 | 2025-08-28T14:20:27 | 2025-08-28T14:20:25 | COLLABORATOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40178",
"html_url": "https://github.com/huggingface/transformers/pull/40178",
"diff_url": "https://github.com/huggingface/transformers/pull/40178.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40178.patch",
"merged_at": "2025-08-28T14:20:25"
} | # Improves handling of FlashAttention2 + add community kernel fallback
* Updated `_check_and_adjust_attn_implementation` to set the attention implementation to `kernels-community/flash-attn` when FlashAttention2 is requested but not available, ensuring seamless fallback and proper kernel registration.
**Testing Improvements:**
* Modified `require_flash_attn` in `testing_utils.py` to allow tests to run if either FlashAttention2 or the community kernel is available, broadening test coverage and reliability. | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40178/reactions",
"total_count": 2,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 2,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40178/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40177 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40177/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40177/comments | https://api.github.com/repos/huggingface/transformers/issues/40177/events | https://github.com/huggingface/transformers/pull/40177 | 3,322,952,361 | PR_kwDOCUB6oc6juN_h | 40,177 | Revert text_positions in Qwen25VL | {
"login": "pengzhenghao",
"id": 22206995,
"node_id": "MDQ6VXNlcjIyMjA2OTk1",
"avatar_url": "https://avatars.githubusercontent.com/u/22206995?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pengzhenghao",
"html_url": "https://github.com/pengzhenghao",
"followers_url": "https://api.github.com/users/pengzhenghao/followers",
"following_url": "https://api.github.com/users/pengzhenghao/following{/other_user}",
"gists_url": "https://api.github.com/users/pengzhenghao/gists{/gist_id}",
"starred_url": "https://api.github.com/users/pengzhenghao/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pengzhenghao/subscriptions",
"organizations_url": "https://api.github.com/users/pengzhenghao/orgs",
"repos_url": "https://api.github.com/users/pengzhenghao/repos",
"events_url": "https://api.github.com/users/pengzhenghao/events{/privacy}",
"received_events_url": "https://api.github.com/users/pengzhenghao/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | [] | 2025-08-14T17:08:14 | 2025-08-27T12:13:34 | null | NONE | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40177",
"html_url": "https://github.com/huggingface/transformers/pull/40177",
"diff_url": "https://github.com/huggingface/transformers/pull/40177.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40177.patch",
"merged_at": null
} | # What does this PR do?
<!--
Congratulations! You've made it this far! You're not quite done yet though.
Once 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.
Then, 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.
Once 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.
-->
<!-- Remove if not applicable -->
Fixes # (issue)
Remove problematic text_position_ids preparation when generating with Qwen2.5VL model.
Fixes #40154 (The Qwen 2.5 VL text position ID issue)
Fixes #40136 (Qwen2.5VL performance drop)
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Models:
- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier
Library:
- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
Documentation: @stevhliu
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
Maintained examples (not research project or legacy):
- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1
-->
| null | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40177/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40177/timeline | null | null | null | null | true | false |
https://api.github.com/repos/huggingface/transformers/issues/40176 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40176/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40176/comments | https://api.github.com/repos/huggingface/transformers/issues/40176/events | https://github.com/huggingface/transformers/pull/40176 | 3,322,951,714 | PR_kwDOCUB6oc6juN2Z | 40,176 | [`Mxfp4`] Add a way to save with a quantization method | {
"login": "ArthurZucker",
"id": 48595927,
"node_id": "MDQ6VXNlcjQ4NTk1OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArthurZucker",
"html_url": "https://github.com/ArthurZucker",
"followers_url": "https://api.github.com/users/ArthurZucker/followers",
"following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}",
"gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions",
"organizations_url": "https://api.github.com/users/ArthurZucker/orgs",
"repos_url": "https://api.github.com/users/ArthurZucker/repos",
"events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArthurZucker/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3716956449,
"node_id": "LA_kwDOCUB6oc7djEEh",
"url": "https://api.github.com/repos/huggingface/transformers/labels/Quantization",
"name": "Quantization",
"color": "971399",
"default": false,
"description": ""
}
] | closed | false | null | [] | null | [] | 2025-08-14T17:08:04 | 2025-08-25T14:27:37 | 2025-08-25T14:27:19 | COLLABORATOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40176",
"html_url": "https://github.com/huggingface/transformers/pull/40176",
"diff_url": "https://github.com/huggingface/transformers/pull/40176.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40176.patch",
"merged_at": "2025-08-25T14:27:19"
} | # What does this PR do?
Allows saving gpt_oss after it was trained. You can also save a mxfp4 model.
```python
import torch
import gc
from transformers import Mxfp4Config, GptOssForCausalLM, AutoTokenizer
model_name = "hf-internal-testing/gpt-oss-20b-bf16"
loaded_model = GptOssForCausalLM.from_pretrained(
model_name,
quantization_config=Mxfp4Config(),
torch_dtype=torch.bfloat16,
device_map="cuda",
)
model.save_pretrained("gpt-oss-20b-quantized")
loaded_model = GptOssForCausalLM.from_pretrained(
"gpt-oss-20b-quantized",
torch_dtype=torch.bfloat16,
device_map="cuda",
)
print(tokenizer.batch_decode(loaded_model.generate(**tokenizer("Once upon a time", return_tensors="pt").to(loaded_model.device))))
```
| {
"login": "ArthurZucker",
"id": 48595927,
"node_id": "MDQ6VXNlcjQ4NTk1OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArthurZucker",
"html_url": "https://github.com/ArthurZucker",
"followers_url": "https://api.github.com/users/ArthurZucker/followers",
"following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}",
"gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions",
"organizations_url": "https://api.github.com/users/ArthurZucker/orgs",
"repos_url": "https://api.github.com/users/ArthurZucker/repos",
"events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArthurZucker/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40176/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40176/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40175 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40175/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40175/comments | https://api.github.com/repos/huggingface/transformers/issues/40175/events | https://github.com/huggingface/transformers/pull/40175 | 3,322,925,802 | PR_kwDOCUB6oc6juIYv | 40,175 | Fix typos | {
"login": "cyyever",
"id": 17618148,
"node_id": "MDQ6VXNlcjE3NjE4MTQ4",
"avatar_url": "https://avatars.githubusercontent.com/u/17618148?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cyyever",
"html_url": "https://github.com/cyyever",
"followers_url": "https://api.github.com/users/cyyever/followers",
"following_url": "https://api.github.com/users/cyyever/following{/other_user}",
"gists_url": "https://api.github.com/users/cyyever/gists{/gist_id}",
"starred_url": "https://api.github.com/users/cyyever/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cyyever/subscriptions",
"organizations_url": "https://api.github.com/users/cyyever/orgs",
"repos_url": "https://api.github.com/users/cyyever/repos",
"events_url": "https://api.github.com/users/cyyever/events{/privacy}",
"received_events_url": "https://api.github.com/users/cyyever/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T16:59:39 | 2025-08-15T13:02:54 | 2025-08-15T12:10:26 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40175",
"html_url": "https://github.com/huggingface/transformers/pull/40175",
"diff_url": "https://github.com/huggingface/transformers/pull/40175.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40175.patch",
"merged_at": "2025-08-15T12:10:26"
} | # What does this PR do?
Fix some typos in comments.
| {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40175/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40175/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40174 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40174/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40174/comments | https://api.github.com/repos/huggingface/transformers/issues/40174/events | https://github.com/huggingface/transformers/pull/40174 | 3,322,851,963 | PR_kwDOCUB6oc6jt4Ox | 40,174 | Pin torch to 2.7.1 on CircleCI for now | {
"login": "ydshieh",
"id": 2521628,
"node_id": "MDQ6VXNlcjI1MjE2Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ydshieh",
"html_url": "https://github.com/ydshieh",
"followers_url": "https://api.github.com/users/ydshieh/followers",
"following_url": "https://api.github.com/users/ydshieh/following{/other_user}",
"gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions",
"organizations_url": "https://api.github.com/users/ydshieh/orgs",
"repos_url": "https://api.github.com/users/ydshieh/repos",
"events_url": "https://api.github.com/users/ydshieh/events{/privacy}",
"received_events_url": "https://api.github.com/users/ydshieh/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T16:38:27 | 2025-08-14T18:19:36 | 2025-08-14T18:19:35 | COLLABORATOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40174",
"html_url": "https://github.com/huggingface/transformers/pull/40174",
"diff_url": "https://github.com/huggingface/transformers/pull/40174.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40174.patch",
"merged_at": "2025-08-14T18:19:35"
} | # What does this PR do?
It's possible torch 2.8 causing much more `Too long without output` on CircleCI jobs. | {
"login": "ydshieh",
"id": 2521628,
"node_id": "MDQ6VXNlcjI1MjE2Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ydshieh",
"html_url": "https://github.com/ydshieh",
"followers_url": "https://api.github.com/users/ydshieh/followers",
"following_url": "https://api.github.com/users/ydshieh/following{/other_user}",
"gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions",
"organizations_url": "https://api.github.com/users/ydshieh/orgs",
"repos_url": "https://api.github.com/users/ydshieh/repos",
"events_url": "https://api.github.com/users/ydshieh/events{/privacy}",
"received_events_url": "https://api.github.com/users/ydshieh/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40174/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40174/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40173 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40173/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40173/comments | https://api.github.com/repos/huggingface/transformers/issues/40173/events | https://github.com/huggingface/transformers/pull/40173 | 3,322,841,130 | PR_kwDOCUB6oc6jt15D | 40,173 | Chat Template Doc Fixes | {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T16:35:19 | 2025-08-22T14:48:35 | 2025-08-22T14:48:33 | MEMBER | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40173",
"html_url": "https://github.com/huggingface/transformers/pull/40173",
"diff_url": "https://github.com/huggingface/transformers/pull/40173.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40173.patch",
"merged_at": "2025-08-22T14:48:33"
} | The chat template docs were split into multiple parts and also refactored in recent PRs. The result is quite messy in some cases, and several examples are incomplete, or the text is misleading. I only noticed when I tried to refer to the docs while writing the `gpt-oss` template and realized that in many cases the text said things about chat templates that were completely incorrect or very unclear! This PR aims to fix it all up. | {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40173/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40173/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40172 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40172/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40172/comments | https://api.github.com/repos/huggingface/transformers/issues/40172/events | https://github.com/huggingface/transformers/pull/40172 | 3,322,834,097 | PR_kwDOCUB6oc6jt0bN | 40,172 | [Fast Image Processors] Add `call_only_args` attribute + test | {
"login": "yonigozlan",
"id": 74535834,
"node_id": "MDQ6VXNlcjc0NTM1ODM0",
"avatar_url": "https://avatars.githubusercontent.com/u/74535834?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yonigozlan",
"html_url": "https://github.com/yonigozlan",
"followers_url": "https://api.github.com/users/yonigozlan/followers",
"following_url": "https://api.github.com/users/yonigozlan/following{/other_user}",
"gists_url": "https://api.github.com/users/yonigozlan/gists{/gist_id}",
"starred_url": "https://api.github.com/users/yonigozlan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yonigozlan/subscriptions",
"organizations_url": "https://api.github.com/users/yonigozlan/orgs",
"repos_url": "https://api.github.com/users/yonigozlan/repos",
"events_url": "https://api.github.com/users/yonigozlan/events{/privacy}",
"received_events_url": "https://api.github.com/users/yonigozlan/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T16:33:02 | 2025-10-16T09:19:48 | 2025-10-16T09:19:48 | MEMBER | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40172",
"html_url": "https://github.com/huggingface/transformers/pull/40172",
"diff_url": "https://github.com/huggingface/transformers/pull/40172.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40172.patch",
"merged_at": null
} | # What does this PR do?
As the title says, this seems to be more and more relevant for downstream libraries, namely vLLM Cc @hmellor
It's another attribute to think about when contributing a new fast image processor, but as this one is tested for, no choice but to add it correctly 😉. Maybe we should add this kind of tests for other models/processor attributes that are not always respected? | {
"login": "yonigozlan",
"id": 74535834,
"node_id": "MDQ6VXNlcjc0NTM1ODM0",
"avatar_url": "https://avatars.githubusercontent.com/u/74535834?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yonigozlan",
"html_url": "https://github.com/yonigozlan",
"followers_url": "https://api.github.com/users/yonigozlan/followers",
"following_url": "https://api.github.com/users/yonigozlan/following{/other_user}",
"gists_url": "https://api.github.com/users/yonigozlan/gists{/gist_id}",
"starred_url": "https://api.github.com/users/yonigozlan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yonigozlan/subscriptions",
"organizations_url": "https://api.github.com/users/yonigozlan/orgs",
"repos_url": "https://api.github.com/users/yonigozlan/repos",
"events_url": "https://api.github.com/users/yonigozlan/events{/privacy}",
"received_events_url": "https://api.github.com/users/yonigozlan/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40172/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40172/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40171 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40171/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40171/comments | https://api.github.com/repos/huggingface/transformers/issues/40171/events | https://github.com/huggingface/transformers/pull/40171 | 3,322,773,193 | PR_kwDOCUB6oc6jtnmy | 40,171 | Rename to CamelCase | {
"login": "qubvel",
"id": 31920396,
"node_id": "MDQ6VXNlcjMxOTIwMzk2",
"avatar_url": "https://avatars.githubusercontent.com/u/31920396?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/qubvel",
"html_url": "https://github.com/qubvel",
"followers_url": "https://api.github.com/users/qubvel/followers",
"following_url": "https://api.github.com/users/qubvel/following{/other_user}",
"gists_url": "https://api.github.com/users/qubvel/gists{/gist_id}",
"starred_url": "https://api.github.com/users/qubvel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/qubvel/subscriptions",
"organizations_url": "https://api.github.com/users/qubvel/orgs",
"repos_url": "https://api.github.com/users/qubvel/repos",
"events_url": "https://api.github.com/users/qubvel/events{/privacy}",
"received_events_url": "https://api.github.com/users/qubvel/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | [] | 2025-08-14T16:12:04 | 2025-08-21T09:58:21 | null | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40171",
"html_url": "https://github.com/huggingface/transformers/pull/40171",
"diff_url": "https://github.com/huggingface/transformers/pull/40171.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40171.patch",
"merged_at": null
} | # What does this PR do?
Rename DINOv3ViT -> Dinov3Vit, DINOv3 -> Dinov3
cc @ArthurZucker
| null | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40171/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40171/timeline | null | null | null | null | true | false |
https://api.github.com/repos/huggingface/transformers/issues/40170 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40170/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40170/comments | https://api.github.com/repos/huggingface/transformers/issues/40170/events | https://github.com/huggingface/transformers/issues/40170 | 3,322,673,775 | I_kwDOCUB6oc7GC_pv | 40,170 | Add MXFP4 MoE/attention backward kernels | {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3081136536,
"node_id": "MDU6TGFiZWwzMDgxMTM2NTM2",
"url": "https://api.github.com/repos/huggingface/transformers/labels/Good%20Difficult%20Issue",
"name": "Good Difficult Issue",
"color": "684CC7",
"default": false,
"description": ""
},
{
"id": 3716956449,
"node_id": "LA_kwDOCUB6oc7djEEh",
"url": "https://api.github.com/repos/huggingface/transformers/labels/Quantization",
"name": "Quantization",
"color": "971399",
"default": false,
"description": ""
},
{
"id": 6126880899,
"node_id": "LA_kwDOCUB6oc8AAAABbTDIgw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/contributions-welcome",
"name": "contributions-welcome",
"color": "F99E09",
"default": false,
"description": ""
},
{
"id": 7510456769,
"node_id": "LA_kwDOCUB6oc8AAAABv6h5wQ",
"url": "https://api.github.com/repos/huggingface/transformers/labels/Mixture%20of%20Experts",
"name": "Mixture of Experts",
"color": "DDB5D0",
"default": false,
"description": ""
},
{
"id": 8439734066,
"node_id": "LA_kwDOCUB6oc8AAAAB9wwfMg",
"url": "https://api.github.com/repos/huggingface/transformers/labels/kernels",
"name": "kernels",
"color": "4C3716",
"default": false,
"description": ""
}
] | open | false | null | [] | null | [] | 2025-08-14T15:39:11 | 2025-09-18T18:23:21 | null | MEMBER | null | null | null | null | ## A Call To Action!
The Hugging Face community needs you! 🫵
The `GPT-OSS` model was recently added using `mxfp4` weights. These 4-bit weights are tiny and highly performant on H100/B100/50xx GPUs, but we only have kernels for **forward** passes. This means that users can't train `GPT-OSS` unless they convert the weights to `bfloat16`. This uses 4X more memory, and reduces speed enormously!
We want **native** `mxfp4` training, but that means we need **backward** kernels too. Ideally, these kernels should also support GPUs that don't have FP4 hardware, so users can still benefit from reduced memory usage during training, even if the computation has to be done in FP8 or `bfloat16`.
### Custom Kernels: An extremely short introduction
`transformers` uses the [Kernels](https://github.com/huggingface/kernels) library to load custom kernels. The critical kernel is the MoE kernel, because attention weights are stored in `bfloat16` for `GPT-OSS`. This kernel lives on the Hub, in the [triton-kernels repo](https://huggingface.co/kernels-community/triton_kernels). The forward kernel is in the [matmul_ogs file](https://huggingface.co/kernels-community/triton_kernels/blob/main/torch-ext/triton_kernels/matmul_ogs.py), but the backward kernel should probably go in its own file.
This won't be easy - the kernels are written in [Triton](https://triton-lang.org/main/index.html), so this is not a good issue for beginners! This will probably be overwhelming if you don't have some experience with raw CUDA or Triton programming already.
Once the hard work of writing the kernel is done, we can help with integrating it into Transformers (there's a [work-in-progress blogpost](https://github.com/huggingface/blog/pull/2971) about this). We can help with serious attempts, but please don't just throw a code agent at the problem or something (you can use a code agent to help with writing and testing the kernel, but only if you're competent enough to evaluate and bugfix its outputs!) | null | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40170/reactions",
"total_count": 9,
"+1": 6,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 3,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40170/timeline | null | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | false |
https://api.github.com/repos/huggingface/transformers/issues/40169 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40169/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40169/comments | https://api.github.com/repos/huggingface/transformers/issues/40169/events | https://github.com/huggingface/transformers/pull/40169 | 3,322,595,152 | PR_kwDOCUB6oc6jtBYf | 40,169 | [MINOR:TYPO] Update base.py | {
"login": "cakiki",
"id": 3664563,
"node_id": "MDQ6VXNlcjM2NjQ1NjM=",
"avatar_url": "https://avatars.githubusercontent.com/u/3664563?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cakiki",
"html_url": "https://github.com/cakiki",
"followers_url": "https://api.github.com/users/cakiki/followers",
"following_url": "https://api.github.com/users/cakiki/following{/other_user}",
"gists_url": "https://api.github.com/users/cakiki/gists{/gist_id}",
"starred_url": "https://api.github.com/users/cakiki/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cakiki/subscriptions",
"organizations_url": "https://api.github.com/users/cakiki/orgs",
"repos_url": "https://api.github.com/users/cakiki/repos",
"events_url": "https://api.github.com/users/cakiki/events{/privacy}",
"received_events_url": "https://api.github.com/users/cakiki/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T15:14:15 | 2025-08-15T08:57:02 | 2025-08-15T05:53:57 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40169",
"html_url": "https://github.com/huggingface/transformers/pull/40169",
"diff_url": "https://github.com/huggingface/transformers/pull/40169.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40169.patch",
"merged_at": "2025-08-15T05:53:57"
} | All other occurrences in the docs use lowercase. (https://github.com/search?q=repo%3Ahuggingface%2Ftransformers%20translation_XX_to_YY&type=code)
Also, using uppercase doesn't work: tested with "translation_EN_to_FR" which doesn't work and instead returns: `ValueError: The task does not provide any default models for options ('EN', 'FR')`
It might be a good idea to allow for uppercase, but that's for another issue.
cc @stevhliu
## Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Models:
- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier
Library:
- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
Documentation: @stevhliu
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
Maintained examples (not research project or legacy):
- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1
-->
| {
"login": "stevhliu",
"id": 59462357,
"node_id": "MDQ6VXNlcjU5NDYyMzU3",
"avatar_url": "https://avatars.githubusercontent.com/u/59462357?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stevhliu",
"html_url": "https://github.com/stevhliu",
"followers_url": "https://api.github.com/users/stevhliu/followers",
"following_url": "https://api.github.com/users/stevhliu/following{/other_user}",
"gists_url": "https://api.github.com/users/stevhliu/gists{/gist_id}",
"starred_url": "https://api.github.com/users/stevhliu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stevhliu/subscriptions",
"organizations_url": "https://api.github.com/users/stevhliu/orgs",
"repos_url": "https://api.github.com/users/stevhliu/repos",
"events_url": "https://api.github.com/users/stevhliu/events{/privacy}",
"received_events_url": "https://api.github.com/users/stevhliu/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40169/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40169/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40168 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40168/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40168/comments | https://api.github.com/repos/huggingface/transformers/issues/40168/events | https://github.com/huggingface/transformers/issues/40168 | 3,322,593,855 | I_kwDOCUB6oc7GCsI_ | 40,168 | EncoderDecoderModel emits FutureWarning about v4.12 training path when labels are passed (v4.48.1, „version v4.12.0 introduces a better way to train encoder-decoder models by computing the loss inside the encoder-decoder framework.“) | {
"login": "leaBroe",
"id": 116747293,
"node_id": "U_kgDOBvVsHQ",
"avatar_url": "https://avatars.githubusercontent.com/u/116747293?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/leaBroe",
"html_url": "https://github.com/leaBroe",
"followers_url": "https://api.github.com/users/leaBroe/followers",
"following_url": "https://api.github.com/users/leaBroe/following{/other_user}",
"gists_url": "https://api.github.com/users/leaBroe/gists{/gist_id}",
"starred_url": "https://api.github.com/users/leaBroe/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/leaBroe/subscriptions",
"organizations_url": "https://api.github.com/users/leaBroe/orgs",
"repos_url": "https://api.github.com/users/leaBroe/repos",
"events_url": "https://api.github.com/users/leaBroe/events{/privacy}",
"received_events_url": "https://api.github.com/users/leaBroe/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-14T15:13:54 | 2025-10-20T08:03:14 | 2025-10-20T08:03:14 | NONE | null | null | null | null | ### System Info
- `transformers` version: 4.48.1
- Platform: Linux-5.14.0-503.40.1.el9_5.x86_64-x86_64-with-glibc2.34
- Python version: 3.10.18
- Huggingface_hub version: 0.34.4
- Safetensors version: 0.6.2
- Accelerate version: 1.10.0
- Accelerate config: not found
- PyTorch version (GPU?): 2.5.1 (False)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?: no
### Who can help?
_No response_
### Information
- [ ] The official example scripts
- [x] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [x] My own task or dataset (give details below)
### Reproduction
When training an EncoderDecoderModel on transformers v4.48.1, a FutureWarning about the v4.12 training path is printed every forward call whenever labels are provided—even if no decoder_input_ids are passed (i.e., using the new approach where the model derives them from labels).
The warning is the following:
"FutureWarning: Version v4.12.0 introduces a better way to train encoder-decoder models by computing the loss inside the encoder-decoder framework rather than in the decoder itself. You may observe training discrepancies if fine-tuning a model trained with versions anterior to 4.12.0. The decoder_input_ids are now created based on the labels, no need to pass them yourself anymore."
This happens even if we do not pass decoder_input_ids and rely on labels + decoder_start_token_id.
minimal script for reproduction:
```python
import torch
from transformers import EncoderDecoderModel, AutoTokenizer
tok = AutoTokenizer.from_pretrained("bert-base-uncased")
model = EncoderDecoderModel.from_encoder_decoder_pretrained(
"bert-base-uncased", "bert-base-uncased"
)
model.config.decoder_start_token_id = tok.cls_token_id
model.config.eos_token_id = tok.sep_token_id
model.config.pad_token_id = tok.pad_token_id
src = tok("hello world", return_tensors="pt")
tgt = tok("hi there", return_tensors="pt").input_ids
labels = tgt.clone()
labels[labels == tok.pad_token_id] = -100
out = model(
input_ids=src["input_ids"],
attention_mask=src["attention_mask"],
labels=labels,
)
print(type(out), out.loss)
```
with this, i get the ouput: <class 'transformers.modeling_outputs.Seq2SeqLMOutput'> tensor(12.3924, grad_fn=<NllLossBackward0>)
and still the FutureWarning mentioned above.
### Expected behavior
If labels are given and decoder_input_ids are not provided, the model uses the new path (derive decoder_input_ids from labels) without emitting a warning.
A warning should only trigger when the deprecated path is used (e.g., if both labels and decoder_input_ids are passed, or if some legacy pathway is detected).
Workarounds tried
• Removing decoder_input_ids entirely (only pass labels) → warning still appears.
• Subclassing Seq2SeqTrainer to pop decoder_input_ids → warning still appears.
• Subclassing EncoderDecoderModel.forward to pop decoder_input_ids → warning still appears.
Thanks for any help!! | {
"login": "github-actions[bot]",
"id": 41898282,
"node_id": "MDM6Qm90NDE4OTgyODI=",
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"html_url": "https://github.com/apps/github-actions",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"type": "Bot",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40168/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40168/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40167 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40167/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40167/comments | https://api.github.com/repos/huggingface/transformers/issues/40167/events | https://github.com/huggingface/transformers/pull/40167 | 3,322,547,031 | PR_kwDOCUB6oc6js3L9 | 40,167 | Fix docs typo | {
"login": "qubvel",
"id": 31920396,
"node_id": "MDQ6VXNlcjMxOTIwMzk2",
"avatar_url": "https://avatars.githubusercontent.com/u/31920396?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/qubvel",
"html_url": "https://github.com/qubvel",
"followers_url": "https://api.github.com/users/qubvel/followers",
"following_url": "https://api.github.com/users/qubvel/following{/other_user}",
"gists_url": "https://api.github.com/users/qubvel/gists{/gist_id}",
"starred_url": "https://api.github.com/users/qubvel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/qubvel/subscriptions",
"organizations_url": "https://api.github.com/users/qubvel/orgs",
"repos_url": "https://api.github.com/users/qubvel/repos",
"events_url": "https://api.github.com/users/qubvel/events{/privacy}",
"received_events_url": "https://api.github.com/users/qubvel/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T14:58:40 | 2025-08-14T15:29:53 | 2025-08-14T15:29:53 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40167",
"html_url": "https://github.com/huggingface/transformers/pull/40167",
"diff_url": "https://github.com/huggingface/transformers/pull/40167.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40167.patch",
"merged_at": "2025-08-14T15:29:53"
} | # What does this PR do?
<!--
Congratulations! You've made it this far! You're not quite done yet though.
Once 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.
Then, 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.
Once 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.
-->
<!-- Remove if not applicable -->
Fixes # (issue)
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Models:
- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier
Library:
- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
Documentation: @stevhliu
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
Maintained examples (not research project or legacy):
- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1
-->
| {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40167/reactions",
"total_count": 1,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 1
} | https://api.github.com/repos/huggingface/transformers/issues/40167/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40166 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40166/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40166/comments | https://api.github.com/repos/huggingface/transformers/issues/40166/events | https://github.com/huggingface/transformers/issues/40166 | 3,322,476,425 | I_kwDOCUB6oc7GCPeJ | 40,166 | Error after calling ESM model with input embeddings not input ids | {
"login": "hunklinger",
"id": 164493628,
"node_id": "U_kgDOCc35PA",
"avatar_url": "https://avatars.githubusercontent.com/u/164493628?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/hunklinger",
"html_url": "https://github.com/hunklinger",
"followers_url": "https://api.github.com/users/hunklinger/followers",
"following_url": "https://api.github.com/users/hunklinger/following{/other_user}",
"gists_url": "https://api.github.com/users/hunklinger/gists{/gist_id}",
"starred_url": "https://api.github.com/users/hunklinger/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hunklinger/subscriptions",
"organizations_url": "https://api.github.com/users/hunklinger/orgs",
"repos_url": "https://api.github.com/users/hunklinger/repos",
"events_url": "https://api.github.com/users/hunklinger/events{/privacy}",
"received_events_url": "https://api.github.com/users/hunklinger/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-14T14:37:50 | 2025-08-18T13:22:11 | 2025-08-18T13:22:11 | NONE | null | null | null | null | ### System Info
- transformers version: 4.52.4
- Platform: Linux-5.14.0-503.23.2.el9_5.x86_64-x86_64-with-glibc2.34
- Python version: 3.12.4
- Huggingface_hub version: 0.33.1
- Safetensors version: 0.5.3
- Accelerate version: not installed
- Accelerate config: not found
- DeepSpeed version: not installed
- PyTorch version (GPU?): 2.7.1+cu126 (False)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?: No
### Who can help?
maybe @Rocketknight1 - Apologies if not but you were very active regarding ESM issues.
### Information
- [ ] The official example scripts
- [x] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [x] My own task or dataset (give details below)
### Reproduction
```
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
esm_version = "facebook/esm2_t6_8M_UR50D"
tokenizer = AutoTokenizer.from_pretrained(esm_version)
model = AutoModelForSequenceClassification.from_pretrained(esm_version)
tokenized = tokenizer(["HHASPRKQGKKENGPPHSHTLKGRRLVFDN"], max_length=1024,truncation=True, return_special_tokens_mask=True)
attention_mask = torch.tensor(tokenized["attention_mask"])
input_ids = torch.tensor(tokenized["input_ids"])
inputs_embeds = model.esm.embeddings.word_embeddings(input_ids)
outputs = model.forward(inputs_embeds=inputs_embeds)
```
Error that appears:
embeddings = embeddings.masked_fill((input_ids == self.mask_token_id).unsqueeze(-1), 0.0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'bool' object has no attribute 'unsqueeze'
As far as I understood this happens as the forward function is called without any input_ids as input and this line where it gets compared with the mask always produces the error in https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_esm.py line 220. The quick fix I applied now was setting `model.esm.embeddings.token_dropout = False` so that this part is skipped. According to the comment this results into the same behaviour as other BERT implementations but skips this "mask-dropout" logic from the ESM model. I would like to be able to not skip it also for the case where I do the call with the input embeddings. The option of giving both input ids and the embeddings is also not working as this is permitted in line 850. Please let me know if you have an idea for an alternative.
### Expected behavior
Error-free calculation of the output | {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40166/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40166/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40165 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40165/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40165/comments | https://api.github.com/repos/huggingface/transformers/issues/40165/events | https://github.com/huggingface/transformers/pull/40165 | 3,322,366,580 | PR_kwDOCUB6oc6jsQhi | 40,165 | try `PYTHONUNBUFFERED` to avoid no output for too long | {
"login": "ydshieh",
"id": 2521628,
"node_id": "MDQ6VXNlcjI1MjE2Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ydshieh",
"html_url": "https://github.com/ydshieh",
"followers_url": "https://api.github.com/users/ydshieh/followers",
"following_url": "https://api.github.com/users/ydshieh/following{/other_user}",
"gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions",
"organizations_url": "https://api.github.com/users/ydshieh/orgs",
"repos_url": "https://api.github.com/users/ydshieh/repos",
"events_url": "https://api.github.com/users/ydshieh/events{/privacy}",
"received_events_url": "https://api.github.com/users/ydshieh/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T14:04:40 | 2025-08-21T12:10:19 | 2025-08-14T20:42:29 | COLLABORATOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40165",
"html_url": "https://github.com/huggingface/transformers/pull/40165",
"diff_url": "https://github.com/huggingface/transformers/pull/40165.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40165.patch",
"merged_at": null
} | # What does this PR do?
to see if this could reduce
https://app.circleci.com/pipelines/github/huggingface/transformers/141243/workflows/d61ac0c2-3205-433f-a744-a045664e6a05/jobs/1869761 | {
"login": "ydshieh",
"id": 2521628,
"node_id": "MDQ6VXNlcjI1MjE2Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ydshieh",
"html_url": "https://github.com/ydshieh",
"followers_url": "https://api.github.com/users/ydshieh/followers",
"following_url": "https://api.github.com/users/ydshieh/following{/other_user}",
"gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions",
"organizations_url": "https://api.github.com/users/ydshieh/orgs",
"repos_url": "https://api.github.com/users/ydshieh/repos",
"events_url": "https://api.github.com/users/ydshieh/events{/privacy}",
"received_events_url": "https://api.github.com/users/ydshieh/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40165/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40165/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40164 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40164/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40164/comments | https://api.github.com/repos/huggingface/transformers/issues/40164/events | https://github.com/huggingface/transformers/pull/40164 | 3,322,140,895 | PR_kwDOCUB6oc6jrgXV | 40,164 | Allow to be able to run `torch.compile` tests with `fullgraph=True` | {
"login": "ydshieh",
"id": 2521628,
"node_id": "MDQ6VXNlcjI1MjE2Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ydshieh",
"html_url": "https://github.com/ydshieh",
"followers_url": "https://api.github.com/users/ydshieh/followers",
"following_url": "https://api.github.com/users/ydshieh/following{/other_user}",
"gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions",
"organizations_url": "https://api.github.com/users/ydshieh/orgs",
"repos_url": "https://api.github.com/users/ydshieh/repos",
"events_url": "https://api.github.com/users/ydshieh/events{/privacy}",
"received_events_url": "https://api.github.com/users/ydshieh/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T12:52:51 | 2025-08-20T08:42:36 | 2025-08-20T08:42:34 | COLLABORATOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40164",
"html_url": "https://github.com/huggingface/transformers/pull/40164",
"diff_url": "https://github.com/huggingface/transformers/pull/40164.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40164.patch",
"merged_at": "2025-08-20T08:42:34"
} | # What does this PR do?
This is what I have in mind. Happy to hear some suggestion if any.
(I will have a few methods to patch in my todo list) | {
"login": "ydshieh",
"id": 2521628,
"node_id": "MDQ6VXNlcjI1MjE2Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ydshieh",
"html_url": "https://github.com/ydshieh",
"followers_url": "https://api.github.com/users/ydshieh/followers",
"following_url": "https://api.github.com/users/ydshieh/following{/other_user}",
"gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions",
"organizations_url": "https://api.github.com/users/ydshieh/orgs",
"repos_url": "https://api.github.com/users/ydshieh/repos",
"events_url": "https://api.github.com/users/ydshieh/events{/privacy}",
"received_events_url": "https://api.github.com/users/ydshieh/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40164/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40164/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40163 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40163/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40163/comments | https://api.github.com/repos/huggingface/transformers/issues/40163/events | https://github.com/huggingface/transformers/pull/40163 | 3,322,044,102 | PR_kwDOCUB6oc6jrL5T | 40,163 | :rotating_light: [`Flash Attention`] Fix sliding window size | {
"login": "vasqu",
"id": 73884904,
"node_id": "MDQ6VXNlcjczODg0OTA0",
"avatar_url": "https://avatars.githubusercontent.com/u/73884904?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vasqu",
"html_url": "https://github.com/vasqu",
"followers_url": "https://api.github.com/users/vasqu/followers",
"following_url": "https://api.github.com/users/vasqu/following{/other_user}",
"gists_url": "https://api.github.com/users/vasqu/gists{/gist_id}",
"starred_url": "https://api.github.com/users/vasqu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vasqu/subscriptions",
"organizations_url": "https://api.github.com/users/vasqu/orgs",
"repos_url": "https://api.github.com/users/vasqu/repos",
"events_url": "https://api.github.com/users/vasqu/events{/privacy}",
"received_events_url": "https://api.github.com/users/vasqu/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T12:19:03 | 2025-09-22T16:56:54 | 2025-08-20T12:23:14 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40163",
"html_url": "https://github.com/huggingface/transformers/pull/40163",
"diff_url": "https://github.com/huggingface/transformers/pull/40163.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40163.patch",
"merged_at": "2025-08-20T12:23:14"
} | Fixes #39408
This issue will occur especially during the prefill phase when sliding window < prefill size. Newer cache refactors automatically remove kvs beyond the window so inference would/should have been less affected. Small script to show the effects:
```python
import torch
from transformers import AutoTokenizer, AutoConfig, MistralForCausalLM
torch_device = "cuda"
config = AutoConfig.from_pretrained("mistralai/Mistral-7B-v0.1")
config.sliding_window = 4
model = MistralForCausalLM.from_pretrained(
"mistralai/Mistral-7B-v0.1", torch_dtype=torch.bfloat16, config=config, device_map={"": torch_device}
)
prompt = "My favourite condiment is "
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1", use_fast=False)
inputs = tokenizer(prompt, return_tensors="pt").to(torch_device)
# greedy generation outputs
generated_ids = model.generate(**inputs, max_new_tokens=20, do_sample=False)
text_sdpa = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
model.set_attn_implementation("flash_attention_2")
generated_ids = model.generate(**inputs, max_new_tokens=20, do_sample=False)
text_fa = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
print("sdpa")
print(text_sdpa)
print()
print("flash")
print(text_fa)
```
Outputs should match with the fix, before they were not. Will add a common test so it won't happen again. Edit: modified the existing test instead
cc @Cyrilvallez @ArthurZucker | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40163/reactions",
"total_count": 2,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 1,
"rocket": 0,
"eyes": 1
} | https://api.github.com/repos/huggingface/transformers/issues/40163/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40162 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40162/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40162/comments | https://api.github.com/repos/huggingface/transformers/issues/40162/events | https://github.com/huggingface/transformers/pull/40162 | 3,321,924,242 | PR_kwDOCUB6oc6jq0G- | 40,162 | fix to avoid modifying a view in place | {
"login": "3outeille",
"id": 47445085,
"node_id": "MDQ6VXNlcjQ3NDQ1MDg1",
"avatar_url": "https://avatars.githubusercontent.com/u/47445085?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/3outeille",
"html_url": "https://github.com/3outeille",
"followers_url": "https://api.github.com/users/3outeille/followers",
"following_url": "https://api.github.com/users/3outeille/following{/other_user}",
"gists_url": "https://api.github.com/users/3outeille/gists{/gist_id}",
"starred_url": "https://api.github.com/users/3outeille/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/3outeille/subscriptions",
"organizations_url": "https://api.github.com/users/3outeille/orgs",
"repos_url": "https://api.github.com/users/3outeille/repos",
"events_url": "https://api.github.com/users/3outeille/events{/privacy}",
"received_events_url": "https://api.github.com/users/3outeille/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 2155169140,
"node_id": "MDU6TGFiZWwyMTU1MTY5MTQw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/trainer",
"name": "trainer",
"color": "2ef289",
"default": false,
"description": ""
},
{
"id": 2760822153,
"node_id": "MDU6TGFiZWwyNzYwODIyMTUz",
"url": "https://api.github.com/repos/huggingface/transformers/labels/Tensor%20Parallel",
"name": "Tensor Parallel",
"color": "1AD0A8",
"default": false,
"description": ""
}
] | closed | false | null | [] | null | [] | 2025-08-14T11:43:53 | 2025-08-15T08:30:51 | 2025-08-15T08:30:49 | MEMBER | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40162",
"html_url": "https://github.com/huggingface/transformers/pull/40162",
"diff_url": "https://github.com/huggingface/transformers/pull/40162.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40162.patch",
"merged_at": "2025-08-15T08:30:49"
} | # What does this PR do?
When using `tp_auto` on `GptOssModel`, I got the following
```
RuntimeError: Output 0 of _ToTorchTensorBackward is a view and is being modified inplace. This view was created inside a custom Function (or because an input was returned as-is) and the autograd logic to handle view+inplace would override the custom backward associated with the custom Function, leading to incorrect gradients. This behavior is forbidden. You can fix this by cloning the output of the custom Function
```
The fix is to avoid the inplace modification
<!--
Congratulations! You've made it this far! You're not quite done yet though.
Once 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.
Then, 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.
Once 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.
-->
<!-- Remove if not applicable -->
Fixes # (issue)
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Models:
- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier
Library:
- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
Documentation: @stevhliu
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
Maintained examples (not research project or legacy):
- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1
-->
| {
"login": "3outeille",
"id": 47445085,
"node_id": "MDQ6VXNlcjQ3NDQ1MDg1",
"avatar_url": "https://avatars.githubusercontent.com/u/47445085?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/3outeille",
"html_url": "https://github.com/3outeille",
"followers_url": "https://api.github.com/users/3outeille/followers",
"following_url": "https://api.github.com/users/3outeille/following{/other_user}",
"gists_url": "https://api.github.com/users/3outeille/gists{/gist_id}",
"starred_url": "https://api.github.com/users/3outeille/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/3outeille/subscriptions",
"organizations_url": "https://api.github.com/users/3outeille/orgs",
"repos_url": "https://api.github.com/users/3outeille/repos",
"events_url": "https://api.github.com/users/3outeille/events{/privacy}",
"received_events_url": "https://api.github.com/users/3outeille/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40162/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40162/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40161 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40161/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40161/comments | https://api.github.com/repos/huggingface/transformers/issues/40161/events | https://github.com/huggingface/transformers/pull/40161 | 3,321,848,464 | PR_kwDOCUB6oc6jqkXr | 40,161 | [FA2] Fix it finally - revert fa kwargs preparation | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 8103865784,
"node_id": "LA_kwDOCUB6oc8AAAAB4wctuA",
"url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch",
"name": "for patch",
"color": "D93F0B",
"default": false,
"description": "Tag issues / labels that should be included in the next patch"
}
] | closed | false | null | [] | null | [] | 2025-08-14T11:18:59 | 2025-08-14T17:37:03 | 2025-08-14T11:39:11 | MEMBER | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40161",
"html_url": "https://github.com/huggingface/transformers/pull/40161",
"diff_url": "https://github.com/huggingface/transformers/pull/40161.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40161.patch",
"merged_at": "2025-08-14T11:39:11"
} | # What does this PR do?
Preparing the fa kwargs in advance is currently useless as it's being recomputed anyway. And worst, it actually break things, see following explanation.
When `_flash_attention_forward` is called, the following paths are taken inside the function:
```python
# Contains at least one padding token in the sequence
if attention_mask is not None:
# HERE IT ALWAYS RECOMPUTE THE FA KWARGS
q, k, v, indices_q, (cu_seq_lens_q, cu_seq_lens_k), (max_length_q, max_length_k) = _upad_input(
query_states, key_states, value_states, attention_mask, query_length, unpad_fn
)
....
out = flash_attn_varlen(...)
# Padding free, i.e. sequences flattened into one total sequence
elif is_fa_with_varlen_kwargs or is_fa_with_position_ids:
# reshape everything
q = query_states.reshape(-1, query_states.size(-2), query_states.size(-1))
...
out = flash_attn_varlen(...)
# reshape back
out = out.view(query_states.size(0), -1, out.size(-2), out.size(-1))
# No padding
else:
# THIS IS THE BATCHED VERSION OF FA2 -> we don't have padding here anyway, so no need to call varlen and worry about reshapes etc
out = flash_fn(...)
```
So basically, we have 2 scenarios:
- attention mask is not None -> we recompute the fa kwargs anyway, so we're just wasting computation to get them before in generate
- attention mask is None -> why would we call `flash_varlen` if we don't have padding?? It forces us to reshape back and forth, and to compute fa kwargs where we don't need them -> better to not do it and simply call the batched fa version since we don't have padding anyway
Moreover, for hybrid models, different layer types could end up in different padding states. That is, with batched generation, if we have inputs of say (5k tokens, 4100 tokens) with a sliding window of 4096, then, after the prefill, the full layers have padding (they see the whole states), but the sliding layers don't have padding anymore (they only see the last 4096 - 1 tokens).
So, ahead-of-time-preparation would require careful handling of different layers.
But basically, for now preparing in advance is not only worst in performances (as we only compute things that are going to be recomputed/not needed), it's not logically correct! So reverting it!
I will explore later on if we can bring it back, as it would be useful for compilation! | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40161/reactions",
"total_count": 2,
"+1": 2,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40161/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40160 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40160/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40160/comments | https://api.github.com/repos/huggingface/transformers/issues/40160/events | https://github.com/huggingface/transformers/pull/40160 | 3,321,734,262 | PR_kwDOCUB6oc6jqL3y | 40,160 | Fix CI: Use correct import for torchvision InterpolationMode | {
"login": "manueldeprada",
"id": 6536835,
"node_id": "MDQ6VXNlcjY1MzY4MzU=",
"avatar_url": "https://avatars.githubusercontent.com/u/6536835?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/manueldeprada",
"html_url": "https://github.com/manueldeprada",
"followers_url": "https://api.github.com/users/manueldeprada/followers",
"following_url": "https://api.github.com/users/manueldeprada/following{/other_user}",
"gists_url": "https://api.github.com/users/manueldeprada/gists{/gist_id}",
"starred_url": "https://api.github.com/users/manueldeprada/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/manueldeprada/subscriptions",
"organizations_url": "https://api.github.com/users/manueldeprada/orgs",
"repos_url": "https://api.github.com/users/manueldeprada/repos",
"events_url": "https://api.github.com/users/manueldeprada/events{/privacy}",
"received_events_url": "https://api.github.com/users/manueldeprada/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T10:40:51 | 2025-08-14T10:53:55 | 2025-08-14T10:53:23 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40160",
"html_url": "https://github.com/huggingface/transformers/pull/40160",
"diff_url": "https://github.com/huggingface/transformers/pull/40160.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40160.patch",
"merged_at": "2025-08-14T10:53:23"
} | https://github.com/huggingface/transformers/pull/32317 renamed `from torchvision.transforms.v2 import functional as F_t` leaving `F` for `torch.functional`
but some usages of `F` remained unchanged, breaking CI ([example](https://app.circleci.com/pipelines/github/huggingface/transformers/142032/workflows/d0770631-92de-4f3c-96df-5832a7322bc2/jobs/1879488)):
```
FAILED tests/models/sam/test_image_processing_sam.py::SamImageProcessingTest::test_slow_fast_equivalence
...
E AttributeError: module 'torch.nn.functional' has no attribute 'InterpolationMode'
/usr/local/lib/python3.9/site-packages/transformers/models/sam/image_processing_sam_fast.py:246: AttributeError
``` | {
"login": "manueldeprada",
"id": 6536835,
"node_id": "MDQ6VXNlcjY1MzY4MzU=",
"avatar_url": "https://avatars.githubusercontent.com/u/6536835?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/manueldeprada",
"html_url": "https://github.com/manueldeprada",
"followers_url": "https://api.github.com/users/manueldeprada/followers",
"following_url": "https://api.github.com/users/manueldeprada/following{/other_user}",
"gists_url": "https://api.github.com/users/manueldeprada/gists{/gist_id}",
"starred_url": "https://api.github.com/users/manueldeprada/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/manueldeprada/subscriptions",
"organizations_url": "https://api.github.com/users/manueldeprada/orgs",
"repos_url": "https://api.github.com/users/manueldeprada/repos",
"events_url": "https://api.github.com/users/manueldeprada/events{/privacy}",
"received_events_url": "https://api.github.com/users/manueldeprada/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40160/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40160/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40159 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40159/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40159/comments | https://api.github.com/repos/huggingface/transformers/issues/40159/events | https://github.com/huggingface/transformers/pull/40159 | 3,321,622,942 | PR_kwDOCUB6oc6jp0A6 | 40,159 | [Continous Batching] set head_dim when config.head_dim is None | {
"login": "kashif",
"id": 8100,
"node_id": "MDQ6VXNlcjgxMDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/8100?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kashif",
"html_url": "https://github.com/kashif",
"followers_url": "https://api.github.com/users/kashif/followers",
"following_url": "https://api.github.com/users/kashif/following{/other_user}",
"gists_url": "https://api.github.com/users/kashif/gists{/gist_id}",
"starred_url": "https://api.github.com/users/kashif/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kashif/subscriptions",
"organizations_url": "https://api.github.com/users/kashif/orgs",
"repos_url": "https://api.github.com/users/kashif/repos",
"events_url": "https://api.github.com/users/kashif/events{/privacy}",
"received_events_url": "https://api.github.com/users/kashif/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T10:03:20 | 2025-08-14T11:23:30 | 2025-08-14T11:23:28 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40159",
"html_url": "https://github.com/huggingface/transformers/pull/40159",
"diff_url": "https://github.com/huggingface/transformers/pull/40159.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40159.patch",
"merged_at": "2025-08-14T11:23:27"
} | # What does this PR do?
Some models have empty `config.head_dim` so we now check if the value is not None instead of setting it to `None` | {
"login": "ArthurZucker",
"id": 48595927,
"node_id": "MDQ6VXNlcjQ4NTk1OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArthurZucker",
"html_url": "https://github.com/ArthurZucker",
"followers_url": "https://api.github.com/users/ArthurZucker/followers",
"following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}",
"gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions",
"organizations_url": "https://api.github.com/users/ArthurZucker/orgs",
"repos_url": "https://api.github.com/users/ArthurZucker/repos",
"events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArthurZucker/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40159/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40159/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40158 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40158/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40158/comments | https://api.github.com/repos/huggingface/transformers/issues/40158/events | https://github.com/huggingface/transformers/pull/40158 | 3,321,547,794 | PR_kwDOCUB6oc6jpj9h | 40,158 | Fix: catch requests.ConnectionError in list_repo_templates | {
"login": "laitifranz",
"id": 25352428,
"node_id": "MDQ6VXNlcjI1MzUyNDI4",
"avatar_url": "https://avatars.githubusercontent.com/u/25352428?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/laitifranz",
"html_url": "https://github.com/laitifranz",
"followers_url": "https://api.github.com/users/laitifranz/followers",
"following_url": "https://api.github.com/users/laitifranz/following{/other_user}",
"gists_url": "https://api.github.com/users/laitifranz/gists{/gist_id}",
"starred_url": "https://api.github.com/users/laitifranz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/laitifranz/subscriptions",
"organizations_url": "https://api.github.com/users/laitifranz/orgs",
"repos_url": "https://api.github.com/users/laitifranz/repos",
"events_url": "https://api.github.com/users/laitifranz/events{/privacy}",
"received_events_url": "https://api.github.com/users/laitifranz/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T09:40:02 | 2025-08-19T06:45:29 | 2025-08-19T06:45:29 | NONE | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40158",
"html_url": "https://github.com/huggingface/transformers/pull/40158",
"diff_url": "https://github.com/huggingface/transformers/pull/40158.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40158.patch",
"merged_at": null
} | # What does this PR do?
This PR fixes a bug in the `list_repo_templates` function where network connectivity issues would cause the entire function to crash instead of gracefully falling back to local files.
## Problem
When used without an internet connection, the function raised:
```
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/Qwen/Qwen2.5-VL-7B-Instruct/tree/main/additional_chat_templates?recursive=False&expand=False (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x14cdd4b28b60>: Failed to establish a new connection: [Errno 101] Network is unreachable'))"), '(Request ID: ---)')
```
The exception handler only caught Python’s built-in `ConnectionError`, not the `requests`-specific one, so the fallback logic never ran.
## Fix
Add `requests.exceptions.ConnectionError` to the exception handler.
Now, if the network is unavailable, the function correctly falls back to local cached templates as intended.
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review?
@Rocketknight1
| {
"login": "laitifranz",
"id": 25352428,
"node_id": "MDQ6VXNlcjI1MzUyNDI4",
"avatar_url": "https://avatars.githubusercontent.com/u/25352428?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/laitifranz",
"html_url": "https://github.com/laitifranz",
"followers_url": "https://api.github.com/users/laitifranz/followers",
"following_url": "https://api.github.com/users/laitifranz/following{/other_user}",
"gists_url": "https://api.github.com/users/laitifranz/gists{/gist_id}",
"starred_url": "https://api.github.com/users/laitifranz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/laitifranz/subscriptions",
"organizations_url": "https://api.github.com/users/laitifranz/orgs",
"repos_url": "https://api.github.com/users/laitifranz/repos",
"events_url": "https://api.github.com/users/laitifranz/events{/privacy}",
"received_events_url": "https://api.github.com/users/laitifranz/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40158/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40158/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40157 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40157/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40157/comments | https://api.github.com/repos/huggingface/transformers/issues/40157/events | https://github.com/huggingface/transformers/pull/40157 | 3,321,522,489 | PR_kwDOCUB6oc6jpech | 40,157 | Skip broken tests | {
"login": "zucchini-nlp",
"id": 100715397,
"node_id": "U_kgDOBgDLhQ",
"avatar_url": "https://avatars.githubusercontent.com/u/100715397?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/zucchini-nlp",
"html_url": "https://github.com/zucchini-nlp",
"followers_url": "https://api.github.com/users/zucchini-nlp/followers",
"following_url": "https://api.github.com/users/zucchini-nlp/following{/other_user}",
"gists_url": "https://api.github.com/users/zucchini-nlp/gists{/gist_id}",
"starred_url": "https://api.github.com/users/zucchini-nlp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/zucchini-nlp/subscriptions",
"organizations_url": "https://api.github.com/users/zucchini-nlp/orgs",
"repos_url": "https://api.github.com/users/zucchini-nlp/repos",
"events_url": "https://api.github.com/users/zucchini-nlp/events{/privacy}",
"received_events_url": "https://api.github.com/users/zucchini-nlp/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T09:33:52 | 2025-08-19T08:34:39 | 2025-08-19T08:04:09 | MEMBER | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40157",
"html_url": "https://github.com/huggingface/transformers/pull/40157",
"diff_url": "https://github.com/huggingface/transformers/pull/40157.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40157.patch",
"merged_at": "2025-08-19T08:04:09"
} | # What does this PR do?
These tests were meant to be skipped as well but they aren't run always so I missed them the last time. And not they appear on CI as flaky 🙃
| {
"login": "ydshieh",
"id": 2521628,
"node_id": "MDQ6VXNlcjI1MjE2Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/2521628?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ydshieh",
"html_url": "https://github.com/ydshieh",
"followers_url": "https://api.github.com/users/ydshieh/followers",
"following_url": "https://api.github.com/users/ydshieh/following{/other_user}",
"gists_url": "https://api.github.com/users/ydshieh/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ydshieh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ydshieh/subscriptions",
"organizations_url": "https://api.github.com/users/ydshieh/orgs",
"repos_url": "https://api.github.com/users/ydshieh/repos",
"events_url": "https://api.github.com/users/ydshieh/events{/privacy}",
"received_events_url": "https://api.github.com/users/ydshieh/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40157/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40157/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40156 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40156/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40156/comments | https://api.github.com/repos/huggingface/transformers/issues/40156/events | https://github.com/huggingface/transformers/pull/40156 | 3,321,469,222 | PR_kwDOCUB6oc6jpS33 | 40,156 | add attribute map for MoE standardization | {
"login": "ArthurZucker",
"id": 48595927,
"node_id": "MDQ6VXNlcjQ4NTk1OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArthurZucker",
"html_url": "https://github.com/ArthurZucker",
"followers_url": "https://api.github.com/users/ArthurZucker/followers",
"following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}",
"gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions",
"organizations_url": "https://api.github.com/users/ArthurZucker/orgs",
"repos_url": "https://api.github.com/users/ArthurZucker/repos",
"events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArthurZucker/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | [] | 2025-08-14T09:19:02 | 2025-08-25T14:19:31 | null | COLLABORATOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40156",
"html_url": "https://github.com/huggingface/transformers/pull/40156",
"diff_url": "https://github.com/huggingface/transformers/pull/40156.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40156.patch",
"merged_at": null
} | # What does this PR do?
This ensures that the naming is always the same across MoEs | null | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40156/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40156/timeline | null | null | null | null | true | false |
https://api.github.com/repos/huggingface/transformers/issues/40155 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40155/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40155/comments | https://api.github.com/repos/huggingface/transformers/issues/40155/events | https://github.com/huggingface/transformers/pull/40155 | 3,320,980,853 | PR_kwDOCUB6oc6jnpxJ | 40,155 | 🌐 [i18n-KO] Translated `t5.md` to Korean | {
"login": "taemincode",
"id": 187865781,
"node_id": "U_kgDOCzKatQ",
"avatar_url": "https://avatars.githubusercontent.com/u/187865781?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/taemincode",
"html_url": "https://github.com/taemincode",
"followers_url": "https://api.github.com/users/taemincode/followers",
"following_url": "https://api.github.com/users/taemincode/following{/other_user}",
"gists_url": "https://api.github.com/users/taemincode/gists{/gist_id}",
"starred_url": "https://api.github.com/users/taemincode/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/taemincode/subscriptions",
"organizations_url": "https://api.github.com/users/taemincode/orgs",
"repos_url": "https://api.github.com/users/taemincode/repos",
"events_url": "https://api.github.com/users/taemincode/events{/privacy}",
"received_events_url": "https://api.github.com/users/taemincode/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | [] | 2025-08-14T06:38:59 | 2025-08-14T06:39:42 | null | CONTRIBUTOR | null | null | true | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40155",
"html_url": "https://github.com/huggingface/transformers/pull/40155",
"diff_url": "https://github.com/huggingface/transformers/pull/40155.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40155.patch",
"merged_at": null
} | <!-- PR의 제목은 "🌐 [i18n-KO] Translated `<your_file>.md` to Korean" 으로 부탁드립니다 -->
# What does this PR do?
Translated the `t5.md` file of the documentation to Korean.
Thank you in advance for your review.
Part of https://github.com/huggingface/transformers/issues/20179
## Before reviewing
- [x] Check for missing / redundant translations (번역 누락/중복 검사)
- [x] Grammar Check (맞춤법 검사)
- [x] Review or Add new terms to glossary (용어 확인 및 추가)
- [x] Check Inline TOC (e.g. `[[lowercased-header]]`)
- [x] Check live-preview for gotchas (live-preview로 정상작동 확인)
## Who can review? (Initial)
<!-- 1. 위 체크가 모두 완료된 뒤에만 KREW 팀원들에게 리뷰를 요청하는 아래 주석을 노출해주세요!-->
May you please review this PR?
<!-- @jungnerd, @luckyvickyricky, @chelsseeey, @skwh54, @amo33, @maximizemaxwell, @D15M4S -->
<!-- @harheem, @nsbg, @Youngdong2, @xhaktm00, @ssunbear, @ChoHyoungSeo, @judy-choi -->
<!-- @4N3MONE, @Kim-Ju-won, @ahnjj, @FacerAin, @ssum21, @TaskerJang, @HyunZ118 -->
<!-- @yijun-lee, @songi104, @chhaewxn, @AhnJoonSung, @jihyun-0611, @seopp, @pyapyapya -->
@yijun-lee @harheem @4N3MONE @jungnerd
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## Who can review? (Final)
<!-- 2. KREW 팀원들의 리뷰가 끝난 후에 아래 주석을 노출해주세요! -->
<!-- @stevhliu May you please review this PR? --> | null | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40155/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40155/timeline | null | null | null | null | true | false |
https://api.github.com/repos/huggingface/transformers/issues/40154 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40154/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40154/comments | https://api.github.com/repos/huggingface/transformers/issues/40154/events | https://github.com/huggingface/transformers/issues/40154 | 3,320,900,667 | I_kwDOCUB6oc7F8Ow7 | 40,154 | Qwen2.5VL is broken! | {
"login": "pengzhenghao",
"id": 22206995,
"node_id": "MDQ6VXNlcjIyMjA2OTk1",
"avatar_url": "https://avatars.githubusercontent.com/u/22206995?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pengzhenghao",
"html_url": "https://github.com/pengzhenghao",
"followers_url": "https://api.github.com/users/pengzhenghao/followers",
"following_url": "https://api.github.com/users/pengzhenghao/following{/other_user}",
"gists_url": "https://api.github.com/users/pengzhenghao/gists{/gist_id}",
"starred_url": "https://api.github.com/users/pengzhenghao/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pengzhenghao/subscriptions",
"organizations_url": "https://api.github.com/users/pengzhenghao/orgs",
"repos_url": "https://api.github.com/users/pengzhenghao/repos",
"events_url": "https://api.github.com/users/pengzhenghao/events{/privacy}",
"received_events_url": "https://api.github.com/users/pengzhenghao/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-14T05:59:42 | 2025-09-01T09:10:43 | 2025-09-01T09:10:43 | NONE | null | null | null | null | ### System Info
- `transformers` version: 4.55.0
- Platform: Linux-5.15.0-1032-oracle-x86_64-with-glibc2.35
- Python version: 3.12.3
- Huggingface_hub version: 0.34.3
- Safetensors version: 0.6.1
- Accelerate version: 1.10.0
- Accelerate config: not found
- DeepSpeed version: 0.17.4
- PyTorch version (accelerator?): 2.7.1+cu128 (CUDA)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?: <fill in>
- Using GPU in script?: <fill in>
- GPU type: NVIDIA A100-SXM4-80GB
### Who can help?
_No response_
### Information
- [x] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [x] My own task or dataset (give details below)
### Reproduction
In recent PR: https://github.com/huggingface/transformers/pull/39447
A text position embedding is introduced:
https://github.com/huggingface/transformers/pull/39447/files#diff-72d7d1080bd2438bf28cf67cd035b5ef2a5b96beed7e947994fd5dbca55a0dbeR1624-R1628
```python
if position_ids.ndim == 3 and position_ids.shape[0] == 4:
text_position_ids = position_ids[0]
position_ids = position_ids[1:]
else:
text_position_ids = position_ids[0]
```
The `text_position_ids` will be fed to the decoder layer: https://github.com/huggingface/transformers/pull/39447/files#diff-72d7d1080bd2438bf28cf67cd035b5ef2a5b96beed7e947994fd5dbca55a0dbeR1665
```python
layer_outputs = decoder_layer(
hidden_states,
attention_mask=causal_mask_mapping[decoder_layer.attention_type],
position_ids=text_position_ids,
past_key_value=past_key_values,
output_attentions=output_attentions,
use_cache=use_cache,
```
OK. So far we have learned:
1. If `position_ids` inputs as a 3-dim tensor with shape (4, B, seq_len), then `text_position_ids` is the first (1, B, seq_len).
2. Otherwise, it just copy the first `position_ids[0]`
Now, you can easily verify that this value in training time is a 3-dim tensor with shape (3, B, seq_len), as shown in this figure: (note that I have visual input so seq_len != max(pos_id)
<img width="1278" height="436" alt="Image" src="https://github.com/user-attachments/assets/b87cf81b-ed3e-4b06-ac7d-55eb2f4586c4" />
Therefore, text_position_ids is simply (0, ..., 631) as you would expect in previous version.
However, in generation time, the text_position_ids is prepared by:
https://github.com/huggingface/transformers/pull/39447/files#diff-41bc5f79048d22eb30688e5440a89f4303ed02aa3d7c99aa807e3e7243e1fc0aR861-R864
```python
if "position_ids" not in model_inputs:
text_positions = torch.arange(input_ids, device=input_ids.device)[None, None, :]
else:
text_positions = model_inputs["position_ids"][None, ...]
```
If we take a look ahead, model_inputs["position_ids"] is prepared by GenerationMixin. In both case, text_positions is default to the (0, ..., seq_len-1). Then, this text_positions (which is already WRONG because it doesn't take care of the offset caused by potential visual tokens) will be concat to form a 4D position_ids.
```python
model_inputs["position_ids"] = torch.cat([text_positions, vision_positions], dim=0)
```
Then, such a value will be sent to decoder layer.
In summary, in training time, the decoder layer will see position_ids to be offsetted by visual token. But in generation, it see a plain (0,...,seq_len-1) position_ids.
This might be the root cause to https://github.com/huggingface/transformers/issues/40136
### Expected behavior
I expect it works normally. | {
"login": "zucchini-nlp",
"id": 100715397,
"node_id": "U_kgDOBgDLhQ",
"avatar_url": "https://avatars.githubusercontent.com/u/100715397?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/zucchini-nlp",
"html_url": "https://github.com/zucchini-nlp",
"followers_url": "https://api.github.com/users/zucchini-nlp/followers",
"following_url": "https://api.github.com/users/zucchini-nlp/following{/other_user}",
"gists_url": "https://api.github.com/users/zucchini-nlp/gists{/gist_id}",
"starred_url": "https://api.github.com/users/zucchini-nlp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/zucchini-nlp/subscriptions",
"organizations_url": "https://api.github.com/users/zucchini-nlp/orgs",
"repos_url": "https://api.github.com/users/zucchini-nlp/repos",
"events_url": "https://api.github.com/users/zucchini-nlp/events{/privacy}",
"received_events_url": "https://api.github.com/users/zucchini-nlp/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40154/reactions",
"total_count": 1,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 1
} | https://api.github.com/repos/huggingface/transformers/issues/40154/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40153 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40153/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40153/comments | https://api.github.com/repos/huggingface/transformers/issues/40153/events | https://github.com/huggingface/transformers/issues/40153 | 3,320,600,718 | I_kwDOCUB6oc7F7FiO | 40,153 | Incomplete Function calling arguments in Qwen3-8B model | {
"login": "dvn8weil",
"id": 190058927,
"node_id": "U_kgDOC1QRrw",
"avatar_url": "https://avatars.githubusercontent.com/u/190058927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dvn8weil",
"html_url": "https://github.com/dvn8weil",
"followers_url": "https://api.github.com/users/dvn8weil/followers",
"following_url": "https://api.github.com/users/dvn8weil/following{/other_user}",
"gists_url": "https://api.github.com/users/dvn8weil/gists{/gist_id}",
"starred_url": "https://api.github.com/users/dvn8weil/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dvn8weil/subscriptions",
"organizations_url": "https://api.github.com/users/dvn8weil/orgs",
"repos_url": "https://api.github.com/users/dvn8weil/repos",
"events_url": "https://api.github.com/users/dvn8weil/events{/privacy}",
"received_events_url": "https://api.github.com/users/dvn8weil/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 3817266200,
"node_id": "MDU6TGFiZWwzODE3MjY2MjAw",
"url": "https://api.github.com/repos/huggingface/transformers/labels/bug",
"name": "bug",
"color": "d73a4a",
"default": true,
"description": null
}
] | closed | false | null | [] | null | [] | 2025-08-14T03:29:56 | 2025-09-21T08:02:10 | 2025-09-21T08:02:10 | NONE | null | null | null | null | ### System Info
output of `transforms env` :
- `transformers` version: 4.55.0
- Platform: Linux-6.14.0-1012-gcp-x86_64-with-glibc2.39
- Python version: 3.12.3
- Huggingface_hub version: 0.34.4
- Safetensors version: 0.6.2
- Accelerate version: not installed
- Accelerate config: not found
- DeepSpeed version: not installed
- PyTorch version (accelerator?): 2.7.1+cu126 (CUDA)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?: <fill in>
- Using GPU in script?: <fill in>
- GPU type: NVIDIA L4
vllm command :
```
vllm serve Qwen/Qwen3-8B \
--kv-cache-dtype fp8 \
--max-model-len 20000 \
--reasoning-parser qwen3 \
--enable-auto-tool-choice \
--tool-call-parser hermes --port 8000
```
vllm version : 0.10.0
### Who can help?
_No response_
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
the curl command :
```
curl --location 'http://0.0.0.0:8000/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer EMPTY' \
--data '{
"model": "Qwen/Qwen3-8B",
"messages": [
{
"role": "system",
"content": "When outputting a tool call , include all the arguments in the tool call token stream, don'\''t emit partial tool calls. For instance , for the add tool call, output both arguments x and y"
},
{
"role": "user",
"content": "tell me the sum of 32 and 90 , using the tool"
}
],
"parallel_tool_calls": false,
"tools": [
{
"type": "function",
"function": {
"name": "add",
"description": "adds two numbers\n",
"parameters": {
"type": "object",
"properties": {
"x": {
"type": "number",
"description": ""
},
"y": {
"type": "number",
"description": ""
}
},
"required": [
"x",
"y"
]
}
}
},
{
"type": "function",
"function": {
"name": "multiply",
"description": "multiply two numbers\n",
"parameters": {
"type": "object",
"properties": {
"x": {
"type": "number",
"description": ""
},
"y": {
"type": "number",
"description": ""
}
},
"required": [
"x",
"y"
]
}
}
}
],
"tool_choice": "auto",
"stream": true
}'
```
### Expected behavior
The output is :
```
...reasoning content...
data: {"id":"chatcmpl-6c01f87731d142009a81c10980fcf1f6","object":"chat.completion.chunk","created":1755115824,"model":"Qwen/Qwen3-8B","choices":[{"index":0,"delta":{"content":"\n\n"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-6c01f87731d142009a81c10980fcf1f6","object":"chat.completion.chunk","created":1755115824,"model":"Qwen/Qwen3-8B","choices":[{"index":0,"delta":{"tool_calls":[{"id":"chatcmpl-tool-d4032de893c04398b597511b6009bb43","type":"function","index":0,"function":{"name":"add"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-6c01f87731d142009a81c10980fcf1f6","object":"chat.completion.chunk","created":1755115824,"model":"Qwen/Qwen3-8B","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"x\":"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-6c01f87731d142009a81c10980fcf1f6","object":"chat.completion.chunk","created":1755115824,"model":"Qwen/Qwen3-8B","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" "}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-6c01f87731d142009a81c10980fcf1f6","object":"chat.completion.chunk","created":1755115824,"model":"Qwen/Qwen3-8B","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"9"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-6c01f87731d142009a81c10980fcf1f6","object":"chat.completion.chunk","created":1755115824,"model":"Qwen/Qwen3-8B","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"0"}}]},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-6c01f87731d142009a81c10980fcf1f6","object":"chat.completion.chunk","created":1755115824,"model":"Qwen/Qwen3-8B","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}]}
```
The `add` tool call takes two arguments x and y , but the model only outputs `{x: 90}`. | {
"login": "github-actions[bot]",
"id": 41898282,
"node_id": "MDM6Qm90NDE4OTgyODI=",
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"html_url": "https://github.com/apps/github-actions",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"type": "Bot",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40153/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40153/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40152 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40152/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40152/comments | https://api.github.com/repos/huggingface/transformers/issues/40152/events | https://github.com/huggingface/transformers/pull/40152 | 3,320,590,654 | PR_kwDOCUB6oc6jmU2P | 40,152 | Add model card for BERT Base Uncased | {
"login": "Meghanap24",
"id": 209031547,
"node_id": "U_kgDODHWRew",
"avatar_url": "https://avatars.githubusercontent.com/u/209031547?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Meghanap24",
"html_url": "https://github.com/Meghanap24",
"followers_url": "https://api.github.com/users/Meghanap24/followers",
"following_url": "https://api.github.com/users/Meghanap24/following{/other_user}",
"gists_url": "https://api.github.com/users/Meghanap24/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Meghanap24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Meghanap24/subscriptions",
"organizations_url": "https://api.github.com/users/Meghanap24/orgs",
"repos_url": "https://api.github.com/users/Meghanap24/repos",
"events_url": "https://api.github.com/users/Meghanap24/events{/privacy}",
"received_events_url": "https://api.github.com/users/Meghanap24/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-14T03:23:25 | 2025-08-14T12:44:32 | 2025-08-14T12:44:32 | NONE | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40152",
"html_url": "https://github.com/huggingface/transformers/pull/40152",
"diff_url": "https://github.com/huggingface/transformers/pull/40152.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40152.patch",
"merged_at": null
} | This PR adds a beginner-friendly model card for `bert-base-uncased` under `docs/source/model_cards/`.
Includes:
- Model description (plain language)
- Usage example
- Intended use & limitations
- Resources and references
| {
"login": "Rocketknight1",
"id": 12866554,
"node_id": "MDQ6VXNlcjEyODY2NTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/12866554?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rocketknight1",
"html_url": "https://github.com/Rocketknight1",
"followers_url": "https://api.github.com/users/Rocketknight1/followers",
"following_url": "https://api.github.com/users/Rocketknight1/following{/other_user}",
"gists_url": "https://api.github.com/users/Rocketknight1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Rocketknight1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rocketknight1/subscriptions",
"organizations_url": "https://api.github.com/users/Rocketknight1/orgs",
"repos_url": "https://api.github.com/users/Rocketknight1/repos",
"events_url": "https://api.github.com/users/Rocketknight1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Rocketknight1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40152/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40152/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40151 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40151/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40151/comments | https://api.github.com/repos/huggingface/transformers/issues/40151/events | https://github.com/huggingface/transformers/pull/40151 | 3,320,504,488 | PR_kwDOCUB6oc6jmCzC | 40,151 | [bugfix] fix flash-attention2 unavailable error for Ascend NPU | {
"login": "FightingZhen",
"id": 26176607,
"node_id": "MDQ6VXNlcjI2MTc2NjA3",
"avatar_url": "https://avatars.githubusercontent.com/u/26176607?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/FightingZhen",
"html_url": "https://github.com/FightingZhen",
"followers_url": "https://api.github.com/users/FightingZhen/followers",
"following_url": "https://api.github.com/users/FightingZhen/following{/other_user}",
"gists_url": "https://api.github.com/users/FightingZhen/gists{/gist_id}",
"starred_url": "https://api.github.com/users/FightingZhen/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/FightingZhen/subscriptions",
"organizations_url": "https://api.github.com/users/FightingZhen/orgs",
"repos_url": "https://api.github.com/users/FightingZhen/repos",
"events_url": "https://api.github.com/users/FightingZhen/events{/privacy}",
"received_events_url": "https://api.github.com/users/FightingZhen/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 8103865784,
"node_id": "LA_kwDOCUB6oc8AAAAB4wctuA",
"url": "https://api.github.com/repos/huggingface/transformers/labels/for%20patch",
"name": "for patch",
"color": "D93F0B",
"default": false,
"description": "Tag issues / labels that should be included in the next patch"
}
] | closed | false | null | [] | null | [] | 2025-08-14T02:22:34 | 2025-08-14T12:21:39 | 2025-08-14T12:21:39 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40151",
"html_url": "https://github.com/huggingface/transformers/pull/40151",
"diff_url": "https://github.com/huggingface/transformers/pull/40151.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40151.patch",
"merged_at": "2025-08-14T12:21:39"
} | # What does this PR do?
#40002 cause Flash-Attention2 unavailable on Ascend NPU, **the core reason is package `flash-attn` unavailable on Ascend NPU, even can not be installed**, current implementation will cause **ImportError** on Ascend NPU.
This PR is committed for fixing this problem, remove redundant `apply_rotary_emb` function usage at the same time.
Fixes # (issue)
Not related.
## Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [x] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?
| {
"login": "ArthurZucker",
"id": 48595927,
"node_id": "MDQ6VXNlcjQ4NTk1OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/48595927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArthurZucker",
"html_url": "https://github.com/ArthurZucker",
"followers_url": "https://api.github.com/users/ArthurZucker/followers",
"following_url": "https://api.github.com/users/ArthurZucker/following{/other_user}",
"gists_url": "https://api.github.com/users/ArthurZucker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArthurZucker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArthurZucker/subscriptions",
"organizations_url": "https://api.github.com/users/ArthurZucker/orgs",
"repos_url": "https://api.github.com/users/ArthurZucker/repos",
"events_url": "https://api.github.com/users/ArthurZucker/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArthurZucker/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40151/reactions",
"total_count": 2,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 2,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40151/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40149 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40149/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40149/comments | https://api.github.com/repos/huggingface/transformers/issues/40149/events | https://github.com/huggingface/transformers/pull/40149 | 3,320,336,273 | PR_kwDOCUB6oc6jldl7 | 40,149 | Implemented fast image processor for VitPose | {
"login": "msminhas93",
"id": 6465972,
"node_id": "MDQ6VXNlcjY0NjU5NzI=",
"avatar_url": "https://avatars.githubusercontent.com/u/6465972?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/msminhas93",
"html_url": "https://github.com/msminhas93",
"followers_url": "https://api.github.com/users/msminhas93/followers",
"following_url": "https://api.github.com/users/msminhas93/following{/other_user}",
"gists_url": "https://api.github.com/users/msminhas93/gists{/gist_id}",
"starred_url": "https://api.github.com/users/msminhas93/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/msminhas93/subscriptions",
"organizations_url": "https://api.github.com/users/msminhas93/orgs",
"repos_url": "https://api.github.com/users/msminhas93/repos",
"events_url": "https://api.github.com/users/msminhas93/events{/privacy}",
"received_events_url": "https://api.github.com/users/msminhas93/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | [] | 2025-08-14T01:04:23 | 2025-08-16T03:53:44 | null | NONE | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40149",
"html_url": "https://github.com/huggingface/transformers/pull/40149",
"diff_url": "https://github.com/huggingface/transformers/pull/40149.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40149.patch",
"merged_at": null
} | # What does this PR do?
This PR implements a fast PyTorch image processor for VitPose (`VitPoseImageProcessorFast`) that extends the existing `BaseImageProcessorFast` class. The new processor provides optimized image processing capabilities specifically designed for pose estimation tasks using the VitPose model.
## Key Features
- **Fast PyTorch-native implementation**: Leverages PyTorch operations for efficient image processing
- **Affine transformations**: Supports image cropping and resizing based on bounding boxes
- **Channel dimension handling**: Automatic detection and conversion between different channel formats (CHW vs HWC)
- **Keypoint processing**: Includes methods for heatmap-based keypoint extraction and refinement
- **Post-processing utilities**: Dark unbiased data processing and coordinate transformation functions
- **Optimized normalization**: Handles variable channel counts (1, 3, 4 channels) with proper mean/std scaling
## Before submitting
- [x] This PR implements a new fast image processor for VitPose
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case. https://github.com/huggingface/transformers/issues/36978
- [x] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?
## Who can review?
@yonigozlan | {
"login": "msminhas93",
"id": 6465972,
"node_id": "MDQ6VXNlcjY0NjU5NzI=",
"avatar_url": "https://avatars.githubusercontent.com/u/6465972?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/msminhas93",
"html_url": "https://github.com/msminhas93",
"followers_url": "https://api.github.com/users/msminhas93/followers",
"following_url": "https://api.github.com/users/msminhas93/following{/other_user}",
"gists_url": "https://api.github.com/users/msminhas93/gists{/gist_id}",
"starred_url": "https://api.github.com/users/msminhas93/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/msminhas93/subscriptions",
"organizations_url": "https://api.github.com/users/msminhas93/orgs",
"repos_url": "https://api.github.com/users/msminhas93/repos",
"events_url": "https://api.github.com/users/msminhas93/events{/privacy}",
"received_events_url": "https://api.github.com/users/msminhas93/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40149/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40149/timeline | null | null | null | null | true | false |
https://api.github.com/repos/huggingface/transformers/issues/40148 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40148/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40148/comments | https://api.github.com/repos/huggingface/transformers/issues/40148/events | https://github.com/huggingface/transformers/pull/40148 | 3,320,272,526 | PR_kwDOCUB6oc6jlPto | 40,148 | Update utils.py: fix nan | {
"login": "MengAiDev",
"id": 202287492,
"node_id": "U_kgDODA6phA",
"avatar_url": "https://avatars.githubusercontent.com/u/202287492?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/MengAiDev",
"html_url": "https://github.com/MengAiDev",
"followers_url": "https://api.github.com/users/MengAiDev/followers",
"following_url": "https://api.github.com/users/MengAiDev/following{/other_user}",
"gists_url": "https://api.github.com/users/MengAiDev/gists{/gist_id}",
"starred_url": "https://api.github.com/users/MengAiDev/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MengAiDev/subscriptions",
"organizations_url": "https://api.github.com/users/MengAiDev/orgs",
"repos_url": "https://api.github.com/users/MengAiDev/repos",
"events_url": "https://api.github.com/users/MengAiDev/events{/privacy}",
"received_events_url": "https://api.github.com/users/MengAiDev/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | [] | 2025-08-14T00:26:20 | 2025-08-15T03:45:52 | null | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40148",
"html_url": "https://github.com/huggingface/transformers/pull/40148",
"diff_url": "https://github.com/huggingface/transformers/pull/40148.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40148.patch",
"merged_at": null
} | # What does this PR do?
- Update utils.py: fix nan
- Suggested in https://github.com/huggingface/transformers/pull/40093/commits/7e230e5464705e6e235aec47d8a7312a3404ba15
@ArthurZucker @zucchini-nlp
| null | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40148/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40148/timeline | null | null | null | null | true | false |
https://api.github.com/repos/huggingface/transformers/issues/40147 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40147/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40147/comments | https://api.github.com/repos/huggingface/transformers/issues/40147/events | https://github.com/huggingface/transformers/pull/40147 | 3,319,883,119 | PR_kwDOCUB6oc6jj9KC | 40,147 | Add AriaImageProcessorFast | {
"login": "LawJarp-A",
"id": 34590600,
"node_id": "MDQ6VXNlcjM0NTkwNjAw",
"avatar_url": "https://avatars.githubusercontent.com/u/34590600?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/LawJarp-A",
"html_url": "https://github.com/LawJarp-A",
"followers_url": "https://api.github.com/users/LawJarp-A/followers",
"following_url": "https://api.github.com/users/LawJarp-A/following{/other_user}",
"gists_url": "https://api.github.com/users/LawJarp-A/gists{/gist_id}",
"starred_url": "https://api.github.com/users/LawJarp-A/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/LawJarp-A/subscriptions",
"organizations_url": "https://api.github.com/users/LawJarp-A/orgs",
"repos_url": "https://api.github.com/users/LawJarp-A/repos",
"events_url": "https://api.github.com/users/LawJarp-A/events{/privacy}",
"received_events_url": "https://api.github.com/users/LawJarp-A/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-13T20:59:23 | 2025-08-16T05:52:58 | 2025-08-16T05:52:57 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40147",
"html_url": "https://github.com/huggingface/transformers/pull/40147",
"diff_url": "https://github.com/huggingface/transformers/pull/40147.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40147.patch",
"merged_at": null
} | Resolves #36978
Adds fast image processor for Aria model using PyTorch operations.
- Full implementation with image splitting and patching support
- Same outputs as slow processor
- All linting checks pass | {
"login": "LawJarp-A",
"id": 34590600,
"node_id": "MDQ6VXNlcjM0NTkwNjAw",
"avatar_url": "https://avatars.githubusercontent.com/u/34590600?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/LawJarp-A",
"html_url": "https://github.com/LawJarp-A",
"followers_url": "https://api.github.com/users/LawJarp-A/followers",
"following_url": "https://api.github.com/users/LawJarp-A/following{/other_user}",
"gists_url": "https://api.github.com/users/LawJarp-A/gists{/gist_id}",
"starred_url": "https://api.github.com/users/LawJarp-A/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/LawJarp-A/subscriptions",
"organizations_url": "https://api.github.com/users/LawJarp-A/orgs",
"repos_url": "https://api.github.com/users/LawJarp-A/repos",
"events_url": "https://api.github.com/users/LawJarp-A/events{/privacy}",
"received_events_url": "https://api.github.com/users/LawJarp-A/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40147/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40147/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40146 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40146/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40146/comments | https://api.github.com/repos/huggingface/transformers/issues/40146/events | https://github.com/huggingface/transformers/pull/40146 | 3,319,851,388 | PR_kwDOCUB6oc6jj2Ax | 40,146 | Add AriaImageProcessorFast | {
"login": "LawJarp-A",
"id": 34590600,
"node_id": "MDQ6VXNlcjM0NTkwNjAw",
"avatar_url": "https://avatars.githubusercontent.com/u/34590600?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/LawJarp-A",
"html_url": "https://github.com/LawJarp-A",
"followers_url": "https://api.github.com/users/LawJarp-A/followers",
"following_url": "https://api.github.com/users/LawJarp-A/following{/other_user}",
"gists_url": "https://api.github.com/users/LawJarp-A/gists{/gist_id}",
"starred_url": "https://api.github.com/users/LawJarp-A/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/LawJarp-A/subscriptions",
"organizations_url": "https://api.github.com/users/LawJarp-A/orgs",
"repos_url": "https://api.github.com/users/LawJarp-A/repos",
"events_url": "https://api.github.com/users/LawJarp-A/events{/privacy}",
"received_events_url": "https://api.github.com/users/LawJarp-A/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-13T20:49:18 | 2025-08-13T20:52:41 | 2025-08-13T20:52:41 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40146",
"html_url": "https://github.com/huggingface/transformers/pull/40146",
"diff_url": "https://github.com/huggingface/transformers/pull/40146.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40146.patch",
"merged_at": null
} | Resolves #36978
This PR adds a fast image processor for the Aria model using PyTorch operations instead of PIL/numpy for better performance.
## Implementation
- Full PyTorch/torchvision implementation of Aria's image preprocessing
- Maintains all Aria-specific features (image splitting, patching, custom resolutions)
- Same output format: pixel_values, pixel_mask, num_crops
- Identical results to the slow processor
## Testing
- Basic functionality verified
- Output comparison with slow processor shows identical results
- Image splitting functionality tested
## Changes
- Added AriaImageProcessorFast class
- Updated imports and tests automatically via CLI tool
- Full compatibility with existing Aria processor interface | {
"login": "LawJarp-A",
"id": 34590600,
"node_id": "MDQ6VXNlcjM0NTkwNjAw",
"avatar_url": "https://avatars.githubusercontent.com/u/34590600?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/LawJarp-A",
"html_url": "https://github.com/LawJarp-A",
"followers_url": "https://api.github.com/users/LawJarp-A/followers",
"following_url": "https://api.github.com/users/LawJarp-A/following{/other_user}",
"gists_url": "https://api.github.com/users/LawJarp-A/gists{/gist_id}",
"starred_url": "https://api.github.com/users/LawJarp-A/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/LawJarp-A/subscriptions",
"organizations_url": "https://api.github.com/users/LawJarp-A/orgs",
"repos_url": "https://api.github.com/users/LawJarp-A/repos",
"events_url": "https://api.github.com/users/LawJarp-A/events{/privacy}",
"received_events_url": "https://api.github.com/users/LawJarp-A/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40146/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40146/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40145 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40145/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40145/comments | https://api.github.com/repos/huggingface/transformers/issues/40145/events | https://github.com/huggingface/transformers/issues/40145 | 3,319,736,627 | I_kwDOCUB6oc7F3ykz | 40,145 | Vision Transformer with Mixture of Experts (ViT-MoE) | {
"login": "LawJarp-A",
"id": 34590600,
"node_id": "MDQ6VXNlcjM0NTkwNjAw",
"avatar_url": "https://avatars.githubusercontent.com/u/34590600?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/LawJarp-A",
"html_url": "https://github.com/LawJarp-A",
"followers_url": "https://api.github.com/users/LawJarp-A/followers",
"following_url": "https://api.github.com/users/LawJarp-A/following{/other_user}",
"gists_url": "https://api.github.com/users/LawJarp-A/gists{/gist_id}",
"starred_url": "https://api.github.com/users/LawJarp-A/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/LawJarp-A/subscriptions",
"organizations_url": "https://api.github.com/users/LawJarp-A/orgs",
"repos_url": "https://api.github.com/users/LawJarp-A/repos",
"events_url": "https://api.github.com/users/LawJarp-A/events{/privacy}",
"received_events_url": "https://api.github.com/users/LawJarp-A/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 1843244711,
"node_id": "MDU6TGFiZWwxODQzMjQ0NzEx",
"url": "https://api.github.com/repos/huggingface/transformers/labels/New%20model",
"name": "New model",
"color": "fbca04",
"default": false,
"description": ""
}
] | closed | false | null | [] | null | [] | 2025-08-13T20:12:17 | 2025-08-19T15:09:39 | 2025-08-19T15:09:39 | CONTRIBUTOR | null | null | null | null | ### Model description
Vision Transformer with Mixture of Experts (ViT-MoE) is an efficient scaling approach for vision transformers that replaces dense feedforward layers with sparse mixture of experts.
This architecture enables scaling model capacity while keeping per-token computation roughly constant, achieving better accuracy-efficiency trade offs compared to dense ViTs.
Key Benefits:
- 90.35% ImageNet accuracy with ~50% compute reduction vs dense models
- Expert specialization emerges naturally (deeper layers specialize in object classes)
- Scalable to large model sizes without proportional compute increase
The implementation would follow existing MoE patterns in transformers (Mixtral, Switch Transformers) but adapted for vision tasks, trying to filling the current gap of vision MoE models in the library.
Implementation Plan:
1. Base Implementation: Use Google V-MoE as foundation
2. Enhanced with ViMoE Research: Apply latest empirical insights (if required)
Evaluation: Start with ImageNet-1K classification, then expand to other vision tasks
### Open source status
- [x] The model implementation is available
- [x] The model weights are available
### Provide useful links for the implementation
Primary Implementation Reference:
- Google V-MoE Implementation: https://github.com/google-research/vmoe
- Google V-MoE Paper: https://arxiv.org/abs/2106.05974
- Google V-MoE Blog: https://research.google/blog/scaling-vision-with-sparse-mixture-of-experts/
Additional Research Foundation:
- ViMoE Paper (ICLR 2025): https://arxiv.org/abs/2410.15732
- OpenReview: https://openreview.net/forum?id=KaYXsoCxV7
- Authors: @Frank-ZY-Dou, @JoinWei-PKU (partial list)
- Mobile V-MoEs: https://arxiv.org/abs/2309.04354
- M³ViT: https://arxiv.org/abs/2210.14793
Existing MoE Patterns in Transformers:
- Mixtral: src/transformers/models/mixtral/modeling_mixtral.py
- Switch Transformers: src/transformers/models/switch_transformers/modeling_switch_transformers.py
- Qwen2-MoE: src/transformers/models/qwen2_moe/modeling_qwen2_moe.py
Pre-trained Weights:
- Google V-MoE checkpoints available in their repository for various model sizes
- ImageNet-21k and ILSVRC2012 trained models | {
"login": "LawJarp-A",
"id": 34590600,
"node_id": "MDQ6VXNlcjM0NTkwNjAw",
"avatar_url": "https://avatars.githubusercontent.com/u/34590600?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/LawJarp-A",
"html_url": "https://github.com/LawJarp-A",
"followers_url": "https://api.github.com/users/LawJarp-A/followers",
"following_url": "https://api.github.com/users/LawJarp-A/following{/other_user}",
"gists_url": "https://api.github.com/users/LawJarp-A/gists{/gist_id}",
"starred_url": "https://api.github.com/users/LawJarp-A/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/LawJarp-A/subscriptions",
"organizations_url": "https://api.github.com/users/LawJarp-A/orgs",
"repos_url": "https://api.github.com/users/LawJarp-A/repos",
"events_url": "https://api.github.com/users/LawJarp-A/events{/privacy}",
"received_events_url": "https://api.github.com/users/LawJarp-A/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40145/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40145/timeline | null | completed | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | {
"blocked_by": 0,
"total_blocked_by": 0,
"blocking": 0,
"total_blocking": 0
} | false | true |
https://api.github.com/repos/huggingface/transformers/issues/40144 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40144/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40144/comments | https://api.github.com/repos/huggingface/transformers/issues/40144/events | https://github.com/huggingface/transformers/pull/40144 | 3,319,541,714 | PR_kwDOCUB6oc6jixz5 | 40,144 | Fix quantized cache with only cache_implementation in generate | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-13T19:11:35 | 2025-08-13T21:50:33 | 2025-08-13T21:21:41 | MEMBER | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40144",
"html_url": "https://github.com/huggingface/transformers/pull/40144",
"diff_url": "https://github.com/huggingface/transformers/pull/40144.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40144.patch",
"merged_at": "2025-08-13T21:21:41"
} | # What does this PR do?
As per the title. It fixes the initialization of the Cache that changed after all the cache refactors | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40144/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40144/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40143 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40143/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40143/comments | https://api.github.com/repos/huggingface/transformers/issues/40143/events | https://github.com/huggingface/transformers/pull/40143 | 3,319,514,393 | PR_kwDOCUB6oc6jir7Y | 40,143 | make model doc device agnostic | {
"login": "yao-matrix",
"id": 7245027,
"node_id": "MDQ6VXNlcjcyNDUwMjc=",
"avatar_url": "https://avatars.githubusercontent.com/u/7245027?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yao-matrix",
"html_url": "https://github.com/yao-matrix",
"followers_url": "https://api.github.com/users/yao-matrix/followers",
"following_url": "https://api.github.com/users/yao-matrix/following{/other_user}",
"gists_url": "https://api.github.com/users/yao-matrix/gists{/gist_id}",
"starred_url": "https://api.github.com/users/yao-matrix/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yao-matrix/subscriptions",
"organizations_url": "https://api.github.com/users/yao-matrix/orgs",
"repos_url": "https://api.github.com/users/yao-matrix/repos",
"events_url": "https://api.github.com/users/yao-matrix/events{/privacy}",
"received_events_url": "https://api.github.com/users/yao-matrix/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-13T19:01:46 | 2025-08-15T17:03:48 | 2025-08-15T06:31:31 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40143",
"html_url": "https://github.com/huggingface/transformers/pull/40143",
"diff_url": "https://github.com/huggingface/transformers/pull/40143.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40143.patch",
"merged_at": "2025-08-15T06:31:31"
} | As `torch` and `transformers` already support multiple devices("cuda", "xpu" etc) as their built-in devices, maybe it's a good time to extend model doc examples to a device-agnostic one rather than binding to "cuda". I am add a `infer_device` API in utils to automatically detect available device in runtime.
@stevhliu , pls help review and comment, thx very much. | {
"login": "stevhliu",
"id": 59462357,
"node_id": "MDQ6VXNlcjU5NDYyMzU3",
"avatar_url": "https://avatars.githubusercontent.com/u/59462357?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stevhliu",
"html_url": "https://github.com/stevhliu",
"followers_url": "https://api.github.com/users/stevhliu/followers",
"following_url": "https://api.github.com/users/stevhliu/following{/other_user}",
"gists_url": "https://api.github.com/users/stevhliu/gists{/gist_id}",
"starred_url": "https://api.github.com/users/stevhliu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stevhliu/subscriptions",
"organizations_url": "https://api.github.com/users/stevhliu/orgs",
"repos_url": "https://api.github.com/users/stevhliu/repos",
"events_url": "https://api.github.com/users/stevhliu/events{/privacy}",
"received_events_url": "https://api.github.com/users/stevhliu/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40143/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40143/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40142 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40142/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40142/comments | https://api.github.com/repos/huggingface/transformers/issues/40142/events | https://github.com/huggingface/transformers/pull/40142 | 3,319,470,404 | PR_kwDOCUB6oc6jiicO | 40,142 | Remove an old badly designed test | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-13T18:44:15 | 2025-08-13T18:58:06 | 2025-08-13T18:47:00 | MEMBER | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40142",
"html_url": "https://github.com/huggingface/transformers/pull/40142",
"diff_url": "https://github.com/huggingface/transformers/pull/40142.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40142.patch",
"merged_at": "2025-08-13T18:47:00"
} | # What does this PR do?
All of them except 1 have been failing in disguise from a long-time, because they would get skipped in the middle of the for loop, before they would actually fail 🙃🥵
Only flaubert started failing recently, which was only skipped before. But since torchscript has been dropped and is no longer maintained, I am plainly removing them all | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40142/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40142/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40141 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40141/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40141/comments | https://api.github.com/repos/huggingface/transformers/issues/40141/events | https://github.com/huggingface/transformers/pull/40141 | 3,319,375,407 | PR_kwDOCUB6oc6jiOJe | 40,141 | [EfficientLoFTR] Fixed bugs and added original implementation bug | {
"login": "sbucaille",
"id": 24275548,
"node_id": "MDQ6VXNlcjI0Mjc1NTQ4",
"avatar_url": "https://avatars.githubusercontent.com/u/24275548?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sbucaille",
"html_url": "https://github.com/sbucaille",
"followers_url": "https://api.github.com/users/sbucaille/followers",
"following_url": "https://api.github.com/users/sbucaille/following{/other_user}",
"gists_url": "https://api.github.com/users/sbucaille/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sbucaille/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sbucaille/subscriptions",
"organizations_url": "https://api.github.com/users/sbucaille/orgs",
"repos_url": "https://api.github.com/users/sbucaille/repos",
"events_url": "https://api.github.com/users/sbucaille/events{/privacy}",
"received_events_url": "https://api.github.com/users/sbucaille/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-13T18:08:26 | 2025-08-14T12:28:45 | 2025-08-14T09:43:00 | CONTRIBUTOR | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40141",
"html_url": "https://github.com/huggingface/transformers/pull/40141",
"diff_url": "https://github.com/huggingface/transformers/pull/40141.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40141.patch",
"merged_at": "2025-08-14T09:43:00"
} | # What does this PR do?
Fixes a couple of bugs introduced in the implementation of EfficientLoFTR.
Adds a cross attention bug introduced by the authors which makes the weights dependant on (see https://github.com/zju3dv/MatchAnything/issues/26)
## Who can review?
@qubvel
| {
"login": "qubvel",
"id": 31920396,
"node_id": "MDQ6VXNlcjMxOTIwMzk2",
"avatar_url": "https://avatars.githubusercontent.com/u/31920396?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/qubvel",
"html_url": "https://github.com/qubvel",
"followers_url": "https://api.github.com/users/qubvel/followers",
"following_url": "https://api.github.com/users/qubvel/following{/other_user}",
"gists_url": "https://api.github.com/users/qubvel/gists{/gist_id}",
"starred_url": "https://api.github.com/users/qubvel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/qubvel/subscriptions",
"organizations_url": "https://api.github.com/users/qubvel/orgs",
"repos_url": "https://api.github.com/users/qubvel/repos",
"events_url": "https://api.github.com/users/qubvel/events{/privacy}",
"received_events_url": "https://api.github.com/users/qubvel/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40141/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40141/timeline | null | null | null | null | true | true |
https://api.github.com/repos/huggingface/transformers/issues/40140 | https://api.github.com/repos/huggingface/transformers | https://api.github.com/repos/huggingface/transformers/issues/40140/labels{/name} | https://api.github.com/repos/huggingface/transformers/issues/40140/comments | https://api.github.com/repos/huggingface/transformers/issues/40140/events | https://github.com/huggingface/transformers/pull/40140 | 3,319,339,178 | PR_kwDOCUB6oc6jiGdZ | 40,140 | Fix Janus | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2025-08-13T17:55:23 | 2025-08-13T18:12:23 | 2025-08-13T18:12:21 | MEMBER | null | null | false | {
"url": "https://api.github.com/repos/huggingface/transformers/pulls/40140",
"html_url": "https://github.com/huggingface/transformers/pull/40140",
"diff_url": "https://github.com/huggingface/transformers/pull/40140.diff",
"patch_url": "https://github.com/huggingface/transformers/pull/40140.patch",
"merged_at": "2025-08-13T18:12:21"
} | # What does this PR do?
Fix after https://github.com/huggingface/transformers/pull/39797 - function does not expect the device anymore | {
"login": "Cyrilvallez",
"id": 71554963,
"node_id": "MDQ6VXNlcjcxNTU0OTYz",
"avatar_url": "https://avatars.githubusercontent.com/u/71554963?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cyrilvallez",
"html_url": "https://github.com/Cyrilvallez",
"followers_url": "https://api.github.com/users/Cyrilvallez/followers",
"following_url": "https://api.github.com/users/Cyrilvallez/following{/other_user}",
"gists_url": "https://api.github.com/users/Cyrilvallez/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Cyrilvallez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Cyrilvallez/subscriptions",
"organizations_url": "https://api.github.com/users/Cyrilvallez/orgs",
"repos_url": "https://api.github.com/users/Cyrilvallez/repos",
"events_url": "https://api.github.com/users/Cyrilvallez/events{/privacy}",
"received_events_url": "https://api.github.com/users/Cyrilvallez/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/transformers/issues/40140/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/transformers/issues/40140/timeline | null | null | null | null | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.