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

[breaking] Change internal model serialization to UBJSON. #7556

Merged
merged 8 commits into from
Jan 15, 2022

Conversation

trivialfis
Copy link
Member

  • Use typed array for models.
  • Change the memory snapshot format.
  • Add new C API for saving to raw format.

This PR breaks the schema of JSON, the default_left field is changed from boolean to integer so that we can use typed array. XGBoost itself will continue to load the old models, third-party libraries that depend on this schema will have to make changes accordingly. I can help with treelite once the full PR is merged.

Extracted from #7545 .

@hcho3
Copy link
Collaborator

hcho3 commented Jan 13, 2022

I can help with treelite once the full PR is merged.

Treelite doesn't need to be updated, since it already handles integer arrays for default_left. See dmlc/treelite#337.

@trivialfis
Copy link
Member Author

Ah, the parser is interesting, I should learn more about it. Thanks for sharing.

include/xgboost/c_api.h Outdated Show resolved Hide resolved
* Use typed array for models.
* Change the memory snapshot format.
* Add new C API for saving to raw format.
@trivialfis
Copy link
Member Author

@hcho3 Could you please take another look?

@trivialfis
Copy link
Member Author

trivialfis commented Jan 14, 2022

Added an extra optimization to avoid the i64 array for split index. Also, fixed the type used in the tree param.(#7565)

@trivialfis trivialfis merged commit a1bcd33 into dmlc:master Jan 15, 2022
@trivialfis trivialfis deleted the ubjson-model branch January 15, 2022 18:11
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