From 4e21063602c7e7439497a9c992844545c5a70429 Mon Sep 17 00:00:00 2001 From: krisztian-gajdar Date: Mon, 19 Oct 2026 12:43:38 +0200 Subject: [PATCH] fix(server): load snowflake-arctic-embed-m-v2.0 without xformers 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. --- .../models/Snowflake__snowflake-arctic-embed-m-v2.0.yaml | 5 ++++- packages/sie_server/tests/test_all_models.py | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/sie_server/models/Snowflake__snowflake-arctic-embed-m-v2.0.yaml b/packages/sie_server/models/Snowflake__snowflake-arctic-embed-m-v2.0.yaml index fb385b386..a82d8bf44 100644 --- a/packages/sie_server/models/Snowflake__snowflake-arctic-embed-m-v2.0.yaml +++ b/packages/sie_server/models/Snowflake__snowflake-arctic-embed-m-v2.0.yaml @@ -21,7 +21,10 @@ profiles: compute_precision: null adapter_path: sie_server.adapters.sentence_transformer:SentenceTransformerDenseAdapter adapter_options: - loadtime: {} + loadtime: + config_kwargs: + use_memory_efficient_attention: false + unpad_inputs: false runtime: pooling: cls normalize: true diff --git a/packages/sie_server/tests/test_all_models.py b/packages/sie_server/tests/test_all_models.py index 2a23c2087..a92b038be 100644 --- a/packages/sie_server/tests/test_all_models.py +++ b/packages/sie_server/tests/test_all_models.py @@ -340,9 +340,10 @@ def test_salesforce_sfr_embedding_mistral_dense() -> None: _assert_dense("Salesforce/SFR-Embedding-Mistral", 4096, None) -@pytest.mark.xfail(reason="Snowflake model custom code requires xformers", strict=False) def test_snowflake_snowflake_arctic_embed_m_v2_0_dense() -> None: - _assert_dense("Snowflake/snowflake-arctic-embed-m-v2.0", 768, None) + _assert_dense( + "Snowflake/snowflake-arctic-embed-m-v2.0", 768, [-0.059539794921875, 0.0238189697265625, -0.069580078125] + ) def test_sentence_transformers_all_minilm_l6_v2_dense() -> None: