Skip to content

Fix Bamba synthetic parity CI tolerance - #476

Merged
justinchuby merged 1 commit into
mainfrom
justinchuby/fix-bamba-synthetic-tolerance
Aug 11, 2026
Merged

justinchuby merged 1 commit into
mainfrom
justinchuby/fix-bamba-synthetic-tolerance

Conversation

@justinchuby

Copy link
Copy Markdown
Member

Summary

  • add a Bamba-specific atol=0.002 override for L3 synthetic parity
  • document the stable hybrid Mamba2/attention floating-point accumulation difference
  • preserve the existing argmax and cosine correctness gates

Root cause

Both deterministic Bamba seeds exceed the generic 1e-3 threshold under the CI dependency set:

Seed Max abs diff Cosine Argmax
0 0.001375 0.999997 match
1 0.001662 0.999996 match

The same failures occur on unrelated PRs, confirming this is a baseline tolerance issue rather than a model change regression.

Validation

  • pytest tests/synthetic_parity_test.py -q --models bamba --tb=short: 2 passed, 201 skipped
  • reproduced the exact CI failures before the change

Account for the stable floating-point accumulation difference between the Hugging Face and ONNX hybrid Mamba2/attention paths while retaining exact argmax and high-cosine correctness gates.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 11, 2026 04:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the L3 synthetic parity test tolerances to stop baseline CI failures for the Bamba model type by adding a small per-model atol override, while documenting the underlying floating-point accumulation differences observed versus HuggingFace.

Changes:

  • Add a Bamba-specific atol=0.002 entry to _ATOL_OVERRIDES for L3 synthetic parity.
  • Document the observed max-abs-diff and cosine behavior for deterministic Bamba seeds in CI.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +111 to +113
# Bamba's hybrid Mamba2 + attention path differs slightly in FP accumulation
# order from HuggingFace. Both deterministic seeds keep the same argmax and
# cosine >= 0.999996 with max absolute error below 0.0017.
@github-actions

Copy link
Copy Markdown

Performance Comparison

Comparing 78437cd → ae5e987

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0% ⚪
bert (feature-extraction) num_nodes 60 60 +0.0% ⚪
falcon model_size_bytes 364 KB 364 KB +0.0% ⚪
falcon num_nodes 68 68 +0.0% ⚪
gemma2 model_size_bytes 428 KB 428 KB +0.0% ⚪
gemma2 num_nodes 107 107 +0.0% ⚪
gpt2 model_size_bytes 388 KB 388 KB +0.0% ⚪
gpt2 num_nodes 54 54 +0.0% ⚪
llama model_size_bytes 425 KB 425 KB +0.0% ⚪
llama num_nodes 62 62 +0.0% ⚪
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
llama (static-cache) num_nodes 58 58 +0.0% ⚪
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0% ⚪
mamba (ssm-text-generation) num_nodes 98 98 +0.0% ⚪
phi3 model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 num_nodes 60 60 +0.0% ⚪
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 (static-cache) num_nodes 56 56 +0.0% ⚪
qwen2 model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 num_nodes 62 62 +0.0% ⚪
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 (static-cache) num_nodes 58 58 +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) num_nodes 275 275 +0.0% ⚪
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0% ⚪
qwen3_5_text (hybrid-text-generation) num_nodes 129 129 +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) num_nodes 431 431 +0.0% ⚪
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0% ⚪
t5 (seq2seq) num_nodes 166 166 +0.0% ⚪
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0% ⚪
whisper (speech-to-text) num_nodes 128 128 +0.0% ⚪

No performance regressions.

@justinchuby
justinchuby merged commit f57f294 into main Aug 11, 2026
22 of 23 checks passed
@justinchuby
justinchuby deleted the justinchuby/fix-bamba-synthetic-tolerance branch August 11, 2026 14:49
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