-
Notifications
You must be signed in to change notification settings - Fork 196
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
crash in test_runtime_dm #609
Comments
I built LLVM and cuda-quantum in Debug mode, and this is what I see:
|
Hi Marcus - I was able to reproduce your failure. I think it has something to do with this being the first test running after the noise tests. For example, I can also reproduce the problem running just 2 tests, like this: unittests/test_runtime_dm --gtest_filter=dm_NoiseTest.checkPhaseFlipType:dm_GetStateTester.checkSimple I think we need to add For example, as a quick test, I added this patch, and the problem went away for me. Can you confirm that this fixes the problem in your environment, too? If so, we'll get a patch going soon. --- a/unittests/integration/get_state_tester.cpp
+++ b/unittests/integration/get_state_tester.cpp
@@ -21,6 +21,8 @@ CUDAQ_TEST(GetStateTester, checkSimple) {
cx(q, r);
};
+ cudaq::unset_noise();
+
auto state = cudaq::get_state(kernel);
state.dump();
#ifdef CUDAQ_BACKEND_DM Also, we typically run our tests using |
I still get the realloc(): invalid pointer crash, and correctness of the unit tests is the same at 79%. |
What version of LLVM is preferred?
On Sep 7, 2023, at 2:11 PM, Ben Howe ***@***.***> wrote:
Hi Marcus - I was able to reproduce your failure. I think it has something to do with this being the first test running after the noise tests. For example, I can also reproduce the problem running just 2 tests, like this:
unittests/test_runtime_dm --gtest_filter=dm_NoiseTest.checkPhaseFlipType:dm_GetStateTester.checkSimple
I think we need to add cudaq::unset_noise(); either as cleanup after the noise tests or do that in the initialization of all tests.
For example, as a quick test, I added this patch, and the problem went away for me. Can you confirm that this fixes the problem in your environment, too? If so, we'll get a patch going soon.
…--- a/unittests/integration/get_state_tester.cpp
+++ b/unittests/integration/get_state_tester.cpp
@@ -21,6 +21,8 @@ CUDAQ_TEST(GetStateTester, checkSimple) {
cx(q, r);
};
+ cudaq::unset_noise();
+
auto state = cudaq::get_state(kernel);
state.dump();
#ifdef CUDAQ_BACKEND_DM
Also, we typically run our tests using ctest. For example, you can run the dm tests using this command: ctest -R "^dm_". Your way should also work, too, so I'm trying to say we shouldn't fix it ... I just wanted to give you other options in case you weren't aware of them.
—
Reply to this email directly, view it on GitHub<#609 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AACVVP6FENWOPVEMIHPQSMLXZI2BNANCNFSM6AAAAAA4NSQE64>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Our project is designed to be running with the same LLVM as is in the repo (tpls/llvm), which is currently this. It is not a named release version, but it's slightly before LLVM 16. Are you using a Docker image to test this? |
Oh, I thought I could use a stock LLVM. All from-source.
On Sep 7, 2023, at 3:32 PM, Ben Howe ***@***.***> wrote:
Our project is designed to be running with the same LLVM as is in the repo (tpls/llvm), which is currently this<https://github.com/llvm/llvm-project/tree/c0b45fef155fbe3f17f9a6f99074682c69545488>. It is not a named release version, but it's slightly before LLVM 16. Are you using a Docker image to test this?
—
Reply to this email directly, view it on GitHub<#609 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AACVVP5AWY6CMRA32NELJGDXZJDPTANCNFSM6AAAAAA4NSQE64>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Perhaps @schweitzpgi can weigh in to confirm or deny, but I thought it had to be aligned with the LLVM submodule in our repo. In any case, it's very strange that we both saw similar errors in similar spots, but the fix for my environment didn't change anything for yours. You probably did this, but just to confirm .... did you go into the |
The project is stuck in a holding pattern at LLVM 16.x still. I believe some people have used downloads of prebuilt. official LLVM 16 with some success. The container image is built against the pre-16 LLVM that can be found in I will open an issue (if there isn't one) to at least bump the container/CI environment up to the officially released LLVM 16. |
Switching to the tpls/llvm did prevent the unittest errors.
Thanks,
Marcus
From: Eric Schweitz ***@***.***>
Date: Friday, September 8, 2023 at 5:04 PM
To: NVIDIA/cuda-quantum ***@***.***>
Cc: Marcus Daniels ***@***.***>, Author ***@***.***>
Subject: Re: [NVIDIA/cuda-quantum] crash in test_runtime_dm (Issue #609)
Perhaps @schweitzpgi<https://github.com/schweitzpgi> can weigh in to confirm or deny, but I thought it had to be aligned with the LLVM submodule in our repo.
The project is stuck in a holding pattern at LLVM 16.x still. I believe some people have used downloads of prebuilt. official LLVM 16 with some success. The container image is built against the pre-16 LLVM that can be found in tpls/llvm.
I will open an issue (if there isn't one) to at least bump the container/CI environment up to the officially released LLVM 16.
—
Reply to this email directly, view it on GitHub<#609 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AACVVP7SNZBS6A7GOKQFHO3XZOW67ANCNFSM6AAAAAA4NSQE64>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Issue discovered while investigating Issue NVIDIA#609
Issue discovered while investigating Issue NVIDIA#609
This helps fix issue #609 by unsetting noise models at the end of noise tests. Without this change, the prior test's noise model could be used in subsequent tests, which is undesirable.
This helps fix issue NVIDIA#609 by unsetting noise models at the end of noise tests. Without this change, the prior test's noise model could be used in subsequent tests, which is undesirable.
Required prerequisites
Describe the bug
The unit test test_runtime_dm does this on Ubuntu 22.04
mdaniels@daniels:~/src/cuda-quantum/build/unittests$ ./test_runtime_dm
[==========] Running 67 tests from 21 test suites.
[----------] Global test environment set-up.
[----------] 2 tests from dm_AdjointTester
[ RUN ] dm_AdjointTester.checkSimple
{ 0:1000 }
{ 00000:1000 }
{ 0:1000 }
{ 00:1000 }
{ 101:1000 }
[ OK ] dm_AdjointTester.checkSimple (71 ms)
[ RUN ] dm_AdjointTester.checkNestedAdjoint
{ 000:233 010:188 111:99 001:4 011:69 100:237 101:25 110:145 }
[ OK ] dm_AdjointTester.checkNestedAdjoint (6 ms)
[----------] 2 tests from dm_AdjointTester (78 ms total)
[----------] 17 tests from dm_BuilderTester
[ RUN ] dm_BuilderTester.checkSimple
realloc(): invalid pointer
Aborted (core dumped)
Steps to reproduce the bug
went into build directory and unittests and ran ./test_runtime_dm
Expected behavior
passing test
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression -- first time I have built cuda-quantum.
Environment
Suggestions
No response
The text was updated successfully, but these errors were encountered: