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

Rewrite tests #346

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

Conversation

RAMitchell
Copy link
Contributor

@RAMitchell RAMitchell commented Mar 22, 2023

This PR moves the model generation and loading into pytest.

This achieves a few things:

The tests run faster than before, are easy to extend and we can generate more coverage.

Todo:

  • cuml tests
  • sklearn tests
  • update docs

qa/L0_e2e/generate_example_model.py Outdated Show resolved Hide resolved
qa/run_tests.sh Outdated Show resolved Hide resolved
src/tl_model.h Outdated Show resolved Hide resolved
qa/L0_e2e/test_model.py Outdated Show resolved Hide resolved
qa/L0_e2e/test_model.py Outdated Show resolved Hide resolved
@RAMitchell
Copy link
Contributor Author

I have updated this so that models are generated using the original code but cached automatically using joblib.memory. Here below is an example of the test matrix (68 items), taking 130s. I think it will be particularly useful to test the experimental_optimization flag for all as the backend is updated with the latest cuml changes.

../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:True-num_class:2-instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:True-num_class:2-instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:True-num_class:2-instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:True-num_class:2-instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:True-num_class:10-instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:True-num_class:10-instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:True-num_class:10-instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:True-num_class:10-instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:False-num_class:2-instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:False-num_class:2-instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:False-num_class:2-instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:False-num_class:2-instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:False-num_class:10-instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:False-num_class:10-instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:False-num_class:10-instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_xgb[use_json:False-num_class:10-instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_lgbm_classification_model[num_class:2-instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_lgbm_classification_model[num_class:2-instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_lgbm_classification_model[num_class:2-instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_lgbm_classification_model[num_class:2-instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_lgbm_classification_model[num_class:10-instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_lgbm_classification_model[num_class:10-instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_lgbm_classification_model[num_class:10-instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_lgbm_classification_model[num_class:10-instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn[num_class:2-instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn[num_class:2-instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn[num_class:2-instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn[num_class:2-instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn[num_class:10-instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn[num_class:10-instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn[num_class:10-instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn[num_class:10-instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_cuml[num_class:2-instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_cuml[num_class:2-instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_cuml[num_class:2-instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_cuml[num_class:2-instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_cuml[num_class:10-instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_cuml[num_class:10-instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_cuml[num_class:10-instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_cuml[num_class:10-instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn_gbm[num_class:2-instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn_gbm[num_class:2-instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn_gbm[num_class:2-instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn_gbm[num_class:2-instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn_gbm[num_class:10-instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn_gbm[num_class:10-instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn_gbm[num_class:10-instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestClassifiers::test_sklearn_gbm[num_class:10-instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_xgb[instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_xgb[instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_xgb[instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_xgb[instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_lgbm[instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_lgbm[instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_lgbm[instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_lgbm[instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_sklearn[instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_sklearn[instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_sklearn[instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_sklearn[instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_cuml[instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_cuml[instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_cuml[instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_cuml[instance:KIND_GPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_sklearn_gbm[instance:KIND_CPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_sklearn_gbm[instance:KIND_CPU-exper_optim:False] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_sklearn_gbm[instance:KIND_GPU-exper_optim:True] PASSED
../../qa/L0_e2e/test_model.py::TestRegressors::test_sklearn_gbm[instance:KIND_GPU-exper_optim:False] 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.

[BUG] Predict proba for cuml classifier with CPU backend broken
2 participants