noamaanMulla-03/transformers-issues huggingface dataset:
🌐 [i18n-KO] Translated `pipelines.md` to Korean
Author: xhaktm00
Pull request: yes

# What does this PR do?

Translated the `pipelines.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)

May you please review this PR?
@4N3MONE, @yijun-lee, @jungnerd , @harheem

## 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#start-contributing-pull-requests),
      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? (Final)
@stevhliu May you please review this PR?

Comments:
@harheem @yijun-lee
상세하게 리뷰 남겨주셔서 감사합니다!
리뷰해주신 내용 반영하여 수정 작업 완료했습니다. 검토 부탁드립니다.

감사합니다.🫡

@xhaktm00 toctree.yml 의 conflicts를 해결하시면 approve 하겠습니다 🤗

> @xhaktm00 toctree.yml 의 conflicts를 해결하시면 approved 하겠습니다 🤗

@harheem conflicts 해결했습니다. 확인 부탁드립니다.

Thanks, I'll merge this for you once a small issue with the doc-builder is ironed out 🤗 

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39577). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

build-doc

[Building docs for all languages...](https://github.com/huggingface/transformers/actions/runs/16944066063)
gpt oss is important
Author: ArthurZucker
Pull request: yes

# What does this PR do?
Make sure we run slow test for it

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_40139). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Fix Janus
Author: Cyrilvallez
Pull request: yes

# What does this PR do?

Fix after https://github.com/huggingface/transformers/pull/39797 - function does not expect the device anymore

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: janus

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_40140). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
[docs] Fix ko toctree
Author: stevhliu
Pull request: yes

Fixes `grounding_dino.md` to `grounding-dino.md` introduced in https://github.com/huggingface/transformers/pull/39861

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_40138). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Remove an old badly designed test
Author: Cyrilvallez
Pull request: yes

# 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

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: bert, convbert, distilbert, ernie, flaubert

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_40142). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
updated visualBERT modelcard
Author: Anil-Red
Pull request: yes

# 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?

@stevhliu would you please review my PR?


Comments:
hi @stevhliu I've incorporated all the changes that you have mentioned. Can you please review my PR?

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_40057). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

thank you for guiding me @stevhliu 🤗.
🌐 [i18n-KO] Translated `gemma3.md` to Korean
Author: seopp
Pull request: yes

<!-- PR의 제목은 "🌐 [i18n-KO] Translated `<your_file>.md` to Korean" 으로 부탁드립니다 -->
# What does this PR do?

Translated the `gemma3.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, @pyapyapya

## 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?

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39865). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

build-doc

[Building docs for all languages...](https://github.com/huggingface/transformers/actions/runs/16944078770)

build-doc

[Building docs for all languages...](https://github.com/huggingface/transformers/actions/runs/16947678066)
Add AriaImageProcessorFast
Author: LawJarp-A
Pull request: yes

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

Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: aria
Add pytest marker: `torch_compile_test` and `torch_export_test`
Author: ydshieh
Pull request: yes

# What does this PR do?

The torch team considers to run some transformers tests on their side, especially the compile and export tests. They request us to provide a way to easily and reliably running those related tests. 

Therefore this PR adds 2 new pytest marker and use them to the relevant tests.

A run using `torch_compile_test` is

https://github.com/huggingface/transformers/actions/runs/16751561312/job/47423145415


Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39950). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Maybe @ivarflakstad could help review?

**[For maintainers]** Suggested jobs to run (before merge)

run-slow: albert, aria, aya_vision, beit, bert, clip, cohere2, colpali, colqwen2, data2vec, deepseek_v2, deepseek_v3, depth_anything, depth_pro, diffllama, distilbert
Fix quantized cache with only cache_implementation in generate
Author: Cyrilvallez
Pull request: yes

# What does this PR do?

As per the title. It fixes the initialization of the Cache that changed after all the cache refactors

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_40144). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Update CTRL model card with improved usage examples and documentation notes
Author: Ishubhammohole
Pull request: yes

Description:
This PR improves the ctrl model card to align with Hugging Face documentation standards and improve clarity for users. Specifically, it:
	•	Updates metadata fields (e.g., license, tags, library name, model type)
	•	Improves model description for better readability
	•	Adds usage tips and clearer links to paper and code
	•	Enhances tokenizer and limitations sections
	•	Fixes minor formatting inconsistencies

These changes ensure consistency with other official model cards and improve user understanding when exploring or deploying the ctrl model.

⸻

What does this PR do?
✔️ Updates and standardizes the ctrl model card
✔️ Improves clarity, formatting, and metadata fields
✔️ Enhances user experience and aligns with documentation best practices

⸻

Before submitting
	•	I’ve read the [Pull Request section](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#pull-requests) of the contributing guide
	•	Documentation has been updated accordingly
	•	No new tests are necessary (doc-only PR)

⸻

Who can review?
Anyone in the community is welcome to review.
Recommended reviewers: @stevhliu

Comments:
Hi, please check my post [here](https://github.com/huggingface/transformers/issues/36979#issue-2947704577) for the expected format!
[bugfix] fix flash_attention_2 unavailable error on Ascend NPU
Author: FightingZhen
Pull request: yes

# What does this PR do?
After PR #39474 merged, flash_attention_2 is unavailable on Ascend NPU, because package `flash-attn` can not be installed on Ascend NPU :(

This PR is committed for solving this problem.

**Detail modification:**
1. Follow newest flash attention preparation logics in `src/transformers/modeling_flash_attention_utils.py` module, use `get_npu_flash_attn_funcs` return flash attention related functions for Ascend NPU.
2. Ignore logics related with package `flash-attn` in func `_flash_attn_2_can_dispatch` from `src/transformers/modeling_utils.py` module, it is not required for Ascend NPU.

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?


Comments:
Please help me review this, thanks a lot! @ArthurZucker 

@ArthurZucker please help me review and merge, thanks ~

cc @ivarflakstad @sunmarc

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39844). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Very good work. Can Flash Attention 3 also be used on the Ascend NPU?

> Very good work. Can Flash Attention 3 also be used on the Ascend NPU?

Hi, as far as i know, flash-attention-3 is not supported yet on Ascend NPU, see [doc](https://www.hiascend.com/document/detail/zh/Pytorch/710/ptmoddevg/trainingmigrguide/performance_tuning_0034.html)
[bugfix] fix flash attention 2 unavailable error on Ascend NPU
Author: FightingZhen
Pull request: yes
Labels: name: for patch

# What does this PR do?

https://github.com/huggingface/transformers/pull/38972 introduce flash attention 3 into `transformers`. However, the modification **introduce a bug** when using flash attention 2 on Ascend NPU.

The core reason is due to function names **mismatch**: 

Functions defined from `transformers.integrations.npu_flash_attention`:
https://github.com/huggingface/transformers/blob/e8e0c76162263840661fc0ca0da3952861754759/src/transformers/modeling_flash_attention_utils.py#L140-L153

Functions actually used:
https://github.com/huggingface/transformers/blob/e8e0c76162263840661fc0ca0da3952861754759/src/transformers/modeling_flash_attention_utils.py#L470-L475

This PR is committed for solving this problem, by renaming flash attention 2 related functions (e.g. `npu_flash_attn_func`) from `transformers.integrations.npu_flash_attention` to correct names, which should contain `_2_` symbol (e.g. `flash_attn_2_func`) 

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?


Comments:
This PR is ready for merge @ArthurZucker @SunMarc, cc @EduardDurech 

Thanks, I didn't have a device to test this on but looks like you did it correctly

Looking forward for review @ArthurZucker @SunMarc 

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39166). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Very good work. Can Flash Attention 3 also be used on the Ascend NPU?
[bugfix] fix flex-attention not supported on Ascend NPU, update BlockMask type annotations to str
Author: FightingZhen
Pull request: yes

# What does this PR do?

**1. Problem 1**
Flex-attention has not been fully verified on Ascend NPU yet. In PR #37866 , the func `is_torch_flex_attn_available` defined in below code does not contain logical judgment about Ascend NPU. In this situation, when we use torch>=2.5.0, this func will return `True` on Ascend NPU, which is not correct.
https://github.com/huggingface/transformers/blob/d03a3ca69226a776d9ed69cd90cbe8f6ebe8fa34/src/transformers/utils/import_utils.py#L412

**2. Problem 2**
If func `is_torch_flex_attn_available` return `False` on Ascend NPU as expected, object `BlockMask` will not be imported in below code
https://github.com/huggingface/transformers/blob/a5a0c7b88828a7273bdedbdcaa2c7a252084c0d8/src/transformers/masking_utils.py#L29

But this object is directly called in type annotations in below code now, directly causing importance error.
https://github.com/huggingface/transformers/blob/a5a0c7b88828a7273bdedbdcaa2c7a252084c0d8/src/transformers/masking_utils.py#L585

**Therefore, this PR is committed for solving above two problems**. By adding flex-attention not supported on Ascend NPU logic in `is_torch_flex_attn_available`,  and updating `BlockMask` type annotations to string format.

Fixes # (issue)
#38362 

## 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.
- [ ] 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?


Comments:
[performance_optim] reduce frequency of declaring attention_mask in Ascend NPU flash attention
Author: FightingZhen
Pull request: yes

# What does this PR do?

During analyzing performance of flash attention on Ascend NPU, we find that a fixed-size 2048*2048 upper triangular matrix `attn_mask_npu` is frequently defined in func `npu_flash_attn_func` and `npu_flash_attn_varlen_func`, which will cost a lot of time.

This PR is committed for solving this problem, by defining and using global variable `ATTN_MASK_NPU`, this matrix will not be defined every time func `npu_flash_attn_func` or `npu_flash_attn_varlen_func` is called.

Thanks @CurryRice233 for proposing this idea.

Fixes # (issue)
Not related.

## 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?

Comments:
This PR is ready for review :) @ArthurZucker @SunMarc @MekkCyber 

> Thanks ! what is the increase of speed with this change ?

Yes, this modification can increase the speed.

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_38278). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

> Thanks ! what is the increase of speed with this change ?

With this change, I don't have to re-create a mask every FA, just use one created, which reduces the creation time and memory of the mask for backward.

@ArthurZucker please help me review and merge this PR, thanks a lot :)