-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support gdr malloc&free #8
Conversation
@@ -17,7 +17,7 @@ flagcxResult_t mluAdaptorDeviceMemcpy(void *dst, void *src, size_t size, flagcxM | |||
if (stream == NULL) { | |||
DEVCHECK(cnrtMemcpy(dst, src, size, memcpy_type_map[type])); | |||
} else { | |||
DEVCHECK(cnrtMemcpyAsync_V3(dst, src, size, stream->base, memcpy_type_map[type])); | |||
DEVCHECK(cnrtMemcpyAsync_V2(dst, src, size, stream->base, memcpy_type_map[type])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里后续会升级导致兼容问题么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个貌似没有更好的办法,只能锚定cambricon的某个版本,后续更新cambricon docker后再升级接口。
@@ -73,12 +73,12 @@ flagcxResult_t mluAdaptorGetVendor(char *vendor) { | |||
} | |||
|
|||
flagcxResult_t mluAdaptorGdrMemAlloc(void **ptr, size_t size, void *memHandle) { | |||
// TODO: Implement GDR memory allocation | |||
DEVCHECK(cnrtMalloc(ptr, size)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里直接用cnrtMalloc就可以了?不需要再进行额外操作?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
参照cuda代码,添加了防呆。mlu申请gdr内存时暂时没有设置属性的函数,因此暂不需要其他其他操作。
|
||
ifeq ($(strip $(DEVICE_HOME)),) | ||
ifeq ($(USE_NVIDIA), 1) | ||
DEVICE_HOME = /usr/local/cuda | ||
else ifeq ($(USE_ILUVATAR_COREX), 1) | ||
DEVICE_HOME = /usr/local/corex | ||
else ifeq ($(USE_CAMBRICON), 1) | ||
DEVICE_HOME = /torch/neuware_home | ||
DEVICE_HOME = $(NEUWARE_HOME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NEUWARE_HOME是系统默认环境变量?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mlu的docker中都默认设置了这个环境变量,不需要用户自己设置。
No description provided.