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

Tests Refactoring #740

Merged
merged 55 commits into from
Jan 27, 2025
Merged

Tests Refactoring #740

merged 55 commits into from
Jan 27, 2025

Conversation

TimoImhof
Copy link
Contributor

@TimoImhof TimoImhof commented Sep 16, 2024

This PR aims to refactor the test suite into a more generic version.

The following points are to be covered (subject to change; will become more granular):

  • Add more granularity to test viewer for better test overview/readability and more convenient testing of subgroups of methods (e.g. only exectue LoRA tests for one model)
  • Add documentation about the structure of the test directory and entry points
  • Add pytest markers to allow for more granular testing of subgroups (e.g. exectue only LoRA tests for all models at once, useful when implementing a new adapter method)
  • Refactor test methods to extract similar/duplicate code into a set of utils methods
  • Relocate edgecases due to model peculiarities out of the tests and into the respective model test classes to keeps the tests generic
  • Fix config union tests, closes ConfigUnion test failures: Identical outputs with and without adapters when combining CompacterConfig and LoRAConfig #785

This should make it easier to add new models or methods to the existing test suite in the future and make the development/testing process more convenient in the future

TimoImhof and others added 10 commits September 16, 2024 10:10
- reorder directory structure to separate testing models and adapter methods (needs further refactoring for separating tests that are extecuted for each model vs tests that are just run once)
- remove all model tests except albert for now (will be readded once final design is agreed on)
- refactor albert adapter test class to group test mixins in categories which are then displayed accordingly by test viewer
- adjust imports to reflect new directory structure
@TimoImhof TimoImhof changed the title WIP: Generic Tests WIP: Tests Refactoring Nov 4, 2024
- refactor generate_test into base test class and adapt parallel generate test accordingly
- refactor lm head selection into own method
- create utils file for utility methods and adapt imports accordingly
- remove is_speech_model flags
- replace redundant attributes and methods
- enforce proper method naming conventions
- Re-add bart adapter method tests
- Remove duplicate added tests
- In conversion test refactor model specific if else statements into model test class
- deberta
- debertav2
- distilbert
- electra
- encoder-decoder
- llama
- mbart
- mistral
- mt5
- plbart
- roberta
- introduce parameter to cut down on makefile commands
- draw out tests that are not executed on every model into a seperate directory
- move the adapter method test implemenations into the method tests directory
- rename files for more clarity
@TimoImhof TimoImhof marked this pull request as ready for review December 26, 2024 10:29
@TimoImhof TimoImhof changed the title WIP: Tests Refactoring Tests Refactoring Dec 26, 2024
TimoImhof and others added 6 commits December 27, 2024 12:48
julian-fong added a commit to julian-fong/adapters that referenced this pull request Jan 11, 2025
Copy link
Member

@calpt calpt left a comment

Choose a reason for hiding this comment

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

Looks really great overall! Also really appreciate the detailed readme!

Left a couple of comments mainly for clarification

tests/test_methods/test_on_albert.py Show resolved Hide resolved
tests/test_methods/test_on_clip/test_model.py Show resolved Hide resolved
tests/test_methods/test_on_clip/test_model.py Outdated Show resolved Hide resolved
tests/test_methods/test_on_xlm_roberta.py Outdated Show resolved Hide resolved
tests/test_methods/method_test_impl/base.py Outdated Show resolved Hide resolved
tests/test_methods/method_test_impl/base.py Outdated Show resolved Hide resolved
tests/test_methods/generator.py Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
- Merge branch 'main' into dev/test-refactoring
- Adress review comments
- make style, make quality
@TimoImhof TimoImhof requested a review from calpt January 27, 2025 17:00
Copy link
Member

@calpt calpt left a comment

Choose a reason for hiding this comment

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

🔥

@calpt calpt merged commit 1dcac5c into adapter-hub:main Jan 27, 2025
4 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
2 participants