-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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] Accept multi-dim meta info. #7405
Conversation
Now let's see how many compilers are failing. ;-) |
Hmm??
|
Note to myself:
|
Will start extracting components for reviews. |
b8ff8fb
to
6f2b3c7
Compare
b1b1cde
to
482ab07
Compare
191d005
to
0257923
Compare
* Use typed tensor for storing meta info like base margin. * Extend the array interface handler to multi-dim. Implement a general array view. * Replace existing matrix and vector view. lint. Remove const too. Doc/Test. Include. Use it in AUC. Win build. Use int32_t. Use integral. force the same type. Use constexpr for old nvcc. Test for empty tensor. Rename to view. Format. Better document and perf. Address reviewer's comment. tidy. Implement a general array view. * Replace existing matrix and vector view. lint. Remove const too. Doc/Test. Include. Use it in AUC. Win build. Use int32_t. Use integral. force the same type. Use constexpr for old nvcc. Test for empty tensor. Rename to view. Format. Prototype. Move string view. Compile on CPU. Some fixes for GPU compilation. Array interface. Use it in file iter. Cleanup. itemsize. Documents. Cache the pointer. port. cuda compilation. Start working on ari. Add clang-format config. (dmlc#7383) Generated using `clang-format -style=google -dump-config > .clang-format`, with column width changed from 80 to 100 to be consistent with existing cpplint check. Define shape and stride. Convert some uses. Prototype for copy tensor info. proto unravel Indexer. Unravel. Cleanup. Fixes. fixe.s WAR. as column vector. Convert some code. some more. some more. Compile. Ensure column vector from the beginning. IO. Add code comments. Test for trivial dimension. Start CPU implementation. Refactor. Dispatch. Compile. Cleanup slice and index for array interface. Add document about handling user input. Validate the shape of base margin. Cleanup out prediction. Use it in Python. Optimization. Cleanup. Define unravel index as an interface. Dispatch DType. Err. By pass the iterator. Cleanup old code. comment. Cleanup. Remove duplicated function. Add contiguous. Typo. Fix copying for group. comment. Fix CSR. Fix empty dimensions. Use linalg for utilities. Fix test. Fix streams. Basic elementwise kernel. Fixes. fix dtype. Fix index. Comment. Cleanup. popcnt implementation. Move to compile time. Fix. Fix. Move to compile time. Forward. Forward. Include. Lint. Reintroduce the checks. Fix long double. Remove check. Comment. Remove macro. Some changes in jvm package. Include. Ignore 0 shape. Fix. Restore bound check for now. Fix slice. Fix test feature weights. Stricter requirements. Reshape. Require v3 interface. Use CUDA ptr attr. Fix test. Invalid stream. tidy. Fix versions. test stack. CPU only. Simplifies. Reverse version. Force c++14 for msvc. Lint. Remove imports. Revert cmake changes. Reset. Check. Unify device initialization. Tests. Just bypass the error. Fix. Fix. test qid. Fix test. Cleanup. lint. Fix. Restore the heuristic. Update metainfo binary. Fix typo. Restore the optimization. Cleanup sklearn tests. Cleanup dask test. Tidy. Tidy is happy. Polish. Unittest. Typo. Polish. Port the changes to parent PR. Add Python test. Fix GPU tests.
87193bb
to
3376af8
Compare
This is the last part of the original PR for extending meta info to multi-dimension arrays. This PR changes base_margin into a 3-dim array, with one of them being reserved for multi-target classification. Also, a breaking change is made for binary serialization due to extra dimension along with a fix for saving the feature weights. Lastly, it unifies the prediction initialization between CPU and GPU. After this PR, the meta info setter in Python will be based on array interface.
Original description
InitPredOutput
function from both predictors.Motivation
These are basic infrastructures for multi-target model training. The type erased array interface class is used to consume user inputs and typed tensor/tensor_view is used for internal algorithms. For the typed tensor, it makes sense to consider existing implementations instead of rolling out our own. Here are a few things that we need to consider and I haven't found a candidate yet. Firstly the tensor needs to be trivially passed into CUDA kernel. Secondly, we need to have control over its memory allocation for both host and device. Lastly, it should work with any type of data instead of numeric-only since we have custom gradient and might use it to manage the grid of trees (model slicing).
The implementation here satisfies all the above items and features efficient indexing and slicing, along with compile-time dimension safety checks.
To-dos:
__cuda_array_interface__
.