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

Optimize array interface input. #9090

Merged
merged 4 commits into from
Apr 28, 2023

Conversation

trivialfis
Copy link
Member

@trivialfis trivialfis commented Apr 25, 2023

Type cast the array once instead of performing type casts for every individual element.

This is to prepare for multi-output with custom objectives. In that case, we will need to consume more diverse inputs for gradient (array with strides, c-order, f-order, etc). I plan to reuse the array interface for custom gradient, hence a small optimization.

Besides, I think this makes the code easier to follow as the operation is reduced to between TensorViews, array interface bears no actual functionality and is only a representation of the input.

Type cast the array once instead of performing type casts for every individual element.
@trivialfis trivialfis changed the title Optimize contiguous array interface input. Optimize array interface input. Apr 25, 2023
@trivialfis trivialfis mentioned this pull request Apr 25, 2023
39 tasks
@trivialfis trivialfis merged commit 17ff471 into dmlc:master Apr 28, 2023
@trivialfis trivialfis deleted the dispatch-array-interface branch April 28, 2023 10:02
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.

2 participants