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

Don't copy more than has been allocated to device_features. #3752

Merged
merged 1 commit into from
Jan 23, 2021

Conversation

ChipKerchner
Copy link
Contributor

@ChipKerchner ChipKerchner commented Jan 12, 2021

@StrikerRUS Don't copy more than has been allocated to device_features.

Fix CUDA failures #3450

Possible compilation issues related to #3750

@StrikerRUS
Copy link
Collaborator

@guolinke @shiyu1994 @btrotta Could you please help to review this tiny PR with #3750? I'd like to start improving CUDA CI part ASAP but I can't without two these PRs are merged. Sorry for the rush, thanks!

@@ -408,7 +408,7 @@ void CUDATreeLearner::copyDenseFeature() {
// looking for dword_features_ non-sparse feature-groups
if (!train_data_->IsMultiGroup(i)) {
dense_feature_group_map_.push_back(i);
auto sizes_in_byte = train_data_->FeatureGroupSizesInByte(i);
auto sizes_in_byte = std::min(train_data_->FeatureGroupSizesInByte(i), static_cast<size_t>(num_data_));
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we assert for the type for FeatureGroupData ? I think it should be 1-Byte type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think an assert would be meaningful since FeatureGroupSizesInByte is returning a padded size (at least after 3.0.x it is).

Copy link
Collaborator

Choose a reason for hiding this comment

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

@guolinke Can we merge or this discussions should be resolved before that?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I mean that using static_cast<size_t>(num_data_) as the size, the type should be 1-Byte type, right?
FeatureGroup could be 4-bit, 1Byte, 2Byte and 4Byte.

However, I think we can merge this first.

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants