Default CTranslate2 intra threads to 1 on macOS - #528
Open
jmpnop wants to merge 1 commit into
Open
Conversation
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.
Summary
Default
ARGOS_INTRA_THREADSto1on Darwin instead of0.This keeps the existing behavior on non-macOS platforms and still allows users to override the value explicitly with
ARGOS_INTRA_THREADS.Why
On macOS no-OpenMP CTranslate2 wheels,
intra_threads=0delegates to the backend default. In local testing with Argos Translate + CTranslate2 on macOS arm64, that backend auto-threading path fanned out into CPU worker pools and performed poorly for Argos' typical workload of many small paragraph/sentence translation batches.It also reproduced a native abort on CTranslate2 4.7.2 / Python 3.14.5:
The crash report showed:
Validation
Environment:
Benchmark on the same 30-unit Markdown slice:
Full sustained regression with
intra_threads=1:This makes
1a safer and faster Darwin default for the tested Argos workload while preserving explicit user control.