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 combinatorial tests to the CI #2991

Merged
merged 53 commits into from
Apr 4, 2023
Merged

Add combinatorial tests to the CI #2991

merged 53 commits into from
Apr 4, 2023

Conversation

abidwael
Copy link
Contributor

@abidwael abidwael commented Jan 23, 2023

This PR adds combinatorial Ludwig config testing to the CI to automatically generate valid configs and train models using them to test model training success.

TODO: add a README to explain how it works and how to add more combinatorial tests.

@abidwael abidwael marked this pull request as draft January 23, 2023 22:47
@abidwael abidwael changed the title add tests with auto generated configs Add combinatorial tests to the CI Mar 7, 2023
@abidwael
Copy link
Contributor Author

abidwael commented Mar 7, 2023

The remaining piece is to add the marker combinatorial to run along with not distributed in the CI.

@abidwael abidwael marked this pull request as ready for review March 7, 2023 21:37
Copy link
Collaborator

@justinxzhao justinxzhao left a comment

Choose a reason for hiding this comment

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

A handful of minor comments for now. Will review the meat in more detail in a bit.

@@ -188,6 +188,43 @@ jobs:
name: Unit Test Results (Python ${{ matrix.python-version }} ${{ matrix.test-markers }})
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the Unit Tests, Integration Tests, and Regression Tests above, do we need to extend the not slow or benchmark clause to include the combinatorial marker?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The combinatorial tests will run in their own separate runner and the other jobs can stay intact. I opted for this option as to not add to the current time it takes to run these tests and speed up development.

.github/workflows/pytest.yml Outdated Show resolved Hide resolved
tests/training_success/configs.py Show resolved Hide resolved
tests/training_success/configs.py Outdated Show resolved Hide resolved
tests/training_success/configs.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@justinxzhao justinxzhao left a comment

Choose a reason for hiding this comment

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

@abidwael, my comments are mainly around code structure, variable naming, nits, and questions. Solid work overall.

Higher-level comments:

  • The code in explore_schema is pretty juicy. It would be great to add unit tests for this code.
  • In terms of directory structure, I might suggest putting most of the code in a new directory ludwig/config_sampling and putting tests in tests/ludwig/config_sampling.
  • Tests that actually do config sampling and run training for 1 step can live in tests/robustness (or training_success as you currently have it, though robustness seems more clear to me)
  • Move explore_<atomic type>() functions to their own file. explore_schema.py is really big already.
  • Throughout your code, you use key and item, which aren't particularly descriptive. In one of my comments, I suggest using jsonschema_property instead of item and parameter_name/path instead of key, which I would take back if key and item are formal concepts in jsonschema.
  • Prefer to use f"{var}.{var}" strings instead of var + "." + var
  • nit: Consider defining a dataclass for the dq instead of passing around tuple objects.

tests/training_success/explore_schema.py Outdated Show resolved Hide resolved
tests/training_success/explore_schema.py Outdated Show resolved Hide resolved
tests/training_success/explore_schema.py Outdated Show resolved Hide resolved
tests/training_success/explore_schema.py Outdated Show resolved Hide resolved
tests/training_success/explore_schema.py Outdated Show resolved Hide resolved
tests/training_success/explore_schema.py Outdated Show resolved Hide resolved
tests/training_success/explore_schema.py Outdated Show resolved Hide resolved
tests/training_success/explore_schema.py Outdated Show resolved Hide resolved
tests/training_success/explore_schema.py Outdated Show resolved Hide resolved
tests/training_success/test_training_success.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@justinxzhao justinxzhao left a comment

Choose a reason for hiding this comment

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

Mostly just a few more nits! Thanks.

ludwig/config_sampling/explore_schema.py Outdated Show resolved Hide resolved
ludwig/config_sampling/explore_schema.py Outdated Show resolved Hide resolved
ludwig/config_sampling/explore_schema.py Outdated Show resolved Hide resolved
ludwig/config_sampling/explore_schema.py Outdated Show resolved Hide resolved
ludwig/config_sampling/explore_schema.py Show resolved Hide resolved
ludwig/config_sampling/explore_schema.py Show resolved Hide resolved
tests/ludwig/config_sampling/test_config_sampling.py Outdated Show resolved Hide resolved
tests/training_success/configs.py Show resolved Hide resolved
tests/training_success/test_training_success.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@justinxzhao justinxzhao left a comment

Choose a reason for hiding this comment

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

Thanks!

@abidwael abidwael merged commit d9b408a into master Apr 4, 2023
7 of 10 checks passed
@abidwael abidwael deleted the training-success-tests branch April 4, 2023 07:41
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