noamaanMulla-03/transformers-issues huggingface dataset:
Warn when `group_by_length` is silently ignored for iterable datasets
Author: qgallouedec
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47379)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47379)
<!-- ci-dashboard-badge:end -->

`train_sampling_strategy="group_by_length"` has no effect on datasets without `__len__` (e.g. `IterableDataset`): `_get_train_sampler` returns `None` early, and examples are consumed in the dataset's own order. This used to raise a `ValueError` (#15437), but the check was dropped in the sampler unification refactor (#43138), so it now fails silently.

This adds a warning on that path. No behavior change otherwise; a warning rather than restoring the error, since users relying on the current no-op shouldn't break.

Fixes the silent-no-op part of #32326; the feature request itself (buffer-based length grouping for streaming datasets) is out of scope here.

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

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47379)
**Latest run:** [29545629428:1](https://github.com/huggingface/transformers/actions/runs/29545629428)
**Result:** `success` | **Jobs:** 15 | **Tests:** 172,160 | **Failures:** 0 | **Duration:** 14h 20m

<!-- ci-dashboard-recap:end -->
Add LocateAnything
Author: molbap
Pull request: yes

# What does this PR do?

This PR adds support for [LocateAnything](https://huggingface.co/nvidia/LocateAnything-3B), I had to change a bit the conversion mapping for interleaved RoPE + fused qkv, with a new op `SplitQkvDeinterleaveRope` and its reverse. ~440 LoC modular, integration tests passing. However the MTP prediction/MagiAttention paths are not included in this release, it will be easier once we support MTP (i.e. when this is merged https://github.com/huggingface/transformers/pull/46229 )

detecting "remote":

<img width="640" height="480" alt="locateanything_detection" src="https://github.com/user-attachments/assets/e22e190c-0f09-4f45-8a20-73eb05ea69e8" />

Weights license is NVIDIA non-commercial. 

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

run-slow: auto, locateanything

**CI Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=46776)

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

Same as #46300?

I thought there was an issue of license of LocateAnything is it resolved?

r u guys still working on this?


@IMvision12 Interested in https://github.com/huggingface/transformers/pull/46300?
Deprecate CB config in gen configuration
Author: remi-or
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47291)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47291)
<!-- ci-dashboard-badge:end -->

This PR deprecates passing a `ContinuousBatchingConfig` through the `GenerationConfig` which is a different object: the generation config is model-centered while the CB config is hardware-centered. Closes #47039 .

Comments:
<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47291)
**Latest run:** [29227949669](https://github.com/huggingface/transformers/actions/runs/29227949669)
**Result:** `success` | Grafana metrics are not available yet.

<!-- ci-dashboard-recap:end -->

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_47291). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
[serge] Fix 8 integration tests for model `mamba2` failing with `OOM` (other (8))
Author: sergereview[bot]
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47380)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47380)
<!-- ci-dashboard-badge:end -->

## Original CI failure

- Failure group: `1/1: 8 integration tests for model `mamba2` failing with `OOM` (other (8))`
- `tests/models/mamba2/test_modeling_mamba2.py::Mamba2IntegrationTest::test_simple_generate` [multi-gpu] (OOM, seen 5/7)

<!-- serge-task:integration-failure-triage:sha256:7cbab94ba75927d89336ccc3b38d6f43445f08d56c8bff23c55a7a95cc96b8a0 -->
Relates to #47377

The mamba2 integration tests were failing with CUDA OOM. The test class never freed memory between tests, and the 7B model was loaded on CPU in full precision before being moved to the accelerator, creating a large memory peak. Sibling mamba-style tests (e.g. `falcon_mamba`) already use `cleanup()` in `setUp`/`tearDown` and load with `device_map=` to avoid this.

This patch:
- imports `cleanup` from `transformers.testing_utils`;
- extends the existing `setUp` to clear the accelerator cache and adds a `tearDown` that does the same;
- loads the pretrained model directly onto `torch_device` via `device_map=` instead of loading on CPU and calling `.to(torch_device)`.

