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

⚙️ Fix Integration Test for TGI #124

Merged
merged 6 commits into from
Dec 5, 2024

Conversation

baptistecolle
Copy link
Collaborator

@baptistecolle baptistecolle commented Dec 2, 2024

What does this PR do?

Fixes broken TGI integration tests and adds Gemma model test

Changes

  • Fixed broken GPT-2 integration test suite
  • Added integration tests for Gemma model

Notes

This PR is currently not integrated with CI due to some issue with Docker-in-Docker (DinD) on the GitHub runners

@baptistecolle baptistecolle marked this pull request as ready for review December 2, 2024 15:32
Copy link
Collaborator

@tengomucho tengomucho left a comment

Choose a reason for hiding this comment

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

Nice, few nits, but overall it seems fine to me.
For GPT2, I wonder if it would be useful to pass the JETSTREAM_PT_DISABLED=1 env var, otherwise it will try to use jetstream first, and go to torch xla as fallback.


class LauncherHandle:
def __init__(self, port: int):
self.client = AsyncClient(f"http://localhost:{port}")
self.client = AsyncClient(f"http://localhost:{port}", timeout=600)
self.logger = logging.getLogger(self.__class__.__name__)
Copy link
Collaborator

Choose a reason for hiding this comment

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

note we use loguru elsewhere for logging

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Refactored with loguru

"LOG_LEVEL": "info,text_generation_router,text_generation_launcher=debug",
"MAX_BATCH_SIZE": "4",
"HF_HUB_ENABLE_HF_TRANSFER": "0",
"JETSTREAM_PT": "1",
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can remove this one now

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I moved it to a model config dict, so the arguments can be added for each models. I prefer to leave keep log_level as it allows for easier debugging in case a test fails

text-generation-inference/integration-tests/test_gemma.py Outdated Show resolved Hide resolved
text-generation-inference/integration-tests/test_gemma.py Outdated Show resolved Hide resolved
text-generation-inference/integration-tests/test_gemma.py Outdated Show resolved Hide resolved
text-generation-inference/integration-tests/test_gemma.py Outdated Show resolved Hide resolved
text-generation-inference/integration-tests/test_gemma.py Outdated Show resolved Hide resolved
import Levenshtein
import pytest

MODEL_ID = "google/gemma-2b-it"
Copy link
Collaborator

Choose a reason for hiding this comment

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

wouldn't it be possible to have a single test file with different parameters per model instead of having a new file?

Copy link
Collaborator Author

@baptistecolle baptistecolle Dec 4, 2024

Choose a reason for hiding this comment

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

Refractored the different test files into a single file where you can have a list of configs

@baptistecolle baptistecolle force-pushed the fix-integration-test-tgi-without-ci branch from 7dc97f2 to 9e63ff2 Compare December 2, 2024 18:30
@baptistecolle baptistecolle force-pushed the fix-integration-test-tgi-without-ci branch 2 times, most recently from a7243e8 to c5eaa0a Compare December 4, 2024 10:02
@baptistecolle baptistecolle force-pushed the fix-integration-test-tgi-without-ci branch from c5eaa0a to 1af9edc Compare December 4, 2024 10:03
Copy link
Collaborator

@tengomucho tengomucho left a comment

Choose a reason for hiding this comment

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

LGTM!

@baptistecolle baptistecolle merged commit 9d44709 into main Dec 5, 2024
3 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.

2 participants