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
Use bst_ulong instead of size_t for CSR conversion #8369
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix! But can we keep the use of bst_ulong? It's defined as uint64_t, which is more strict than size_t
. There's c_bst_ulong
in the _typing.py
module.
@trivialfis I'm ok with changing python side to not strong opinion though. |
I think we will have improved consistency (which is currently lacking for XGBoost) with other C API functions if we use uint64_t. Using uint64_t here to record the shape of the dataset doesn't have practical implications for different memory address sizes. We can optionally define A side note, c++ |
c4d2407
to
9b6f11b
Compare
9b6f11b
to
dd9131f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix!
Some platform, e.g., WebAssembly, has strict typing checking. The mismatch will cause crash.
And they should be
size_t
to be consistent with https://github.com/dmlc/xgboost/blob/master/src/c_api/c_api.cc#L392 and https://github.com/dmlc/xgboost/blob/master/src/data/proxy_dmatrix.cc#L19