feat(reranker): detect Intel XPU for local cross-encoder acceleration#2328
Open
r266-tech wants to merge 1 commit into
Open
feat(reranker): detect Intel XPU for local cross-encoder acceleration#2328r266-tech wants to merge 1 commit into
r266-tech wants to merge 1 commit into
Conversation
Mirror the XPU device-detection block vectorize-io#2260 added to LocalSTEmbeddings into the byte-identical LocalSTCrossEncoder twin, so the local reranker also uses Intel Arc XPU instead of silently falling back to CPU. Guarded by hasattr(torch, 'xpu') + is_available(); no-op on CUDA/MPS/CPU.
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.
#2260 added Intel XPU device detection to
LocalSTEmbeddings.initialize()(embeddings.py) but the byte-identical sibling block inLocalSTCrossEncoder.initialize()(cross_encoder.py) was left untouched. On an Intel Arc box, embeddings now run on XPU while the local cross-encoder reranker silently falls back to CPU.This mirrors #2260 exactly into the cross-encoder: the XPU probe is guarded by
hasattr(torch, "xpu")+torch.xpu.is_available()inside the existing try/except, so it is a no-op on all current CUDA/MPS/CPU hardware and cannot regress them.Follow-up to #2260.