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

Add inference api eval wrapper #494

Merged
merged 75 commits into from
Sep 18, 2023
Merged

Add inference api eval wrapper #494

merged 75 commits into from
Sep 18, 2023

Conversation

bmosaicml
Copy link
Contributor

@bmosaicml bmosaicml commented Jul 31, 2023

This PR creates an inference API wrapper interface for eval. It also provides two concrete instantiations of the interface for both OpenAI chat models and regular OpenAI models. The current version works only for LM tasks. In the future we can support QA tasks and CodeGen. We CANNOT support multiple choice tasks, because the models don't return the full logits.

This interface is also the basis for Nikhil's Mosaic faster transformer inference eval PR #558

Test OpenAI APIs: openai-eval-leLuzi openai-eval-qUWZVI
Test HF models not broken: all-eval-WxT9fe

| model_name               |   average |   world_knowledge |   commonsense_reasoning |   language_understanding |   symbolic_problem_solving |   reading_comprehension |   world_knowledge_lm_task_subscore |   language_understanding_lm_task_subscore |   symbolic_problem_solving_lm_task_subscore |   reading_comprehension_lm_task_subscore |   world_knowledge_lite |   commonsense_reasoning_lite |   language_understanding_lite |   symbolic_problem_solving_lite |   reading_comprehension_lite |
|:-------------------------|----------:|------------------:|------------------------:|-------------------------:|---------------------------:|------------------------:|-----------------------------------:|------------------------------------------:|--------------------------------------------:|-----------------------------------------:|-----------------------:|-----------------------------:|------------------------------:|--------------------------------:|-----------------------------:|
| mosaicml/mpt-7b-instruct |  0.434033 |          0.398764 |                0.415097 |                 0.371509 |                   0.171216 |                0.414691 |                           0.576308 |                                  0.378966 |                                    0.273182 |                                 0.588472 |               0.376383 |                     0.636311 |                      0.692063 |                        0.195028 |                     0.588472 |
| model_name           |   average | world_knowledge   | commonsense_reasoning   | language_understanding   | symbolic_problem_solving   | reading_comprehension   |   world_knowledge_lm_task_subscore |   language_understanding_lm_task_subscore |   symbolic_problem_solving_lm_task_subscore |   reading_comprehension_lm_task_subscore | world_knowledge_lite   | commonsense_reasoning_lite   | language_understanding_lite   | symbolic_problem_solving_lite   |   reading_comprehension_lite |
|:---------------------|----------:|:------------------|:------------------------|:-------------------------|:---------------------------|:------------------------|-----------------------------------:|------------------------------------------:|--------------------------------------------:|-----------------------------------------:|:-----------------------|:-----------------------------|:------------------------------|:--------------------------------|-----------------------------:|
| openai/gpt-4         |  0.683983 |                   |                         |                          |                            |                         |                           0.656461 |                                  0.577393 |                                    0.843193 |                                 0.671434 |                        |                              |                               |                                 |                     0.671434 |
| openai/gpt-3.5-turbo |  0.529258 |                   |                         |                          |                            |                         |                           0.630127 |                                  0.456013 |                                    0.701307 |                                 0.429421 |                        |                              |                               |                                 |                     0.429421 |
| openai/davinci       |  0.475937 |                   |                         |                          |                            |                         |                           0.625064 |                                  0.439049 |                                    0.276832 |                                 0.519369 |                        |                              |                               |                                 |                     0.519369 |
| openai/ada           |  0.281576 |                   |                         |                          |                            |                         |                           0.283446 |                                  0.272376 |                                    0.156899 |                                 0.347579 |                        |                              |                               |                                 |                     0.347579 |

tests/test_inference_api_eval_wrapper.py Outdated Show resolved Hide resolved
llmfoundry/models/inference_api_wrapper/interface.py Outdated Show resolved Hide resolved
llmfoundry/models/inference_api_wrapper/interface.py Outdated Show resolved Hide resolved
llmfoundry/models/inference_api_wrapper/interface.py Outdated Show resolved Hide resolved
bmosaicml and others added 8 commits September 15, 2023 15:19
Co-authored-by: Daniel King <43149077+dakinggg@users.noreply.github.com>
Co-authored-by: Daniel King <43149077+dakinggg@users.noreply.github.com>
Co-authored-by: Daniel King <43149077+dakinggg@users.noreply.github.com>
tests/test_inference_api_eval_wrapper.py Show resolved Hide resolved
tests/test_inference_api_eval_wrapper.py Show resolved Hide resolved
tests/test_inference_api_eval_wrapper.py Show resolved Hide resolved
@bmosaicml bmosaicml merged commit c369a68 into main Sep 18, 2023
7 of 8 checks passed
@dakinggg dakinggg deleted the add_openai_wrapper branch October 11, 2023 21:30
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.

None yet

2 participants