Fix pyspark with verbosity=3. (#10172)

This commit is contained in:
Jiaming Yuan
2024-04-09 23:18:56 +08:00
committed by GitHub
parent a99bb38bd2
commit f0a138f33a
2 changed files with 19 additions and 15 deletions

View File

@@ -307,13 +307,15 @@ class MemoryLogger {
void RegisterDeallocation(void *ptr, size_t n, int current_device) {
auto itr = device_allocations.find(ptr);
if (itr == device_allocations.end()) {
LOG(WARNING) << "Attempting to deallocate " << n << " bytes on device "
<< current_device << " that was never allocated ";
LOG(WARNING) << "Attempting to deallocate " << n << " bytes on device " << current_device
<< " that was never allocated\n"
<< dmlc::StackTrace();
} else {
num_deallocations++;
CHECK_LE(num_deallocations, num_allocations);
currently_allocated_bytes -= itr->second;
device_allocations.erase(itr);
}
num_deallocations++;
CHECK_LE(num_deallocations, num_allocations);
currently_allocated_bytes -= itr->second;
device_allocations.erase(itr);
}
};
DeviceStats stats_;