noamaanMulla-03/transformers-issues huggingface dataset:
add tensor parallel test for MoE
Author: 3outeille
Pull request: yes

wait for v5 for the Moe changes. Apparently it fixes stuff regarding TP and MoE (was discussed offline). As to now (`tags: v4.57.1`),  tests are not passing

<img width="1251" height="179" alt="image" src="https://github.com/user-attachments/assets/879bb4a7-7a7c-49da-822b-60c8ccd58088" />

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

# What does this PR do?

Should fix the https://app.circleci.com/pipelines/github/huggingface/transformers/156887/workflows/a4903e4d-20a5-4f8b-8ea6-04152fef96c0/jobs/2062866 test

Comments:
View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=42810&sha=ebb023

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

This is a big PR to refresh outdated parts of vision docs and add new ones for newer tasks. 

Here's some action items:
- [x] add SAM2 FT to mask-generation tutorial
- [ ] add trackio to vision examples (requires extended support from Trainer)
- [ ] add universal segmentation docs (@ariG23498 is taking it up)
- [x] fix dataset in semantic segmentation doc (there was a canonical one which didn't load, fixed it)
- [x] rewrite video-text-to-text completely with video processors
- [x] update outdated image-text-to-text docs
- [ ] (maybe) swap models with newer ones 

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

Subscribed, thanks for starting this! Feel free to ping me for a review

@molbap @stevhliu I did a revamp of the docs for a few tasks, I might do follow-up but I don't want to be overwhelmed and rather keep this PR atomic, so feel free to review.

@stevhliu would be great if you can review!
[kernels] Remove the last kernel from transformers codebase
Author: MekkCyber
Pull request: yes

# What does this PR do?

Removes the `mamba-ssm` kernel for `falcon-mamba` models and uses the kernel from the hub : https://huggingface.co/kernels-community/mamba-ssm

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

@MekkCyber is the mamba_ssm kernels working for you? I am running into this issue - https://github.com/state-spaces/mamba/pull/807

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

run-slow: falcon_mamba, mamba
Fix failing `owlv2` image processor integration test
Author: Sai-Suraj-27
Pull request: yes

# What does this PR do?
Fixes [failing Owlv2ImageProcessingTest](https://github.com/huggingface/transformers/actions/runs/19983883282/job/57315088143#step:14:2390)

<img width="1320" height="115" alt="image" src="https://github.com/user-attachments/assets/8317e26b-1a60-48d9-af18-c5d61961925f" />


## 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?
@yonigozlan @Rocketknight1 

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

run-slow: owlv2

run-slow: owlv2

This comment contains `run-slow`, running the specified jobs: 

models: ["models/owlv2"]
quantizations: []

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

## CI Results
[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/20064686720)

✅ No failing test specific to this PR 🎉 !


> ## CI Results
> [Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/20064686720)
> 
> ✅ No failing test specific to this PR 🎉 !

Hey, @Rocketknight1. Any idea, on what basis, this comment is returning no failing test? Because when I see the [Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/20064686720). 1 test is failing. This test was failing before also, It's not related to the changes in the PR, but still I think It should ideally report that failing test right? as it's from the same model.
I am guessing, some issue here [Post results as PR comment](https://github.com/huggingface/transformers/actions/runs/20064686720/workflow#L285), will try to check.


When a test is failing already, we ignore it because we really just want to ensure that the PR isn't making things any worse :sweat_smile: 

> When a test is failing already, we ignore it because we really just want to ensure that the PR isn't making things any worse 😅

Got, it. Thanks for the clarification!
Fix integration test in Owlv2 image processing tests
Author: yonigozlan
Pull request: yes

Checked on a CI runner
Cc @ydshieh 

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

run-slow: owlv2

run-slow: owlv2

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

# What does this PR do?

This PR simplifies a bit the AWQ integration. cc @Qubitium 
Also, I fixed some issues with gptq tests as the hub tests are failiing due to them

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

@SunMarc There is an issue where gpt-qmodel will not select the correct kernel for llm-awq in this PR due to the config compat diff between autoawq and llm-awq. We are checking to see if gpt-qmodel needs to be patched only, or requires small changes in HF as well. 

@SunMarc @MekkCyber gpt-qmodel and autoawq does not support support llm-awq quantized models so this pr will break llm-awq loading.

After checking, llm-awq stores qweight/scales differently and inference kernel is also different. autoawq also does not support llm-awq from a quick scan.

As such gpt-qmodel only supports autoawq compat and does not yet support llm-awq format/kernel. We can add this support in a future gpt-qmodel update but until then, we still need the if/else branching code for llm-awq




> @SunMarc @MekkCyber gpt-qmodel and autoawq does not support support llm-awq quantized models so this pr will break llm-awq loading.
> 
> After checking, llm-awq stores qweight/scales differently and inference kernel is also different. autoawq also does not support llm-awq from a quick scan.
> 
> As such gpt-qmodel only supports autoawq compat and does not yet support llm-awq format/kernel. We can add this support in a future gpt-qmodel update but until then, we still need the if/else branching code for llm-awq

Well, I think it fine to remove llm-awq support. The code was added before as we hoped that the llm-awq will be maintained in the same way as auto-awq but clearly it was abandoned as well. Most models on the hub don't use this format so let's take this chance to remove it entirely. WDTY ? We can still add it back if users complain but I don't think this will happen. 

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

run-slow: autoawq, gptq

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=42776&sha=972388

> Well, I think it fine to remove llm-awq support. The code was added before as we hoped that the llm-awq will be maintained in the same way as auto-awq but clearly it was abandoned as well. Most models on the hub don't use this format so let's take this chance to remove it entirely. WDTY ? We can still add it back if users complain but I don't think this will happen. 

If llm-awq compat is not an issue, then this pr is good to go. I am in agreement here. 

We will add llm-awq inference support to gpt-qmodel sometime next week so the og awq model support is retained for academic purposes as I still see most papers using reference og gptq and awq code rather than more modern frameworks.
[kernels] adding RMSNorm kernel for mps devices
Author: MekkCyber
Pull request: yes

# What does this PR do?

Adds the mlx RMSnorm kernels for mps devices to transformers
<img width="1348" height="767" alt="image" src="https://github.com/user-attachments/assets/327ae2d6-736a-4ca7-9953-e04732bf3dab" />


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

# What does this PR do?

This PR updates the deprecation msg for `warmup_ratio` to have it less confusing. 

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

# What does this PR do?

As per the title. As discussed offline, it's very dangerous in general to NOT re-raise them, as it would make any bug in Converters invisible to us in tests (and to users not looking properly at logs)

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

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=42807&sha=a9d229
Automatic release script
Author: LysandreJik
Pull request: yes

Automatic releases to pypi when a tag is pushed; the workflow will still need to be validated by a core maintainer.

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

# What does this PR do?

This PR adds inputs_to_logits_ratio to LasrCTCConfig so that LasrForCTC can be used in an ASR pipeline with chunked decoding.

## 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.
- [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?


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

run-slow: lasr

cc @eustlb @ebezzam for audio maybe?
requires_backends ImportError in transformers 5.0.0rc0
Author: KosmoCHE
Pull request: no
Labels: name: bug

### System Info

When using the pyserini library, importing requires_backends from transformers fails. This issue works correctly on transformers v4.57.3 but breaks on v5.0.0rc0.

Environment:

transformers version: 5.0.0rc0 (problematic) vs 4.57.3 (working)
Python version: 3.12
Dependencies: pyserini
Error Message
```
ImportError: cannot import name 'requires_backends' from 'transformers'

```
Full traceback:
```
File "/opt/conda/envs/tti/lib/python3.12/site-packages/pyserini/encode/_ance.py", line 20, in <module>
    from transformers import PreTrainedModel, RobertaConfig, RobertaModel, RobertaTokenizer, requires_backends
ImportError: cannot import name 'requires_backends' from 'transformers'
```




### Who can help?

 @ArthurZucker @Cyrilvallez @IlyasMoutawwakil

### Information

- [ ] The official example scripts
- [x] My own modified scripts
```python
from transformers import requires_backends
```
### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [x] My own task or dataset (give details below)

### Reproduction

Steps to Reproduce
1. Install transformers 5.0.0rc0
```bash
pip install transformers --pre
```
2. Try to import pyserini
```python
from pyserini.search.lucene import LuceneSearcher
# Or directly test the import
from transformers import requires_backends
```

### Expected behavior

requires_backends should be importable from the transformers package, just as it is in v4.57.3.However it fail in v5.0.0

Comments:
cc @LysandreJik ! 

It seems like the fact it was importable from `transformers` was a happy byproduct of the Flax/TF files (it was importable from the `utils.dummy_flax_objects`).

I'm adding it as a well-defined importable here: https://github.com/huggingface/transformers/pull/42799

Thanks for your help！
Add requires_backends to the main init
Author: LysandreJik
Pull request: yes

Fixes https://github.com/huggingface/transformers/issues/42778

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

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=42799&sha=fda296
validate tokenizer components
Author: itazap
Pull request: yes

check if the tokenizer object in `tokenizer.json` that is being loaded is actually matching that of mapped tokenizer in TOKENIZER_MAPPINGS in `tokenization_auto.py` 

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

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=42816&sha=ca3742
Fix deepspeed sp loss due to missing labels 
Author: SunMarc
Pull request: yes

# What does this PR do?

This PR fixes `_deepspeed_sp_compute_loss`. [UlyssesSPDataLoaderAdapter](https://github.com/deepspeedai/DeepSpeed/blob/6eb98aaf03419d1a3a608b0955eb3eae5ad2dc27/deepspeed/runtime/sequence_parallel/ulysses_sp.py#L598) took `labels` out from `inputs` while inserting `shift_labels` so it doesn't compute the `loss` at all since we didn't pass `labels` ...

Fixes https://github.com/huggingface/transformers/pull/42444#issuecomment-3639642523

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

currently looking at deepspeed side
Fixes for the failures of AMD CI
Author: remi-or
Pull request: yes

This PR fixes the following:
- multiple devices errors for `blt`, `efficientnet`, `ernie` and `mimi`
- added a synchronization to fix a `test_multi_gpu_data_parallel_forward` that failed with `align`
- removed the requirement that `timm` should be version `<=.19` because there are some new models that are not supported by this version. The real requirement should have been version `>.19` (https://github.com/huggingface/transformers/pull/39640)

This reduces the number of fails on the AMD CI by a lot (~150 I think)

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

run-slow: align, blt, efficientnet, ernie, mimi

This comment contains `run-slow`, running the specified jobs: 

models: ["models/align", "models/blt", "models/efficientnet", "models/ernie", "models/mimi"]
quantizations: []

## CI Results
[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/20142585601)

### Model CI Report

#### ❌ Failed tests

- [ernie](https://github.com/huggingface/transformers/actions/runs/20142585601/job/57814765641):
    tests/models/ernie/test_modeling_ernie.py::ErnieModelTest::test_cpu_offload
    tests/models/ernie/test_modeling_ernie.py::ErnieModelTest::test_disk_offload_bin
    tests/models/ernie/test_modeling_ernie.py::ErnieModelTest::test_disk_offload_safetensors



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

run-slow: align, blt, efficientnet, ernie, mimi

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=42718&sha=dcee3e
Fix a typo in MoE models
Author: zucchini-nlp
Pull request: yes

# What does this PR do?

As per title, reported by glm-authors. Can be tested with `tests/models/deepseek_v3/test_modeling_deepseek_v3.py::DeepseekV3IntegrationTest::test_compile_static_cache`, not failing with mismatch shape anymore

Comments:
run-slow: mixtral, deepseek_v3, glm4_moe, glm4v_moe, dots1

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

run-slow: deepseek_v3, dots1, glm4_moe, glm4v_moe

This comment contains `run-slow`, running the specified jobs: 

models: ["models/deepseek_v3", "models/dots1", "models/glm4_moe", "models/glm4v_moe", "models/mixtral"]
quantizations: []

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

## CI Results
[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/20164565766)

### Model CI Report

#### ❌ Failed tests

- [glm4v_moe](https://github.com/huggingface/transformers/actions/runs/20164565766/job/57885292637):
    tests/models/glm4v_moe/test_modeling_glm4v_moe.py::Glm4vMoeModelTest::test_disk_offload_bin
    tests/models/glm4v_moe/test_modeling_glm4v_moe.py::Glm4vMoeModelTest::test_disk_offload_safetensors
Simplify dtype instantiation
Author: Cyrilvallez
Pull request: yes

# What does this PR do?

As per the title. Cleanu-up a bit after https://github.com/huggingface/transformers/pull/42805 and in general

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

I did, it's [here](https://github.com/huggingface/transformers/pull/42825/files#diff-6b72b98c4c2dcfc6cc606843917733f5d858374fbc22a735ff483bbc0c1e63eaL801-R810) haha
Add inputs_to_logits_ratio to LasrCTCConfig
Author: kho
Pull request: yes

# What does this PR do?

This PR adds inputs_to_logits_ratio to LasrCTCConfig so that LasrForCTC can be used in an ASR pipeline with chunked decoding.

## 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.
- [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?


Comments:
@eustlb `make fixup` is not yet passing due to `hop_length` not being used in modelling code.

Unfortunately this will break decoding with LM. Perhaps we should just hardcode hop_length to a fixed value for now in LasrFeatureExtractor?

@eustlb I created https://github.com/huggingface/transformers/pull/42782 as a Plan B. What do you think?

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

run-slow: lasr

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_42720). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Add PyTorch Tensor Support to ASTFeatureExtractor (1D + 2D batch, device-preserving fbank)
Author: anaslari23
Pull request: yes
Labels: name: Code agent slop

## AST Feature Extractor – Add PyTorch Tensor Support

This PR updates `ASTFeatureExtractor` to accept and correctly process PyTorch
Tensors as inputs. The extractor now supports both single 1D tensors and 2D
batched tensors (`[Batch, Length]`) while preserving device placement and
enabling GPU execution of `ta_kaldi.fbank`.

---

## Changes

### 1. __call__ Method
- Added explicit torch.Tensor input detection.
- 1D tensor → treated as a single waveform.
- 2D tensor (batch) → split into individual 1D tensors.
- Tensors remain on their original device (CPU or CUDA).
- Existing NumPy/list input logic remains unchanged.

### 2. _extract_fbank_features Method
- Accepts both Tensors and NumPy arrays.
- Tensors are passed directly to `ta_kaldi.fbank` without numpy conversion.
- Avoids `.cpu().numpy()` unless explicitly required.
- Returns Tensors when the input was a Tensor or when `return_tensors="pt"`.
- NumPy fallback path remains identical for backward compatibility.

---

## Verification

### Automated Verification (using repro_ast_tensor.py)

Tested three core scenarios:

- 1D tensor input → success.
- 2D batched tensor input → success.
- NumPy/list legacy inputs → unchanged behavior.

Observed output shapes:

- 1D Tensor → `torch.Size([1, 1024, 128])`
- 2D Tensor Batch → `torch.Size([2, 1024, 128])`
- NumPy List → `torch.Size([2, 1024, 128])`

### Regression Testing

Ran:
`pytest tests/models/audio_spectrogram_transformer/test_feature_extraction_audio_spectrogram_transformer.py`

- 33 tests passed successfully.
- 2 unrelated failures due to missing datasets library (not caused by this change).

---

## Notes

- This change should be fully backward compatible for all NumPy users.
- GPU tensor support unlocks much faster preprocessing and eliminates unnecessary CPU transfers.
- This PR aligns `ASTFeatureExtractor` behavior with other HF feature extractors such as Wav2Vec2 and Whisper.

---

Fixes: #42821

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

run-slow: audio_spectrogram_transformer