dmlc / dmlc/xgboost

Is split direction random for missing value on training data without missing at all?

Open
#10,637 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
28.8k
Forks
8.9k
Avg merge
1d 12h
Merged PRs (30d)
54

Description

Is the [comparison](https://github.com/dmlc/xgboost/blob/master/src/tree/gpu_hist/evaluate_splits.cu#L31) here going to be random due to precision?

My training data has no missing value at all. But it has different split directions for missing value on two devices.

1. Apply M2: all missing value splits direct to right child.
2. A linux server: 2/3 missing values splits direct to left child.

Is it related with how different GPUs handle computation and their precision? Apple M2 is more deterministic on GPU computation?

XGBOOST_DEVICE float LossChangeMissing(const GradientPairInt64 &scan,
const GradientPairInt64 &missing,
const GradientPairInt64 &parent_sum,
const GPUTrainingParam ¶m, bst_node_t nidx,
bst_feature_t fidx,
TreeEvaluator::SplitEvaluator evaluator,
bool &missing_left_out, const GradientQuantiser& quantiser) { // NOLINT
const auto left_sum = scan + missing;
float missing_left_gain = evaluator.CalcSplitGain(
param, nidx, fidx, quantiser.ToFloatingPoint(left_sum),
quantiser.ToFloatingPoint(parent_sum - left_sum));
float missing_right_gain = evaluator.CalcSplitGain(
param, nidx, fidx, quantiser.ToFloatingPoint(scan),
quantiser.ToFloatingPoint(parent_sum - scan));

missing_left_out = missing_left_gain > missing_right_gain;
return missing_left_out?missing_left_gain:missing_right_gain;
}

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with src/tree/gpu_hist/evaluate_splits.cu and inspect LossChangeMissing, especially the two gain calculations and missing_left_out assignment. Reproduce the reported missing-direction difference on Apple M2 and Linux GPUs, then determine whether precision or another device difference explains it; done means the cause and expected behavior are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.