Skip to content

Extend modelbuilders test set#2856

Open
avolkov-intel wants to merge 2 commits intouxlfoundation:mainfrom
avolkov-intel:dev/mb-deep-tree-test
Open

Extend modelbuilders test set#2856
avolkov-intel wants to merge 2 commits intouxlfoundation:mainfrom
avolkov-intel:dev/mb-deep-tree-test

Conversation

@avolkov-intel
Copy link
Contributor

@avolkov-intel avolkov-intel commented Dec 17, 2025

Description

Since we plan an update to internal modelbuilders layout by introducing hybrid layout (uxlfoundation/oneDAL#3455) we need to extend test set.
In the new layouts we would create full binary tree layout for levels <= 10 but after that we will store nodes in dense format. To check, that this implementation doesn't have any bugs we need to add tests where deep trees are used.

This test introduces new tests where trees with depth >=12 or >=15 created.


Checklist:

Completeness and readability

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes or created a separate PR with updates and provided its number in the description, if necessary.
  • Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • I have resolved any merge conflicts that might occur with the base branch.

Testing

  • I have run it locally and tested the changes extensively.
  • All CI jobs are green or I have provided justification why they aren't.
  • I have extended testing suite if new functionality was introduced in this PR.

@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
azure 79.83% <ø> (-0.72%) ⬇️
github 81.83% <ø> (-0.39%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 19 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@david-cortes-intel
Copy link
Contributor

Wouldn't it make more sense to have tests like this on the oneDAL repository?

# ============================================================================
# Tree depth utility functions for deep trees testing
# ============================================================================
def compute_xgb_tree_depth(booster: xgb.Booster) -> int:
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the idea is to test some internal detail of the implementation that doesn't anyhow depend on the input converter, how about checking only a single GBT library? Perhaps a random forest from sklearn converted with treelite could be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We actually have some existing tests related to xgboost and catboost including SHAP tests, it would require much more effort to create tests using RandomForest and TreeLite compared to updating existing tests

Copy link
Contributor

Choose a reason for hiding this comment

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

Then how about leaving serialized model objects instead of re-creating them every time? These tests are already having issues in CIs due to taking too long to execute, and some are currently skipped due to timings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this would make the testing more complicated, not sure if we use serialized models in other tests. Although, I agree that modelbuilders tests take quite a lot of time, the relative slowdown after introducing tests in this PR is small. That's why let's create a follow up for speeding up this set of tests

Copy link
Contributor

Choose a reason for hiding this comment

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

From what I can see in the CI jobs here compared to those of recent commits, it adds roughly 1 additional minute in the CI servers.

@avolkov-intel avolkov-intel marked this pull request as ready for review January 23, 2026 15:04
@ethanglaser
Copy link
Contributor

Please address linter fail

@ethanglaser
Copy link
Contributor

/intelci: run

@avolkov-intel
Copy link
Contributor Author

/intelci: run

@avolkov-intel avolkov-intel added the testing Tests for sklearnex/daal4py/onedal4py & patching sklearn label Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Tests for sklearnex/daal4py/onedal4py & patching sklearn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants