Repository navigation
Closed
Labels
bug 🐞Something isn't workinghal/vulkanRuntime Vulkan GPU HAL backendintegrationsRelating to high-level frontend integrations
Description
bazel test //integrations/tensorflow/e2e:e2e_tests_sliding_window_test__tf__iree_vulkan
Output:
[ RUN ] SlidingWindowTest.test_slidingwindow
[vk_mem_alloc.h : 16824] RAW: vmaCreateBuffer
[vk_mem_alloc.h : 14433] RAW: AllocateMemory: MemoryTypeIndex=9, AllocationCount=1, Size=256
[vk_mem_alloc.h : 11648] RAW: Returned from existing block #0
2020-07-24 21:55:48.253200: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:118] None of the MLIR optimization passes are enabled (registered 1)
[vk_mem_alloc.h : 16824] RAW: vmaCreateBuffer
[vk_mem_alloc.h : 14433] RAW: AllocateMemory: MemoryTypeIndex=10, AllocationCount=1, Size=256
[vk_mem_alloc.h : 11744] RAW: Created new block Size=8388608
[vk_mem_alloc.h : 16824] RAW: vmaCreateBuffer
[vk_mem_alloc.h : 14433] RAW: AllocateMemory: MemoryTypeIndex=9, AllocationCount=1, Size=256
[vk_mem_alloc.h : 11648] RAW: Returned from existing block #0
[vk_mem_alloc.h : 16824] RAW: vmaCreateBuffer
[vk_mem_alloc.h : 14433] RAW: AllocateMemory: MemoryTypeIndex=7, AllocationCount=1, Size=256
[vk_mem_alloc.h : 11744] RAW: Created new block Size=8388608
[vk_mem_alloc.h : 16824] RAW: vmaCreateBuffer
[vk_mem_alloc.h : 14433] RAW: AllocateMemory: MemoryTypeIndex=7, AllocationCount=1, Size=256
[vk_mem_alloc.h : 11648] RAW: Returned from existing block #0
[vk_mem_alloc.h : 16934] RAW: vmaDestroyBuffer
[vk_mem_alloc.h : 11934] RAW: Freed from MemoryTypeIndex=7
[vk_mem_alloc.h : 16934] RAW: vmaDestroyBuffer
[vk_mem_alloc.h : 11934] RAW: Freed from MemoryTypeIndex=7
[vk_mem_alloc.h : 16934] RAW: vmaDestroyBuffer
[vk_mem_alloc.h : 11934] RAW: Freed from MemoryTypeIndex=9
[vk_mem_alloc.h : 16934] RAW: vmaDestroyBuffer
[vk_mem_alloc.h : 11934] RAW: Freed from MemoryTypeIndex=10
[vk_mem_alloc.h : 16824] RAW: vmaCreateBuffer
[vk_mem_alloc.h : 14433] RAW: AllocateMemory: MemoryTypeIndex=10, AllocationCount=1, Size=256
[vk_mem_alloc.h : 11648] RAW: Returned from existing block #0
[vk_mem_alloc.h : 16824] RAW: vmaCreateBuffer
[vk_mem_alloc.h : 14433] RAW: AllocateMemory: MemoryTypeIndex=9, AllocationCount=1, Size=256
[vk_mem_alloc.h : 11648] RAW: Returned from existing block #0
[vk_mem_alloc.h : 16824] RAW: vmaCreateBuffer
[vk_mem_alloc.h : 14433] RAW: AllocateMemory: MemoryTypeIndex=7, AllocationCount=1, Size=256
[vk_mem_alloc.h : 11648] RAW: Returned from existing block #0
[vk_mem_alloc.h : 16824] RAW: vmaCreateBuffer
[vk_mem_alloc.h : 14433] RAW: AllocateMemory: MemoryTypeIndex=7, AllocationCount=1, Size=256
[vk_mem_alloc.h : 11648] RAW: Returned from existing block #0
[vk_mem_alloc.h : 16934] RAW: vmaDestroyBuffer
[vk_mem_alloc.h : 11934] RAW: Freed from MemoryTypeIndex=7
[vk_mem_alloc.h : 16934] RAW: vmaDestroyBuffer
[vk_mem_alloc.h : 11934] RAW: Freed from MemoryTypeIndex=7
[vk_mem_alloc.h : 16934] RAW: vmaDestroyBuffer
[vk_mem_alloc.h : 11934] RAW: Freed from MemoryTypeIndex=10
[vk_mem_alloc.h : 16934] RAW: vmaDestroyBuffer
[vk_mem_alloc.h : 11934] RAW: Freed from MemoryTypeIndex=9
SystemContext driver=<pyiree.rt.binding.HalDriver object at 0x7fd750f6bf80>
INFO:tensorflow:time(__main__.SlidingWindowTest.test_slidingwindow): 0.07s
I0724 21:55:48.291506 140564544591680 test_util.py:1973] time(__main__.SlidingWindowTest.test_slidingwindow): 0.07s
[ OK ] SlidingWindowTest.test_slidingwindow
----------------------------------------------------------------------
Ran 2 tests in 2.087s
OK (skipped=1)
[vk_mem_alloc.h : 16934] RAW: vmaDestroyBuffer
[vk_mem_alloc.h : 11934] RAW: Freed from MemoryTypeIndex=9
*** Received signal 11 ***
*** BEGIN MANGLED STACK TRACE ***
/usr/local/lib/python3.6/dist-packages/tensorflow/python/../libtensorflow_framework.so.2(+0x10c561d)[0x7fd759ea861d]
/lib/x86_64-linux-gnu/libc.so.6(+0x3efd0)[0x7fd7bb634fd0]
/lib/x86_64-linux-gnu/libpthread.so.0(pthread_mutex_lock+0x0)[0x7fd7bb3e0fa0]
/usr/lib/x86_64-linux-gnu/libEGL_mesa.so.0(+0xaca5)[0x7fd658313ca5]
/usr/lib/x86_64-linux-gnu/libEGL.so.1(eglReleaseThread+0x8b)[0x7fd6f01c56fb]
/usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.0(+0x9cdb7)[0x7fd750120db7]
*** END MANGLED STACK TRACE ***
*** Begin stack trace ***
tensorflow::CurrentStackTrace()
pthread_mutex_lock
eglReleaseThread
*** End stack trace ***
I haven't looked into why. Possibly a regression somewhere. See https://source.cloud.google.com/results/invocations/af857e58-a9a0-48af-a4d4-c1d273501c55/targets/iree%2Fgcp_ubuntu%2Fbazel%2Flinux%2Fx86-turing%2Fintegrations%2Fpresubmit/log for the buildbot run.
Disabling this for now to land Bazel + Cloud GPU CI check.
Metadata
Metadata
Assignees
Labels
bug 🐞Something isn't workinghal/vulkanRuntime Vulkan GPU HAL backendintegrationsRelating to high-level frontend integrations
Activity
GMNGeoffrey commentedon Aug 7, 2020
We're seeing this issue in a bunch of tests running on real GPUs now: https://source.cloud.google.com/results/invocations/d5557cee-daca-4dda-8bf4-36a06ec37f9f
Bisect indicated it was somehow caused by 6d32fe8
Here's the failing invocation from that commit: https://source.cloud.google.com/results/invocations/11a2a936-b909-4eb1-bcd5-30377089be59/targets
And the passing one from the commit before (7fea2dd):
https://source.cloud.google.com/results/invocations/45bafd16-1b72-4ea4-aa29-747e7a0f6b26
@phoenix-meadowlark investigated but can't see any relation to that change (and I can't either):
I think this is a bug elsewhere that was tickled somehow
@hanhanW @antiagainst @MaheshRavishankar any ideas?
antiagainst commentedon Aug 7, 2020
Thanks @phoenix-meadowlark for looking into this! Very much appreciated. I think there is a deep issue involving the TensorFlow/Python wrapping, IREE core refcount and life cycle, and GPU driver unloading. I tried to repro the issue with iree-run-module over the generated vmfb, but in vain. It works there. I will try to look deeper, but not sure how far I can go before leaving. Scott or Ben might be able to pick up if I cannot make it.
hanhanW commentedon Aug 7, 2020
I think there are too many things get involved. I'd start with using iree-run-module, and maybe build with ASAN/MSAN config. How do we build IREE tools with ASAN/MSAN config?
antiagainst commentedon Aug 7, 2020
Good point, @hanhanW. I haven't tried ASAN/MSAN yet; it might indeed reveal something. Being able to repro without the Python layer will make it much simpler.
GMNGeoffrey commentedon Aug 7, 2020
--config=asan:-)hanhanW commentedon Aug 8, 2020
oh, so that also works with CMake. ; )
GMNGeoffrey commentedon Aug 8, 2020
Ah... no :-D
The asan config for Bazel is here: https://github.com/google/iree/blob/main/build_tools/bazel/iree.bazelrc#L140-L159
You could try some of those same options with cmake. The critical one is
-fsanitize=addressas a compilation and linking option. You probably want some of the others also. Here are the general docs: https://clang.llvm.org/docs/AddressSanitizer.html#usagebenvanik commentedon Aug 8, 2020
Can confirm I've manually hacked in -fsanitize=address to iree_copts.cmake and had it work. Would be nice to fully support that (and have a CI run with it enabled).
antiagainst commentedon Aug 8, 2020
Yeah. Let's support them in CMake too: #2832.
GMNGeoffrey commentedon Aug 11, 2020
So for now, having a failing build isn't great. How should we proceed while we diagnose this?
3 is the right thing to do, but requires the most configuration
hanhanW commentedon Aug 11, 2020
Would be good if we can go with (3). (2) is acceptable to me, since it still run on internal infra using swiftshader.
antiagainst commentedon Aug 11, 2020
+1 to have a more fine-grained excluding mechanism. In the meanwhile, I'm fine turning of bazel NVIDIA build. Let's don't exclude the tests entirely. Getting covered by SwiftShader guards us from seeing functionality regressions.
GMNGeoffrey commentedon Aug 11, 2020
Ok I will turn it off for now. If someone can investigate this bug, I will investigate a finer-grained exclusion mechanism
hanhanW commentedon Aug 11, 2020
I will investigate this bug.
antiagainst commentedon Aug 11, 2020
Thanks @hanhanW! I will also keep looking into this; but cannot guarantee on the effort. So having more eyes over this is certainly very helpful. I'd suggest to also cross check with #2833; they bear some similarity. (Not saying they are resulting from the same issue for sure; but if that's the case that would be awesome.)
GMNGeoffrey commentedon Aug 11, 2020
Ok I have disabled the build and will look into if we can only exclude only some of the TF tests from GPU. Note that we do still have real GPU coverage for everything buildable on the cmake side.
hanhanW commentedon Aug 12, 2020
I dumped the module file, and can't reproduce with
iree-run-module.Tried running on SwiftShader and physical GPU. It's passing on SwiftShader. However, the order of the log looks weird to me. I think the last two logs should locate before OK or something else?
===
Running on physical GPU with
iree-run-module, we can get the log like:It seems that the second vmaDestroyBuffer to last is for output buffer, ie, result[0]: Buffer<float32[1x3x2]>. Any idea for the last buffer?
Running with
bazel, the log is:Looks like the crashing happens in
Freed from MemoryTypeIndex=9because even in SwiftShader there is no[vk_mem_alloc.h : 15787] RAW: vmaDestroyAllocatorin the end.Would be great if we can get more context for the last freed buffer.
GMNGeoffrey commentedon Aug 15, 2020
This was fixed by #2899. There still appears to be an issue with python ref counting (#2900), but these tests are now passing and running on postsubmit
Revert "[ci] Allow parallel testing on NVIDIA GPUs" (#5496)