[dask] Fix ddqdm with empty partition. (#7510)
* Fix empty partition. * war.
This commit is contained in:
@@ -599,7 +599,7 @@ void MetaInfo::GetInfo(char const* key, bst_ulong* out_len, DataType dtype,
|
||||
}
|
||||
|
||||
void MetaInfo::SetFeatureInfo(const char* key, const char **info, const bst_ulong size) {
|
||||
if (size != 0) {
|
||||
if (size != 0 && this->num_col_ != 0) {
|
||||
CHECK_EQ(size, this->num_col_)
|
||||
<< "Length of " << key << " must be equal to number of columns.";
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class CudfAdapterBatch : public detail::NoMetaInfo {
|
||||
|
||||
private:
|
||||
common::Span<ArrayInterface<1>> columns_;
|
||||
size_t num_rows_;
|
||||
size_t num_rows_{0};
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace data {
|
||||
// be supported in future. Does not currently support inferring row/column size
|
||||
template <typename AdapterT>
|
||||
SimpleDMatrix::SimpleDMatrix(AdapterT* adapter, float missing, int nthread) {
|
||||
auto device =
|
||||
adapter->DeviceIdx() < 0 ? dh::CurrentDevice() : adapter->DeviceIdx();
|
||||
auto device = (adapter->DeviceIdx() < 0 || adapter->NumRows() == 0) ? dh::CurrentDevice()
|
||||
: adapter->DeviceIdx();
|
||||
CHECK_GE(device, 0);
|
||||
dh::safe_cuda(cudaSetDevice(device));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user