Note: the normalizer's `modeling_rules_doc` and `docstrings` failures are unrelated to this change — they fail because of a missing `transformers.models.cosmos3_edge` module / `Cosmos3EdgeConfig` object, which is outside the scope of the mamba2 test file.

---
_This change was produced automatically by serge from a CI failure report. The patch was generated by an LLM and applied by serge; review before merging._

_serge `v0.1.0` · model: `moonshotai/Kimi-K2.7-Code` · 77 LLM turns · 76 tool calls · 264.8s · 2181526 in / 8870 out tokens_

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

run-slow: mamba2

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47380)
**Latest run:** [29550111675](https://github.com/huggingface/transformers/actions/runs/29550111675)
**Result:** `success` | Grafana metrics are not available yet.

<!-- ci-dashboard-recap:end -->

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_47380). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Fix hardcoded paths in siglip checkpoint/vocab loading
Author: XanxusCrypto
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47178)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47178)
<!-- ci-dashboard-badge:end -->

## What this fixes
Hardcoded `/Users/nielsrogge/Documents/...` local paths in 
`model_name_to_checkpoint` and `get_vocab_file_from_model_name`, 
which break the checkpoint download fallback for other users.

## Changes
- v1 checkpoint paths → official GCS URLs (all 8 verified accessible)
- vocab loading → `hf_hub_download` with `spiece.model`
- download logic now handles both `http://` URLs and HF Hub `org/repo/file` paths

## Verification
- All 8 GCS checkpoint URLs return valid responses
- `google/siglip-base-patch16-224` and `google/siglip-base-patch16-256-multilingual` confirmed on Hub with `spiece.model`

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

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

run-slow: siglip

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47178)
**Latest run:** [29253208557:2](https://github.com/huggingface/transformers/actions/runs/29259068971)
**Result:** `success` | **Jobs:** 1 | **Tests:** 6 | **Failures:** 0 | **Duration:** 11s

<!-- ci-dashboard-recap:end -->
CI: use transformers-ci daily workflow with OTEL
Author: tarekziade
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47360)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47360)
<!-- ci-dashboard-badge:end -->

# What does this PR do?

Switches the daily workflow to using `transformers-ci` workflow see https://github.com/huggingface/transformers-ci/blob/main/.github/workflows/daily-ci_reusable.yml

