Skip to content

fix(server): load snowflake-arctic-embed-m-v2.0 without xformers - #813

Merged
krisztian-gajdar merged 1 commit into
mainfrom
fix/arctic-embed-m-v2-attention
Oct 19, 2026
Merged

krisztian-gajdar merged 1 commit into
mainfrom
fix/arctic-embed-m-v2-attention

Conversation

@krisztian-gajdar

@krisztian-gajdar krisztian-gajdar commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Snowflake/snowflake-arctic-embed-m-v2.0 does not load in the published 0.10.1 cuda12-default image. It fails with AssertionError: please install xformers, and the compatibility matrix for 0.10.1 records the profile as unsupported for this reason.

Cause. The checkpoint ships its own GTE modeling code, and its config.json sets use_memory_efficient_attention and unpad_inputs to "true". With those settings the code builds its attention on xformers.ops.memory_efficient_attention and asserts that xformers is importable. The server images do not ship xformers. The same failure happens on CPU, so the cause is in the profile, not the GPU.

Fix. The profile now passes config_kwargs with both settings off. NovaSearch/stella_en_400M_v5 already does this for the same attention code. The remote code then uses its exact eager/SDPA attention over padded inputs. No image dependency changes. Adding xformers to the images would add a CUDA-only, torch-version-coupled package to every default-lane image for one model.

Class sweep. I fetched config.json at the pinned revision for every catalog checkpoint, 213 in all. 36 have no config.json (GLiNER-style checkpoints) or are gated, and none of those use this modeling code. Exactly two checkpoints turn on memory-efficient attention:

  • NovaSearch/stella_en_400M_v5, which already turns it off.
  • This model, which this PR fixes.

Validation.

  • Real path: test_all_models.py::test_snowflake_snowflake_arctic_embed_m_v2_0_dense loads the real checkpoint through load_model_configs and load_adapter on CPU. Before the change it fails with AssertionError: please install xformers, as the image does. With the change it loads and encodes. The test now pins the first output values instead of being marked as an expected failure.
  • Output parity: through the same adapter, the model card's example (what is snowflake? against The Data Cloud! and Mexico City of Course!) scores 0.327198 and 0.069602. The model card's published reference is 0.32719788 and 0.06960141.
  • GPU parity: on an H100 with torch 2.9.1, transformers 4.57.6, sentence-transformers 5.7.0 and xformers installed, I encoded 24 texts of mixed lengths twice. The first run used the checkpoint's own settings, which select the xformers attention class with unpadded inputs. The second used this profile's settings, which select the SDPA class with padded inputs. The two sets of normalized embeddings are identical: the maximum absolute difference is 0.0 and the minimum cosine is 1.0 to float32 precision.
  • The packages/sie_server/tests/config suite passes. Ruff and ruff format pass.

The checkpoint's config turns on the remote code's xformers memory-efficient
attention and unpadded inputs, and the remote code asserts that xformers is
installed. The CUDA images do not ship xformers, so the model failed to load
with "please install xformers".

Load it with use_memory_efficient_attention and unpad_inputs turned off,
the same config_kwargs stella_en_400M_v5 already uses for the same
attention code. The remote code then runs exact attention over padded
inputs, and its cosine scores for the model card's example match the
published reference (0.327198 and 0.069602 against 0.327198 and 0.069601).

The real-weight test now pins the model's output instead of expecting it to
fail.
@krisztian-gajdar
krisztian-gajdar requested a review from a team as a code owner October 19, 2026 10:43
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 454195ee-6d57-4bee-8c6d-221a76e470bf
📥 Commits

Reviewing files that changed from the base of the PR and between 3186eb0 and 4e21063.

📒 Files selected for processing: 2
  • packages/sie_server/models/Snowflake__snowflake-arctic-embed-m-v2.0.yaml
  • packages/sie_server/tests/test_all_models.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Walkthrough

The Snowflake Arctic Embed M v2.0 default profile disables memory-efficient attention and input unpadding. Its dense-model test now checks three expected output values and no longer has an expected-failure marker.

Changes: Snowflake Arctic Embed M v2.0

Layer / File(s) Summary
Model configuration and dense-output test
packages/sie_server/models/Snowflake__snowflake-arctic-embed-m-v2.0.yaml, packages/sie_server/tests/test_all_models.py
The default profile disables memory-efficient attention and input unpadding. The dense-model test removes its expected-failure marker and checks three output values.

Suggested reviewers: svonava

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 4e210

The profile disables the xformers-dependent path, and the CPU dense-model test exercises that configuration. No identified issue prevents merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: loading Snowflake Arctic Embed M v2.0 without requiring xformers.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@krisztian-gajdar
krisztian-gajdar merged commit c03b06c into main Oct 19, 2026
45 checks passed
@krisztian-gajdar
krisztian-gajdar deleted the fix/arctic-embed-m-v2-attention branch October 19, 2026 11:33
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