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

Fix ranking with quantile dmatrix and group weight. #8762

Merged
merged 2 commits into from Feb 10, 2023

Conversation

trivialfis
Copy link
Member

@trivialfis trivialfis commented Feb 7, 2023

Close #8708 .

  • Fix mixing QDM with device and host inputs.
  • Fix group weight for host QDM.

@@ -63,6 +63,13 @@ void GetCutsFromRef(std::shared_ptr<DMatrix> ref_, bst_feature_t n_features, Bat
}
};
auto ellpack = [&]() {
// workaround ellpack being initialized from CPU.
if (p.gpu_id == Context::kCpuId) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand what is happening here, and it looks weird with two statements having the same condition.

Copy link
Member Author

@trivialfis trivialfis Feb 9, 2023

Choose a reason for hiding this comment

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

If the device is on CPU, we try the device ordinal in reference dmatrix. After the assignment from the reference dmatrix, if the device is still on cpu, we just use 0 as a workaround.

This happens when both the current qdm and the reference dmatrix are initialized with CPU data, but we train the booster on GPU, which requests the ellpack from DMatrix but the DMatrix is on CPU.

I'm working to unify the device ordinal, we will have a single context from booster instead. This PR is a quick fix for backport.

@trivialfis trivialfis merged commit 8a16944 into dmlc:master Feb 10, 2023
@trivialfis trivialfis deleted the fix-qdm-rank-weight branch February 10, 2023 12:32
trivialfis added a commit to trivialfis/xgboost that referenced this pull request Feb 14, 2023
trivialfis added a commit that referenced this pull request Feb 14, 2023
#8800)

* [backport] Fix ranking with quantile dmatrix and group weight. (#8762)

* backport test utilities.
@trivialfis trivialfis mentioned this pull request Feb 14, 2023
7 tasks
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.

XGBRanker with sample_weight makes python interpreter died and restarted.
2 participants