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 tests/test_classifiers.py PyTests #421

Merged
merged 18 commits into from
Dec 23, 2024

Conversation

sarahyurick
Copy link
Collaborator

@sarahyurick sarahyurick commented Dec 11, 2024

Closes #405.
Closes #419.

Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
@sarahyurick sarahyurick added the gpuci Run GPU CI/CD on PR label Dec 11, 2024
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
@sarahyurick sarahyurick added gpuci Run GPU CI/CD on PR and removed gpuci Run GPU CI/CD on PR labels Dec 12, 2024
Signed-off-by: Sarah Yurick <[email protected]>
@sarahyurick sarahyurick added gpuci Run GPU CI/CD on PR and removed gpuci Run GPU CI/CD on PR labels Dec 12, 2024
Signed-off-by: Sarah Yurick <[email protected]>
@sarahyurick sarahyurick added gpuci Run GPU CI/CD on PR and removed gpuci Run GPU CI/CD on PR labels Dec 13, 2024
Signed-off-by: Sarah Yurick <[email protected]>
@sarahyurick sarahyurick added gpuci Run GPU CI/CD on PR and removed gpuci Run GPU CI/CD on PR labels Dec 13, 2024
Signed-off-by: Sarah Yurick <[email protected]>
@sarahyurick sarahyurick added gpuci Run GPU CI/CD on PR and removed gpuci Run GPU CI/CD on PR labels Dec 13, 2024
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
@sarahyurick sarahyurick marked this pull request as ready for review December 13, 2024 21:58
Comment on lines 102 to 104
hugging_face_api_token = os.getenv("HUGGING_FACE_API_TOKEN")
if not hugging_face_api_token:
pytest.fail("HUGGING_FACE_API_TOKEN environment variable not set")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We grab the Hugging Face token here instead of using a @pytest.fixture. The reason for this is that if we used a PyTest fixture and the test failed for whatever reason, the Hugging Face token would be exposed in the logs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If there is not a short term fix here, we can probably skip this test using skipif .

@pytest.mark.skipif(
    not os.getenv("HUGGING_FACE_API_TOKEN"),
    reason="HUGGING_FACE_API_TOKEN environment variable is not set"
)

Copy link
Collaborator

@VibhuJawa VibhuJawa left a comment

Choose a reason for hiding this comment

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

This looks good to me. Thanks a ton for adding these tests @sarahyurick .

I think we should be good to merge this once we resolve how to pass in HF Secret

Signed-off-by: Sarah Yurick <[email protected]>
@sarahyurick sarahyurick removed the gpuci Run GPU CI/CD on PR label Dec 18, 2024
@sarahyurick sarahyurick added the gpuci Run GPU CI/CD on PR label Dec 18, 2024
Signed-off-by: Sarah Yurick <[email protected]>
@sarahyurick sarahyurick added gpuci Run GPU CI/CD on PR and removed gpuci Run GPU CI/CD on PR labels Dec 19, 2024
Signed-off-by: Sarah Yurick <[email protected]>
@sarahyurick sarahyurick added gpuci Run GPU CI/CD on PR and removed gpuci Run GPU CI/CD on PR labels Dec 19, 2024
Comment on lines +238 to +253
expected_pred = cudf.DataFrame(
{
"constraint_ct": [0.5586],
"contextual_knowledge": [0.0559],
"creativity_scope": [0.0825],
"domain_knowledge": [0.9803],
"no_label_reason": [0.0],
"number_of_few_shots": [0],
"prompt_complexity_score": [0.2783],
"reasoning": [0.0632],
"task_type_1": ["Code Generation"],
"task_type_2": ["Text Generation"],
"task_type_prob": [0.767],
"text": text,
}
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This passes on my remote machine (both my conda setup and my Docker setup) but is failing on our gpuCI. I think perhaps it is related to floating point errors on different machines? I will probably just add some rounding estimations so that it passes both locally for me and here on GitHub.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@sarahyurick sarahyurick added gpuci Run GPU CI/CD on PR and removed gpuci Run GPU CI/CD on PR labels Dec 20, 2024
Signed-off-by: Sarah Yurick <[email protected]>
@sarahyurick sarahyurick added gpuci Run GPU CI/CD on PR and removed gpuci Run GPU CI/CD on PR labels Dec 20, 2024
Signed-off-by: Sarah Yurick <[email protected]>
@sarahyurick sarahyurick added gpuci Run GPU CI/CD on PR and removed gpuci Run GPU CI/CD on PR labels Dec 23, 2024
@sarahyurick sarahyurick added gpuci Run GPU CI/CD on PR and removed gpuci Run GPU CI/CD on PR labels Dec 23, 2024
@sarahyurick sarahyurick merged commit b8ff71e into NVIDIA:main Dec 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gpuci Run GPU CI/CD on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Domain / Quality Classifiers failing on nightly Add CI tests for Hugging Face classifiers
2 participants