forked from dmlc/xgboost
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid thrust vector initialization. (dmlc#10544)
* Avoid thrust vector initialization. - Add a wrapper for rmm device uvector. - Split up the `Resize` method for HDV.
- Loading branch information
1 parent
c8c358c
commit 9955f1c
Showing
13 changed files
with
510 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Copyright 2017-2024, XGBoost contributors | ||
*/ | ||
#include "../collective/communicator-inl.h" // for GetRank | ||
#include "device_helpers.cuh" // for CurrentDevice | ||
#include "device_vector.cuh" | ||
|
||
namespace dh { | ||
namespace detail { | ||
void ThrowOOMError(std::string const &err, size_t bytes) { | ||
auto device = CurrentDevice(); | ||
auto rank = xgboost::collective::GetRank(); | ||
std::stringstream ss; | ||
ss << "Memory allocation error on worker " << rank << ": " << err << "\n" | ||
<< "- Free memory: " << dh::AvailableMemory(device) << "\n" | ||
<< "- Requested memory: " << bytes << std::endl; | ||
LOG(FATAL) << ss.str(); | ||
} | ||
} // namespace detail | ||
|
||
#if defined(XGBOOST_USE_RMM) | ||
LoggingResource *GlobalLoggingResource() { | ||
static auto mr{std::make_unique<LoggingResource>()}; | ||
return mr.get(); | ||
} | ||
#endif // defined(XGBOOST_USE_RMM) | ||
} // namespace dh |
Oops, something went wrong.