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

chore(weave): add weave.finish #1696

Merged
merged 7 commits into from
Jun 4, 2024
Merged

chore(weave): add weave.finish #1696

merged 7 commits into from
Jun 4, 2024

Conversation

jwlee64
Copy link
Contributor

@jwlee64 jwlee64 commented May 30, 2024

internal jira
https://wandb.atlassian.net/browse/WB-18715

You can now stop tracing stuff with weave.finish()
Something like this now only traces the middle call
Screenshot 2024-05-30 at 9 41 05 AM

@jwlee64 jwlee64 requested a review from a team as a code owner May 30, 2024 16:38
@circle-job-mirror
Copy link

circle-job-mirror bot commented May 30, 2024

weave/api.py Outdated
# This is the stream-table backend. Disabling it in favor of the new
# trace-server backend.
# return _weave_init.init_wandb(project_name).client
# return _weave_init.init_trace_remote(project_name).client
return _weave_init.init_weave(project_name).client
_current_inited_client = _weave_init.init_weave(project_name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non blocking comment: can you share why the api.py layer is responsible for handling the _current_inited_client state? It seems like this might want to be part of weave_init.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no reasoning, it does make more sense to move that logic lower

@jwlee64 jwlee64 requested a review from tssweeney May 31, 2024 21:14
@@ -104,15 +106,16 @@ def init_weave(
entity_name, project_name, remote_server, ensure_project_exists
)

init_client = InitializedClient(client)
global _current_inited_client
_current_inited_client = InitializedClient(client)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be checking to see if _current_inited_client is already set? If it is, would that be something we should throw for?

Copy link
Contributor

@tssweeney tssweeney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - a few things (#1 is probably the main thing to consider):

  1. Can you add a test like the one in your PR description's screenshot
  2. See comment in weave/weave_init.py
  3. The stuff around because OpenAI calls are not logged in local mode currently might not be true anymore - it might be a nice followup to move these two calls to the correct locations.

@jwlee64 jwlee64 merged commit 7e83c26 into master Jun 4, 2024
24 checks passed
@jwlee64 jwlee64 deleted the weave-finish branch June 4, 2024 16:02
@github-actions github-actions bot locked and limited conversation to collaborators Jun 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants