Skip to content

SWF(bug): return config error for bad gemma4 attention_pattern - #85

Merged
maplepaladin73 merged 1 commit into
mainfrom
devin/1795402217-gemma4-attention-pattern-error
Nov 23, 2026
Merged

maplepaladin73 merged 1 commit into
mainfrom
devin/1795402217-gemma4-attention-pattern-error

Conversation

@maplepaladin73

@maplepaladin73 maplepaladin73 commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Malformed Gemma-4 text_config.attention_pattern entries now return a config error through parse_config instead of panicking.

Root cause: parse_gemma4_params used panic! for an unknown attention-pattern string. That path is reachable from normal config loading, so one bad checkpoint value could abort the process rather than fail config parsing.

Test plan

Try it (CPU):

ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo test -p atlas-core --lib gemma4 -- --nocapture
  • Before: gemma4_rejects_unknown_attention_pattern_entry panicked through parse_config at crates/atlas-core/src/config/parsers/gemma4.rs:75 with Unknown Gemma-4 attention_pattern entry: 'not_an_attention_kind'.
  • After: gemma4 tests → 3 passed; full cargo test -p atlas-core --lib → 260 passed; 0 failed.
  • cargo fmt --all -- --check
  • ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --tests
  • bash scripts/check-license-headers.sh, typos
  • Added regression test through the public parse_config path.
  • Untested: live model load / GPU validation (parser-only CPU change).

Notes for reviewers

The fix only replaces the confirmed panic path with an anyhow error; valid Gemma-4 attention patterns are unchanged. I kept the existing non-string fallback (unwrap_or("full_attention")) because local history shows it was present when the parser landed and there is no evidence it is a bug.

CLA


Software Factory opened this PR for Robert
Implemented in session Return config error for bad gemma4 attention_pattern
Review with Devin · Open in Devin Desktop


Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@maplepaladin73
maplepaladin73 merged commit 16b3c6c into main Nov 23, 2026
1 check passed
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.

1 participant