You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: examples/omeinsum_julia/README.md
+10-7
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,18 @@ We provide two solutions:
7
7
* use subprocess to call a stand-alone julia script (**recommended**)
8
8
* use juliacall to integrate julia script into python (seems to be more elegant, but not recommended)
9
9
10
-
We highly recommend to use the first solution based on subprocess, not only due to its compatibility to julia multi-threading, but also because the experimental KaHyPar-based initialization is developed based on it.
10
+
We highly recommend using the first solution based on subprocess, not only due to its compatibility with julia's multi-threading but also because the experimental KaHyPar-based initialization is developed based on it.
11
11
12
12
## Experiments
13
13
14
14
We test contractors from OMEinsum on Google random circuits ([available online](https://datadryad.org/stash/dataset/doi:10.5061/dryad.k6t1rj8)) and compare with the cotengra contractor.
15
-
For circuits only differ in PRNG seed number (which means with the same tensor network structure, but different tensor entries), we choose the one with the largest seed. For example, we benchmark `circuit_n12_m14_s9_e6_pEFGH.qsim`, but skip
15
+
We choose the one with the largest seed for circuits that only differ in PRNG seed number (which means with the same tensor network structure but different tensor entries). For example, we benchmark `circuit_n12_m14_s9_e6_pEFGH.qsim` but skip
16
16
circuits like `circuit_n12_m14_s0_e6_pEFGH.qsim`.
17
17
We list experimental results in [benchmark_results.csv](benchmark_results.csv).
18
-
All experiments are done with a 32GB CPU machine with 16 cores.
18
+
All experiments are done with
19
+
1. a 32GB CPU machine with 16 cores
20
+
2. TensorCircuit with TensorFlow backend
21
+
3. without using jit
19
22
20
23
21
24
Specifically, we test the following three methods:
@@ -89,19 +92,19 @@ This solution calls a stand-alone julia script [omeinsum.jl](omeinsum.jl) for te
89
92
#### How to run
90
93
91
94
Run
92
-
`JULIA_NUM_THREADS=N python omeinsum_contractor_subprocess.py`. The env variable `JULIA_NUM_THREADS=N` will be passed to the julia script, so that you can enjoy the accelaration brought by julia multi-threading.
95
+
`JULIA_NUM_THREADS=N python omeinsum_contractor_subprocess.py`. The env variable `JULIA_NUM_THREADS=N` will be passed to the julia script, so that you can enjoy the acceleration brought by julia multi-threading.
93
96
94
97
95
98
#### KaHyPar initialization
96
99
97
100
The choice of initial status plays an important role in simulated annealing.
98
101
In a [discussion with the author of OMEinsum](https://github.com/TensorBFS/OMEinsumContractionOrders.jl/issues/35), we
99
-
found that there was a way to run TreeSA with initialzier other than greedy or random. We demo how KaHyPar can be used to produce the initial status of simulated annealing. Although we haven't seen significant improvement by using KaHyPar initialization, we believe it is a interesting topic to explore.
102
+
found that there was a way to run TreeSA with initializer other than greedy or random. We demo how KaHyPar can produce the initial status of simulated annealing. Although we have not seen significant improvement by using KaHyPar initialization, we believe it is an interesting topic to explore.
100
103
101
104
### JuliaCall solution (Not Recommended)
102
105
103
106
JuliaCall seems to be a more elegant solution because all related code are integrated into a single python script.
104
-
However, in order to use julia multi-threading in juliacall, we have to turn off julia GC at the risk of OOM. See see [this issue](https://github.com/cjdoris/PythonCall.jl/issues/219) for more details.
107
+
However, in order to use julia multi-threading in juliacall, we have to turn off julia GC at the risk of OOM. See [this issue](https://github.com/cjdoris/PythonCall.jl/issues/219) for more details.
0 commit comments