jinchengchenghh commented on code in PR #11830:
URL: https://github.com/apache/gluten/pull/11830#discussion_r2996135648
##########
cpp/velox/compute/VeloxBackend.cc:
##########
@@ -81,13 +92,20 @@ void veloxMemoryManagerReleaser(MemoryManager*
memoryManager) {
delete memoryManager;
}
-Runtime* veloxRuntimeFactory(
- const std::string& kind,
- MemoryManager* memoryManager,
- const std::unordered_map<std::string, std::string>& sessionConf) {
- auto* vmm = dynamic_cast<VeloxMemoryManager*>(memoryManager);
- GLUTEN_CHECK(vmm != nullptr, "Not a Velox memory manager");
- return new VeloxRuntime(kind, vmm, sessionConf);
+Runtime::Factory createVeloxRuntimeFactory(std::unordered_map<std::string,
std::string> immutableConf) {
+ return [immutableConf = std::move(immutableConf)](
+ const std::string& kind,
+ MemoryManager* memoryManager,
+ const std::unordered_map<std::string, std::string>& sessionConf)
-> Runtime* {
+ auto* vmm = dynamic_cast<VeloxMemoryManager*>(memoryManager);
Review Comment:
The configuration is not the static config, session level config can make
user more flexible to decide which query is running on GPU, so I prefer these
configs still be session config, the session level config can overwrite the
static config
##########
cpp/velox/compute/VeloxBackend.cc:
##########
@@ -73,6 +73,17 @@ using namespace facebook;
namespace gluten {
namespace {
+
+bool hasCudaRuntimeAndDevice() {
+#ifdef GLUTEN_ENABLE_GPU
+ int count = 0;
+ cudaError_t err = cudaGetDeviceCount(&count);
Review Comment:
Looks like this code would execute on CPU node, but is the function executes
by header, if not, the cuda library does not exist in CPU node, I'm not sure if
it can run successfully. If you very it can run well on CPU node without CUDA
environment, we may need to add a comment on it.
And the common way is to check if nvidia-smi command exists, if exists, we
can check further.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]