Skip to content

fix: MPS device support in BERTScorer#2646

Merged
penguine-ip merged 1 commit into
confident-ai:mainfrom
markd88:fix/mps-device-bert-scorer
May 12, 2026
Merged

fix: MPS device support in BERTScorer#2646
penguine-ip merged 1 commit into
confident-ai:mainfrom
markd88:fix/mps-device-bert-scorer

Conversation

@markd88

@markd88 markd88 commented May 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add Apple Silicon MPS backend detection in Scorer.bert_score() device selection
  • Previously only CUDA and CPU were considered, causing Mac users with Apple Silicon GPUs to unnecessarily fall back to CPU
  • Fixes the FIXME comment at deepeval/scorer/scorer.py:169

Changes

  • Device selection now checks torch.backends.mps.is_available() before falling back to CPU
  • Priority: CUDA → MPS → CPU

Testing

Verified end-to-end on Apple Silicon Mac:
Device selected: mps
BERTScorer with device="mps" → Precision: 0.8354, Recall: 0.8994, F1: 0.8672

First time contributor, happy to contribute!

Add Apple Silicon MPS backend detection in bert_score device selection.
Previously only CUDA and CPU were considered, causing Mac users with
Apple Silicon GPUs to unnecessarily fall back to CPU.
@vercel

vercel Bot commented May 2, 2026

Copy link
Copy Markdown

@markd88 is attempting to deploy a commit to the Confident AI Team on Vercel.

A member of the Team first needs to authorize it.

@markd88 markd88 changed the title Fix MPS device support in BERTScorer fix: MPS device support in BERTScorer May 2, 2026
@penguine-ip

Copy link
Copy Markdown
Contributor

@markd88 thank you :)

@penguine-ip penguine-ip merged commit 3c53afe into confident-ai:main May 12, 2026
8 of 12 checks passed
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