quantum-compiler / quartz

The Quartz Quantum Compiler
Apache License 2.0
76 stars 19 forks source link

openmp error #180

Open ScottWe opened 2 weeks ago

ScottWe commented 2 weeks ago

I am trying to run verify_equivalences.py using the test file data.json. However, I get the following error:

OMP: Error #13: Assertion failure at kmp_affinity.cpp(622).
OMP: Hint Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see http://www.intel.com/software/products/support/.
Aborted (core dumped)

I am running on linux, with Python 3.1.9, Conda 24.5.9, and openmp-8.0.1. Note that I wasn't able to run conda install openmp and had to use conda install oconda-forge::openmp instead.

xumingkuan commented 2 weeks ago

I suspect that Python 3.1.9 is a version that is too old. Can you try some version between Python 3.7 and Python 3.11?

xumingkuan commented 2 weeks ago

Also, how did you get the file data.json?

ScottWe commented 2 weeks ago

Hi @xumingkuan, thank you for the help! I can reproduce the error with Python 3.11.9.

The data.json file is from test_generator in src/test/test_generator.h.

xumingkuan commented 2 weeks ago

Could you please tell me the arguments for test_generator and whether the header of the data.json file looks correct?

For example, I just tried test_generator({GateType::x, GateType::y, GateType::cx, GateType::h}, 3, 0, 0, false, "data.json");

and I got

[
[[0], [0]],
{
"6418a688d81f": [
[[3,0,["6418a688d820"],[-1.59725329897103474e-01,-1.51453041115068326e-01]], []]
]
}
]

verify_equivalences.py then outputs

Considering a total of 1 circuits split into 1 hash values...
Processed 1 hash values that had only 1 circuit sequence, now processing the remaining 0 ones with 2 or more circuit sequences...
Start checking equivalence with different hash...
Solver invoked 0 times to find 0 equivalences with different hash, including 0 out of 0 possible equivalences under phase shift.
0 equivalences found in 0.017588923999937833 seconds (solver invoked 0 times for 1 DAGs with 1 different hash values and 0 potential equivalences), output 1 equivalence classes.
Json saved in 0.00017850699987320695 seconds.

Also, I have never seen an OpenMP error like that. My OpenMP packages are:

# packages in environment at /home/mingkuax/anaconda3/envs/quartz:
#
# Name                    Version                   Build  Channel
_openmp_mutex             5.1                       1_gnu  
llvm-openmp               8.0.1                hc9558a2_0    conda-forge
openmp                    8.0.1                         0    conda-forge

What are the OpenMP packages installed on your side?

ScottWe commented 2 weeks ago

You were right about the openmp packages. I'm not sure why, but my env had intel-openmp installed as well. When I removed this, everything worked. Thank you!