Skip to content

Check for removed binary format.#11760

Merged
trivialfis merged 5 commits into
dmlc:masterfrom
trivialfis:model-error
Oct 20, 2025
Merged

Check for removed binary format.#11760
trivialfis merged 5 commits into
dmlc:masterfrom
trivialfis:model-error

Conversation

@trivialfis

@trivialfis trivialfis commented Oct 20, 2025

Copy link
Copy Markdown
Member

Close #11758

@trivialfis
trivialfis requested a review from Copilot October 20, 2025 12:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Adds an explicit check to detect legacy binary model files and fail fast with a clear message, addressing the removed binary format.

  • Introduces a reusable error message helper for removed binary format.
  • Blocks loading of legacy binary models by detecting the "binf" magic header and emitting a fatal log with guidance.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/common/error_msg.h Adds a helper function returning a detailed message about the removed binary format with docs link.
src/c_api/c_api.cc Detects "binf" header in loaded bytes and aborts with the new error message instead of proceeding.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/c_api/c_api.cc Outdated
Comment thread src/c_api/c_api.cc Outdated
Comment thread src/common/error_msg.h Outdated
@trivialfis trivialfis mentioned this pull request Oct 20, 2025
3 tasks
@trivialfis

Copy link
Copy Markdown
Member Author

cc @hcho3

@ikrommyd ikrommyd left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks! I think this can help users who try to load old models understand better what's happening!

@trivialfis
trivialfis merged commit a340adc into dmlc:master Oct 20, 2025
63 checks passed
@trivialfis
trivialfis deleted the model-error branch October 20, 2025 23:47
trivialfis added a commit to trivialfis/xgboost that referenced this pull request Oct 21, 2025
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.

Loading old binary xgboost model in version 3.1 raises error that is hard to understand. Perhaps it should tell the user to resave the model?

3 participants