Skip to content

[serge] Fix 2 integration tests for model cwm failing with import_or_config (other (2)) - #48414

Merged
tarekziade merged 2 commits into
mainfrom
serge/fix/itf-84012d9c363d-7d2063f7
Sep 1, 2026
Merged

tarekziade merged 2 commits into
mainfrom
serge/fix/itf-84012d9c363d-7d2063f7

Conversation

@sergereview

@sergereview sergereview Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

CPU CI GPU run-slow

Original CI failure

  • Failure group: 2 integration tests for model cwmfailing withimport_or_config (other (2))
  • tests/models/cwm/test_modeling_cwm.py::CwmIntegrationTest::test_cwm_integration [multi-gpu] (import_or_config, seen 7/7)
CI traceback — tests/models/cwm/test_modeling_cwm.py::CwmIntegrationTest::test_cwm_integration
(line 1967)  AttributeError: 'CwmDecoderLayer' object has no attribute 'attention_type'

Where to watch it:

Relates to #48413

CwmIntegrationTest::test_cwm_integration fails because CwmDecoderLayer has no attention_type attribute, yet the test asserts layer.attention_type == model.config.layer_types[i].

Root cause: CwmDecoderLayer in modular_cwm.py only replaces the attention module; it never stores the per-layer attention type from config.layer_types.

Fix: set self.attention_type = config.layer_types[layer_idx] in CwmDecoderLayer.__init__. make fix-repo will propagate this to the generated modeling_cwm.py.


✅ Verified on GPU

serge ran the targeted @slow test(s) on a GPU runner and opened this PR only after they passed with this patch. Each targeted test was run 5× on both the pre-patch and patched trees to rule out flakiness — the result held on every run.


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 · 30 LLM turns · 30 tool calls · 47.8s · 784337 in / 10025 out tokens

@sergereview
sergereview Bot marked this pull request as ready for review August 29, 2026 22:52
@github-actions
github-actions Bot requested a review from zucchini-nlp August 29, 2026 22:53
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@zucchini-nlp zucchini-nlp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was moved under CwmAttention.layer_type which we can use instead, and fix the test assertion

I really don't know how to ask Serge to re-do it, so cc @tarekziade

@tarekziade

Copy link
Copy Markdown
Collaborator

It was moved under CwmAttention.layer_type which we can use instead, and fix the test assertion

I really don't know how to ask Serge to re-do it, so cc @tarekziade

We can't ask for new edits for now, but that's a good idea I will add that feature. In the interim, fixing within the branch

@tarekziade

Copy link
Copy Markdown
Collaborator

run-slow: cwm

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

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

run-slow: cwm

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Workflow Run ⚙️

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

models: ["models/cwm"]
quantizations: []

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 33376462572:1
Result: success | Jobs: 8 | Tests: 379 | Failures: 0 | Duration: 4m 34s

@zucchini-nlp zucchini-nlp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep thanks

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

CI Results

Workflow Run ⚙️

Commit Info

Context Commit Description
RUN bfccd9ef workflow commit (merge commit)
PR 3323f777 branch commit (from PR)
main 8e35c981 base commit (on main)

✅ No failing test specific to this PR 🎉 👏 !

@tarekziade

tarekziade commented Sep 1, 2026 •

Copy link
Copy Markdown
Collaborator

worked, left failures on that model are OOMs we will address in another patch

@tarekziade
tarekziade added this pull request to the merge queue Sep 1, 2026
Merged via the queue into main with commit 49995e1 Sep 1, 2026
40 checks passed
@tarekziade
tarekziade deleted the serge/fix/itf-84012d9c363d-7d2063f7 branch September 1, 2026 12:38
sbucaille pushed a commit to sbucaille/transformers that referenced this pull request Sep 16, 2026
…or_config` (other (2)) (huggingface#48414)

* [serge] Fix 2 integration tests for model `cwm` failing with `import_or_config` (other (2))

* Use CwmAttention.layer_type instead of adding attention_type to the layer

---------

Co-authored-by: serge[bot] <serge[bot]@users.noreply.github.com>
Co-authored-by: Tarek Ziade <tarek@ziade.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants