Skip to content

Honor singular device= as an alias for devices= (fixes #907)#1584

Open
MushiSenpai wants to merge 1 commit into
FlagOpen:masterfrom
MushiSenpai:fix/device-alias-907
Open

Honor singular device= as an alias for devices= (fixes #907)#1584
MushiSenpai wants to merge 1 commit into
FlagOpen:masterfrom
MushiSenpai:fix/device-alias-907

Conversation

@MushiSenpai

Copy link
Copy Markdown

Problem. device= (singular) is silently swallowed by **kwargs, leaving devices=None, so get_target_devices(None) returns every visible GPU and the model OOMs across all of them (#907). device= is the singular many users reach for (e.g. from sentence-transformers).
Fix. In AbsEmbedder.init / AbsReranker.init, alias device=→devices= (with a one-line warning) when devices isn't set. Backward-compatible; explicit devices= wins; no dead attribute leak.
Test. tests/test_device_alias.py — model-free (no weights, no GPU).
Closes #907.

Drafted with AI assistance (Claude); reviewed, tested, and submitted by me.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

bge-reranker-v2-m3模型不能指定部署在几个gpu卡上吗?

1 participant