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

Split and clean up GGUF quantization tests #35502

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

Isotr0py
Copy link
Contributor

@Isotr0py Isotr0py commented Jan 3, 2025

What does this PR do?

  • Split up GGUF tests into three subsets: quantization tests, basic integration tests and models tests.
  • This PR also consolidates the quantization tests since they are using duplicate code.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@SunMarc @LysandreJik

Copy link
Member

@SunMarc SunMarc left a comment

Choose a reason for hiding this comment

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

Nice ! Thanks for the cleanup

tests/quantization/ggml/test_ggml.py Outdated Show resolved Hide resolved
@SunMarc SunMarc requested a review from LysandreJik January 3, 2025 14:41
Comment on lines 72 to 76
(QuantType.Q2_K.name, "Hello, I'm a 22 year old female"),
(QuantType.Q3_K.name, "Hello\n\nI am trying to create a simple program that"),
(QuantType.Q4_K.name, "Hello\n\nI am trying to create a simple program that"),
(QuantType.Q5_K.name, "Helloveda is a 1999 Indian"),
(QuantType.Q6_K.name, "Hello\n\nI am trying to create a simple program that"),
Copy link
Contributor Author

@Isotr0py Isotr0py Jan 3, 2025

Choose a reason for hiding this comment

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

We use GGMLQuantizationType to make sure it's a validated "pure" quantization type, because some models like Q4_K_M means a combination of "mostly Q4_K" with some of other quantization, which shouldn't be used for quantization tests.

BTW, seems that this is causing tests_hub CI failing because gguf is not available on that CI, is there any way to solve this?

Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't have this issue even if gguf is not available on the hub. There must be an issue when collecting tests with parameterized or maybe an issue with workflow of tests_hub. cc @ArthurZucker

Can you try to create a mapping instead so that you can replace GGMLQuantizationType by a string instead ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, let's use string for parameterize now! Also added a note to keep the quantization style aligned with gguf-py.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

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.

3 participants