Skip to content
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

[WIP] Force the use of managed memory. #401

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nouiz
Copy link
Member

@nouiz nouiz commented Apr 11, 2017

TODO: Make a user option of this.

I tested it with oversubsbriding on a DGX-1 and check_blas now pass with M,N,K == 30k while it wasn't before this PR. So it allow some oversubscribing.

@nouiz nouiz changed the title Force the use of managed memory. [WIP] Force the use of managed memory. Apr 11, 2017
@nouiz
Copy link
Member Author

nouiz commented Apr 11, 2017

@abergeron how do you suggest to give the run time option to the user? Could this information be in the context and passed at context init?

@@ -30,6 +30,7 @@ DEF_PROC_V2(cuMemGetInfo, (size_t *free, size_t *total));
DEF_PROC_V2(cuMemAlloc, (CUdeviceptr *dptr, size_t bytesize));
DEF_PROC_V2(cuMemFree, (CUdeviceptr dptr));
DEF_PROC_V2(cuMemAllocHost, (void **pp, size_t bytesize));
DEF_PROC(cuMemAllocManaged, (CUdeviceptr* dptr, size_t bytesize, unsigned int flags));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to use DEF_PROC_V2 here and it failed. Why? How this work? I followed the code but didn't understood.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found why.

@abergeron
Copy link
Member

Since this doesn't seem to make a difference in speed (if you don't oversubscribe) I'm inclined to enable this by default.

However @nouiz wants to have some sort of user warning if you actually exceed the memory available on the gpu to warn about potential slowdown. This could be a simple fprintf(), but I dislike chatty libraries for things that are rather common.

@nouiz
Copy link
Member Author

nouiz commented Apr 12, 2017 via email

@nouiz
Copy link
Member Author

nouiz commented Apr 12, 2017

I tested on an 750. The speed was about the same, but I wasn't able to allocate as much memory! So we can't activate this by default.

@nouiz
Copy link
Member Author

nouiz commented Apr 18, 2017

@abergeron told that maybe we could use it automatically/always only for Pascal GPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants