-
Notifications
You must be signed in to change notification settings - Fork 105
Adding back memory check #4106
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
Adding back memory check #4106
Conversation
Whats the reason to disable this memory check? |
We had a similar check on Windows in the past, when we discovered that hipMemGetInfo returns ~70–80% of the available GPU memory. We believe there may be a regression in this function as few models start falling because of memory, and we also need to decide whether we want to enable it. |
src/targets/gpu/CMakeLists.txt
Outdated
if(MIGRAPHX_DISABLE_AVAILABLE_GPU_MEMORY_CHECK) | ||
message(STATUS "HipMemGetInfo check is disabled") | ||
target_compile_definitions(migraphx_gpu PUBLIC MIGRAPHX_DISABLE_AVAILABLE_GPU_MEMORY_CHECK) | ||
endif() |
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.
Dont add a cmake option. I dont think we need this. Just define this to true when windows is used:
#ifdef MIGRAPHX_DISABLE_AVAILABLE_GPU_MEMORY_CHECK
#ifdef _WIN32
#define MIGRAPHX_DISABLE_AVAILABLE_GPU_MEMORY_CHECK 1
#else
#define MIGRAPHX_DISABLE_AVAILABLE_GPU_MEMORY_CHECK 0
#endif
#endif
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.
This macro is intended for internal use only, to quick test specific cases. It will not be activated in production on Windows. The build option allows us to decide whether to include or exclude the memory check code during compilation, we don't want it always ON.
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.
OK if its internal then definitely dont add cmake option, just do:
#ifdef MIGRAPHX_DISABLE_AVAILABLE_GPU_MEMORY_CHECK
#define MIGRAPHX_DISABLE_AVAILABLE_GPU_MEMORY_CHECK 0
#endif
You can set the option in cmake by passing it to the CMAKE_CXX_FLAGS
.
@pfultz2 @causten We received an explanation from the HIP team that using |
87b2b80
to
32ea66e
Compare
Added an option to disable the hipMemGetInfo memory check on Windows when building MGX. By default, the check is enabled, but it can be turned off if desired.