Skip to content

[serge] Fix 4 integration tests for model blt failing with import_or_config (other (4)) - #48534

Closed
sergereview[bot] wants to merge 2 commits into
mainfrom
serge/fix/itf-647bd432a9c4-4f8b7bd4
Closed

sergereview[bot] wants to merge 2 commits into
mainfrom
serge/fix/itf-647bd432a9c4-4f8b7bd4

Conversation

@sergereview

@sergereview sergereview Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

CPU CI GPU run-slow

Original CI failure

  • Failure group: 4 integration tests for model bltfailing withimport_or_config (other (4))
  • tests/models/blt/test_modeling_blt.py::BltIntegrationTest::test_model_logits [multi-gpu] (import_or_config, seen 6/7)
CI traceback — tests/models/blt/test_modeling_blt.py::BltIntegrationTest::test_model_logits
(line 312)  AttributeError: 'BltConfig' object has no attribute 'num_hidden_layers'

Where to watch it:

BLT integration tests fail with AttributeError: 'BltConfig' object has no attribute 'num_hidden_layers' when BltForCausalLM loads a checkpoint and the generation code accesses self.text_config.num_hidden_layers.

Root cause: BltForCausalLM.__init__ calls config.get_text_config(). The inherited PreTrainedConfig.get_text_config() only recognizes attributes named decoder, generator, or text_config; BltConfig stores its text-generation settings in decoder_config, so the method falls back to returning the top-level BltConfig, which lacks num_hidden_layers.

Fix: override get_text_config in BltConfig to return self.decoder_config, which is the correct text-output config for this composite model. This mirrors the pattern used by other composite configs in the library.

Relates to #48533

Possibly related

Existing issues/PRs mentioning test_model_logits (keyword match — not verified to share a root cause):

  • #47980 — [AXK1] Fix expected logits for CUDA A10G (PR, closed, updated 2026-08-14)
  • #47179 — Add Granite-swa and Granitemoe-swa model support (PR, closed, updated 2026-07-29)
  • #46867 — add_axk1 (PR, closed, updated 2026-07-23)
  • #47268 — Fix failing tests for zaya (PR, closed, updated 2026-07-23)
  • #47173 — Fix some failed test cases related with XPU Expectations (PR, closed, updated 2026-07-23)

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 · 45 LLM turns · 47 tool calls · 38.8s · 1458223 in / 3819 out tokens

@sergereview
sergereview Bot marked this pull request as ready for review September 4, 2026 22:38
@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.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

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

run-slow: blt

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 33926353117:1
Result: success | Jobs: 8 | Tests: 384 | Failures: 0 | Duration: 3m 35s

@tarekziade

Copy link
Copy Markdown
Collaborator

⚠️ Post-hoc GPU verification: not_fixed — closing, but the patch is partly right

This PR was opened without the GPU verify gate running. A serge deploy on 2026-09-04 shipped a stale values file that silently unset VERIFY_ON_GPU, so for three nightlies serge opened fix PRs without running the targeted @slow tests — and without the footer that would have said so either way. The configuration is restored; this is the retroactive verification.

Run: https://github.com/huggingface/transformers/actions/runs/34200468435
(serge-verify-caller.yml, baseline f62dc9bf vs this PR b6765a36, 5 runs per tree, plus the full tests/models/blt slow suite on both trees.)

baseline f62dc9bf this PR b6765a36
BltIntegrationTest::test_model_logits failed failed
new failures in tests/models/blt — 0

What changed, and what did not

The reported failure is addressed. The test no longer raises:

AttributeError: 'BltConfig' object has no attribute 'num_hidden_layers'

The get_text_config() override and the num_hidden_layers default do what the PR body claims. The test then gets further and fails on something else:

E  RuntimeError: Expected all tensors to be on the same device, but got index is on cuda:0,
   different from other tensors on cuda:1 (when checking argument in method wrapper_CUDA__index_select)
   torch/nn/functional.py:2615

That is a device-placement problem in multi-GPU sharding, not a config-resolution one — a second, independent bug that the first was masking. Nothing in this patch regresses (0 collateral failures).

Closing because the targeted test is still red and an unverified patch should not sit in the review queue looking finished. The config fix itself looks worth keeping — if someone picks the blt group up, this branch is a reasonable starting point rather than a fresh start, and the remaining work is the cuda:0/cuda:1 index mismatch.

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.

2 participants