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

Remove instance access to SparsePage. #6590

Merged
merged 1 commit into from Jan 11, 2021

Conversation

trivialfis
Copy link
Member

This is to prevent race access of host_device_vector.HostVector(). We have fixed a few bugs caused by the [] operator in SparsePage, but I encountered a new one in SparsePage.GetTranspose() today. This PR is for nuking the operator[] to prevent any related bug in the future.

From now on, accessing instances in SparsePage must go through a SparsePageView, which contains span to host data. No change is made to GPU code since the operator[] is not available on device code.

Copy link
Member

@RAMitchell RAMitchell left a comment

Choose a reason for hiding this comment

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

This is an improvement although it doesn't completely solve the issue as auto page = batch.GetView(); could be caled inside an omp loop.

I don't have any better ideas.

@trivialfis trivialfis merged commit f2f7dd8 into dmlc:master Jan 11, 2021
@trivialfis trivialfis deleted the remove-direct-inst-access branch January 11, 2021 10:05
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.

None yet

3 participants