refactor: streamline tensor initialization and rearrange struct fields for clarity#869
Open
Unmesh100 wants to merge 1 commit into
Open
refactor: streamline tensor initialization and rearrange struct fields for clarity#869Unmesh100 wants to merge 1 commit into
Unmesh100 wants to merge 1 commit into
Conversation
Unmesh100
commented
May 26, 2026
- Bug 1 (softmax fix): The change is trivial - removing .abs() on both sides. This is a standard softmax numerical stability fix. Compilation passes with cargo check -p text-embeddings-router which includes the core crate. No behavioral tests needed for this - it's a well-understood mathematical correction.
- Bug 2 (Qwen3 CLS pooling): The change removes an incorrect conditional branch that was selecting diagonal elements. Now it always selects column 0 (CLS token). Compilation passes. The existing snapshot tests in backends/candle/tests/test_qwen3.rs would catch any major regression in Qwen3 embeddings, but they download models from HuggingFace which is not feasible here.
- Bug 3 (shutdown deadlock): The field reordering is a zero-behavior-change fix (same fields, just different drop order). cargo check and cargo test --no-run both compile successfully with the new field order.
Author
|
@Narsil can you please review it, thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.