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

feat(integrations): add usage metrics and table logging to OpenAI autologger #5521

Merged
merged 37 commits into from Jun 2, 2023

Conversation

parambharat
Copy link
Contributor

@parambharat parambharat commented May 10, 2023

Description

🤖 Generated by Copilot at 68189f9

This pull request adds usage metrics and stats table logging for OpenAI requests and responses in wandb/integration/openai/resolver.py. It also updates and adds yea tests for the OpenAI integration scripts in tests/functional_tests/t0_main/openai/, and renames some of the scripts to make them consistent.

Sample test run:
https://wandb.ai/dimaduev/openai_logging/runs/s9ko6mbs?workspace=user-dimaduev

Testing

How was this PR tested?

Checklist

  • Include reference to internal ticket "Fixes WB-NNNN" and/or GitHub issue "Fixes #NNNN" (if applicable)
  • Ensure PR title compliance with the conventional commits standards

🤖 Generated by Copilot at 3657255

Oh we're the coders of the open sea
We log our traces with openai_autolog
We heave and ho and refactor our code
To get the metrics from the resolver node

@github-actions github-actions bot added cc-feat and removed cc-feat labels May 10, 2023
Bharat Ramanathan added 2 commits May 10, 2023 11:44
# Conflicts:
#	wandb/integration/openai/openai.py
#	wandb/integration/openai/resolver.py
@dmitryduev dmitryduev added this to the sdk-2023-06.1 milestone May 10, 2023
wandb/integration/openai/resolver.py Outdated Show resolved Hide resolved
wandb/integration/openai/resolver.py Outdated Show resolved Hide resolved
wandb/integration/openai/resolver.py Outdated Show resolved Hide resolved
wandb/integration/openai/resolver.py Outdated Show resolved Hide resolved
wandb/sdk/integration_utils/llm.py Outdated Show resolved Hide resolved
wandb/integration/openai/resolver.py Outdated Show resolved Hide resolved
ash0ts and others added 6 commits May 11, 2023 02:17
…ic autolog monkey patch to accommodate requests that come from args/kwargs and adjust response to allow for a dictionary of wandb allowable media types or metrics for various packages or APIs.

This commit refactors the autologging classes PatchLLMAPI and AutologLLMAPI to PatchAPI and AutologAPI, respectively. Additionally, the argument resolver protocol RequestResponseResolver is changed to ArgumentResponseResolver. The request parameter is changed to args and kwargs, and the response parameter is changed to a dictionary of wandb media objects or metrics. This makes the code more concise and easier to understand.
… clarity and readability of the autologging module.
@dmitryduev dmitryduev requested review from a team and removed request for raubitsj and kptkin May 11, 2023 20:49
ash0ts and others added 4 commits May 11, 2023 23:57
…ample_method and SampleClass

- Use sample_method and SampleClass for testing
- Test enabling and disabling autologging API
- Test patching and logging for sample_method and SampleClass.sample_class_method
- Test argument and response resolver functionality
@parambharat parambharat marked this pull request as ready for review May 26, 2023 05:20
@raubitsj raubitsj requested a review from dmitryduev May 30, 2023 16:56
@parambharat parambharat requested a review from raubitsj May 31, 2023 01:21
@github-actions github-actions bot added cc-feat and removed cc-feat labels Jun 1, 2023
@github-actions github-actions bot added cc-feat and removed cc-feat labels Jun 1, 2023
@dmitryduev dmitryduev changed the title feat(integrations): Add metrics and table logging to openai logger feat(integrations): add usage metrics and table logging to OpenAI autologger Jun 2, 2023
@github-actions github-actions bot added cc-feat and removed cc-feat labels Jun 2, 2023
@dmitryduev dmitryduev enabled auto-merge (squash) June 2, 2023 03:35
@dmitryduev dmitryduev merged commit 427b736 into main Jun 2, 2023
51 of 52 checks passed
@dmitryduev dmitryduev deleted the openai/track-metrics branch June 2, 2023 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants