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 fixture for an LLM #674

Merged

Conversation

riedgar-ms
Copy link
Collaborator

@riedgar-ms riedgar-ms commented Mar 5, 2024

Add a selected_model fixture which can provide any test with a 'live' LLM (as opposed to models.Mock()). This fixture is controlled by adding --selected_model <name> to the invocation of pytest. If no model is specified on the command line, then a CPU-based GPT2 model will be provided. The valid values for <name> are the keys of the AVAILABLE_MODELS dictionary.

A few of the tests are XFAILED for Phi-2 only, pending this issue:
https://huggingface.co/microsoft/phi-2/discussions/116

This was referenced Mar 7, 2024
@riedgar-ms riedgar-ms changed the title Add fixture for transformer models Add fixture for an LLM Mar 11, 2024
Add in fixture

Comment on those not working with Phi2

Switch to fixture

Switch to fixtures

Can use pytest parameterisation...

Switching to command line based fixture

More switching

Convert others

Explanatory note
@riedgar-ms riedgar-ms force-pushed the riedgar-ms/transformer-model-fixture-01 branch from 5446660 to 85fe42f Compare March 11, 2024 14:30
@riedgar-ms
Copy link
Collaborator Author

When we have the GPU runner machines available, we can start expanding the AVAILABLE_MODELS dictionary, and have a separate test matrix for those tests & machines.

Comment on lines +43 to +44
if model_type == "PhiForCausalLM":
pytest.xfail("See https://github.com/guidance-ai/guidance/issues/681")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice use of xfail for conditional failures that come from upstream sources

@Harsha-Nori
Copy link
Collaborator

LGTM once tests pass

@slundberg
Copy link
Contributor

Also LGTM. Thanks @riedgar-ms !

@slundberg slundberg merged commit 0bb6551 into guidance-ai:main Mar 14, 2024
35 checks passed
@riedgar-ms riedgar-ms deleted the riedgar-ms/transformer-model-fixture-01 branch March 27, 2024 11: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

3 participants