This workflow is also OTEL-ed and results are landing in https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-daily/daily?orgId=1&from=now-30d&to=now&timezone=browser

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

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47360)
**Latest run:** [29502874981:1](https://github.com/huggingface/transformers/actions/runs/29565966040)
**Result:** `success` | **Jobs:** 2 | **Tests:** 24 | **Failures:** 0 | **Duration:** 1m 44s

<!-- ci-dashboard-recap:end -->
Swin2SR image processor over-pads images when dimensions are already divisible by size_divisor
Author: arnavkewalram
Pull request: no

## System Info

```
- `transformers` version: 4.57.6
- Platform: macOS-26.5.1-arm64-arm-64bit
- Python version: 3.9.6
- PyTorch version: 2.8.0
- CUDA available: False
```

## Who can help?

@yonigozlan @molbap (vision models)

## Information

- [ ] The official example scripts
- [x] My own modified scripts

## Tasks

- [ ] An officially supported task in the `examples` folder
- [x] My own task or dataset (see details below)

## Reproduction

```python
from transformers import Swin2SRImageProcessor
from PIL import Image
import numpy as np

processor = Swin2SRImageProcessor()

# 1024 is divisible by 8 (the default size_divisor), so no padding should occur
img = Image.fromarray(np.zeros((1024, 1024, 3), dtype=np.uint8))
out = processor(img, return_tensors="pt")
print(out.pixel_values.shape)  # torch.Size([1, 3, 1032, 1032]) — should be [1, 3, 1024, 1024]
```

The root cause is in `image_processing_swin2sr.py` (lines 75–76) and `image_processing_pil_swin2sr.py` (lines 76–77):

```python
# current (wrong) — always pads by a full size_divisor even when already aligned
pad_height = (height // size_divisor + 1) * size_divisor - height
pad_width  = (width  // size_divisor + 1) * size_divisor - width
```

The `+ 1` forces an extra `size_divisor` of padding even when the dimension is already divisible. The model itself (`modeling_swin2sr.py`, line 747) uses the correct formula:

```python
modulo_pad_height = (window_size - height % window_size) % window_size
```

The test file uses the same wrong formula for expected values, so the tests pass silently.

## Expected behavior

For an image whose dimensions are already divisible by `size_divisor`, the processor should apply zero padding. For a 1024×1024 image with the default `size_divisor=8`, `out.pixel_values.shape` should be `torch.Size([1, 3, 1024, 1024])`, not `torch.Size([1, 3, 1032, 1032])`.

Comments:
Hi, I'd like to work on this. I'll submit a focused PR with the padding fix and regression tests.

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.
New RAG framework: VORTEXRAG — 7-layer causal RAG achieving EM 74.8, Faithfulness 0.94
Author: vignesh2027
Pull request: no

Hi Transformers team!

Sharing **VORTEXRAG** — a new RAG framework built on top of HuggingFace Transformers.

VORTEXRAG uses:
- **all-mpnet-base-v2** (sentence-transformers) for the 768d semantic arm
- **DeBERTa-v3-small** CrossEncoder for the Faithfulness Verifier (FV) layer
- spaCy + PropBank for syntactic/causal arms

The framework adds 7 layers of causal filtering on top of these models to eliminate semantic drift and context window poisoning.

**Results:** EM 74.8, F1 82.6, Faithfulness 0.94 across NQ/TriviaQA/WebQ/PopQA/HotpotQA/2WikiMH

Would love to know if there's a good way to contribute this to the HuggingFace ecosystem.

- GitHub: https://github.com/vignesh2027/VORTEXRAG  
- Paper: https://doi.org/10.5281/zenodo.20579702  
- HF Space: https://huggingface.co/spaces/vigneshwar234/VORTEXRAG

Comments:
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.
[WIP] PrismML Bonsai model support
Author: Qubitium
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=45157)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=45157)
<!-- ci-dashboard-badge:end -->

# What does this PR do?

Add PrismML 1bit (gguf based, group-size 128) model inference suppport.


## Code Agent Policy

- [ ] I confirm that this is not a pure code agent PR.

## 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?

Someone, just not yet. ..WIP

Comments:
Thank you for your contribution 🤗!

## CI Security Gate — automatic approval blocked

This PR was **not** automatically approved for CI because the security gate failed.

**Possible reasons:**
- The PR touches 50 or more files — only PRs with fewer than 50 changed files are automatically approved
- A changed file is outside the allowed directories (`src/`, `tests/`, `docs/`, `utils/`), has a disallowed extension (only `.py`, `.txt`, `.md` permitted outside `tests/` and `docs/`), or is not `.md`/`.yml` inside `docs/`
- A new high-severity security issue was detected in the changed Python files (Bandit check)

See the [workflow run](https://github.com/huggingface/transformers/actions/runs/29472760984) for the exact violations.

A maintainer can review and manually approve CI if a finding is a false positive.

cc @sunmarc

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

run-slow: ggml

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=45157)
**Latest run:** [29571866748](https://github.com/huggingface/transformers/actions/runs/29571866748)
**Result:** `failure` | Grafana metrics are not available yet.

> **Code quality check failed**: test jobs were skipped. Fix the code quality issues and push again to run tests.

<!-- ci-dashboard-recap:end -->
FSDP orchestration: apply + loading/saving
Author: 3outeille
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=46990)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=46990)
<!-- ci-dashboard-badge:end -->

## Summary

- FSDP:
   - Only 1 model for now has `base_fsdp_plan`. Will do another PR to edit every other models later
   - now wired through `from_pretrained` 
   - For FSDP: loading through `shard-on-Read` + saving like TP (DCP optional) 
   - Add FSDP Ci
   - DistributedMixin
- TP:
  - Wired `DistributedConfig` everywhere (no more tp_plan=`auto`)
  - TP left untouched (no Dtensor yet)

## Stack
- Based on #46717 (A-PR-3 dual-path loading)

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

