BUG: Fix typo in advise and prefetch affecting cuda 13#9493
Conversation
The struct is already the location, so this added one level. Strangely, Cython chooses to not fail compilation but rather raise a runtime error (pretending that this is a dict). Added a very simple test, but happy to iterate on it if it doesn't seem ideal. Just as a note: this API is documented as experimental.
|
/test mini |
|
Oops, the way these enum levels are defined means that they need an explicit cast (as in some other places here). /test mini |
|
Hmmm, is this something obvious? The call should be using |
|
I'm unsure but it seems managed memory have some limitations on Windows? |
|
This reproduced on my local Windows machine, so it's not CI specific. >>> import cupy
>>> from cupy.cuda import memory, stream as stream_module
>>> mem = memory.malloc_managed(1024)
>>> mem.mem.prefetch(stream_module.get_current_stream())
devPtr=8637120512 count=1024 dstDevice=0 stream=0
Traceback (most recent call last):
File "<python-input-3>", line 1, in <module>
mem.mem.prefetch(stream_module.get_current_stream())
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "cupy/cuda/memory.pyx", line 256, in cupy.cuda.memory.ManagedMemory.prefetch
runtime.memPrefetchAsync(self.ptr, self.size, device_id, stream.ptr)
File "cupy_backends/cuda/api/runtime.pyx", line 745, in cupy_backends.cuda.api.runtime.memPrefetchAsync
check_status(status)
File "cupy_backends/cuda/api/runtime.pyx", line 147, in cupy_backends.cuda.api.runtime.check_status
raise CUDARuntimeError(status)
cupy_backends.cuda.api.runtime.CUDARuntimeError: cudaErrorInvalidDevice: invalid device ordinal |
|
ahhh, thanks, that makes sense! Added a |
|
/test mini |
|
On Windows it seems |
|
/test mini 🤦 sorry I put the skip on the wrong test... |
Co-authored-by: Sebastian Berg <[email protected]>
|
Confirmed all tests passed for 5845cff /test skip |
The struct is already the location, so this added one level. Strangely, Cython chooses to not fail compilation but rather raise a runtime error (pretending that this is a dict).
Added a very simple test, but happy to iterate on it if it doesn't seem ideal.
Just as a note: this API is documented as experimental.