Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refined semantics for Settings thread-safety #1947

Merged
merged 2 commits into from
Dec 17, 2024
Merged

Conversation

okhat
Copy link
Collaborator

@okhat okhat commented Dec 17, 2024

  1. Only one unique thread (which can be any thread!) can call dspy.configure.
  2. It affects a global state, visible to all. As a result, user threads work, but they shouldn't be mixed with concurrent changes to dspy.configure from the "main" thread. (In the future, one can add warnings for this, if there are near-in-time accesses to the configuration followed by .configure calls.)
  3. Any thread can use dspy.context. It propagates to child threads created with DSPy primitives: Parallel, asyncify, etc.

…an call dspy.configure and it affects a global state. Any thread can use dspy.context. It propagates to child threads created with DSPy primitives.
@okhat okhat merged commit e0907eb into main Dec 17, 2024
4 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.

1 participant