run-slow: cohere2_moe, deepseek_v4, glm_moe_dsa, gpt_oss

[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/28637232684)

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

models: ["models/cohere2_moe", "models/deepseek_v4", "models/glm_moe_dsa", "models/gpt_oss"]
quantizations: []

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

### Commit Info
| Context | Commit | Description |
|---------|--------|-------------|
| RUN | [1bcc0fb0](https://github.com/huggingface/transformers/commit/1bcc0fb0b7af3aac27c20d49ca8f4b5c196673db) | workflow commit (merge commit) |
| PR | [37df13ee](https://github.com/huggingface/transformers/commit/37df13ee7bd6c37773eb394d53ea83933fbc11ff) | branch commit (from PR) |
| main | [70544cd9](https://github.com/huggingface/transformers/commit/70544cd9a60bb1e24df1fea15d0a738dabe030d8) | base commit (on `main`) |

⚠️ **Model CI failed to report results**

The test failure analysis could not be completed. Please check the [workflow run](https://github.com/huggingface/transformers/actions/runs/28637232684) for details.


flagging https://github.com/huggingface/transformers/pull/47253 for here

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

run-slow: cohere2_moe, deepseek_v4, glm_moe_dsa, gpt_oss

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=46990)
**Latest run:** [29395720891:1](https://github.com/huggingface/transformers/actions/runs/29395720891)
**Result:** `success` | **Jobs:** 16 | **Tests:** 169,443 | **Failures:** 0 | **Duration:** 14h 13m

<!-- ci-dashboard-recap:end -->

This PR has been split into 2 smaller stacked PRs (stack order #47352 → #47357) for easier review:

Closing this PR in favor of the stack above.
Add distributed runtime utils and DistributedMixin 
Author: 3outeille
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47352)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47352)
<!-- ci-dashboard-badge:end -->

## Summary

Part of FSDP orchestration stack (1/2). Replaces #46990.

- Add `distributed/utils.py` (mesh init, `distribute_model`)
- Add `DistributedMixin` with plan properties and orchestration hooks
- Extend `DistributedConfig` with deferred `validate()` and FSDP+TP guard
- Rename `apply_fully_sharded_data_parallel` → `apply_fully_sharded_data_parallelism` (torch>=2.7)
- Refactor `PreTrainedModel` to inherit `DistributedMixin` (plan properties moved out)
- Rename `distribute_model` → `apply_tensor_parallelism` in tensor_parallel.py
- Wire `prepare_distribute_model` / `maybe_distribute_model` into `from_pretrained`
-  Remove `tp_plan` / `tp_size` kwargs from `from_pretrained`; use `distributed_config=DistributedConfig(tp_size=N)` instead
- Migrate TP tests and docs to explicit `DistributedConfig`


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

run-slow: deepseek_v4, glm_moe_dsa, gpt_oss

[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/29475347625)

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

models: ["models/deepseek_v4", "models/glm_moe_dsa", "models/gpt_oss"]
quantizations: []

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

### Commit Info
| Context | Commit | Description |
|---------|--------|-------------|
| RUN | [c46c05f2](https://github.com/huggingface/transformers/commit/c46c05f2aa405ec61d32f9cdcc2f679433f2dd35) | workflow commit (merge commit) |
| PR | [eb9a081e](https://github.com/huggingface/transformers/commit/eb9a081e4e2cd85305800f4bd9929e9abd94d15f) | branch commit (from PR) |
| main | [28596623](https://github.com/huggingface/transformers/commit/28596623762cb409bb1c9234f04bfb1269b1ece1) | base commit (on `main`) |

⚠️ **Model CI failed to report results**

The test failure analysis could not be completed. Please check the [workflow run](https://github.com/huggingface/transformers/actions/runs/29475347625) for details.


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

run-slow: deepseek_v4, glm_moe_dsa, gpt_oss

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47352)
**Latest run:** [29505352463:1](https://github.com/huggingface/transformers/actions/runs/29505352463)
**Result:** `failure` | **Jobs:** 15 | **Tests:** 165,798 | **Failures:** 0 | **Duration:** 15h 30m

<!-- ci-dashboard-recap:end -->