Skip to content
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

[ITensors] Simplify the rrules for priming and tagging MPS/MPO #950

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

mtfishman
Copy link
Member

No external changes, just a code simplification.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2022

Benchmark result

Judge result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmarks:
    • Target: 7 Jul 2022 - 15:20
    • Baseline: 7 Jul 2022 - 15:34
  • Package commits:
    • Target: bb7b88
    • Baseline: efacea
  • Julia commits:
    • Target: 742b9a
    • Baseline: 742b9a
  • Julia command flags:
    • Target: None
    • Baseline: None
  • Environment variables:
    • Target: None
    • Baseline: None

Results

A ratio greater than 1.0 denotes a possible regression (marked with ❌), while a ratio less
than 1.0 denotes a possible improvement (marked with ✅). Only significant results - results
that indicate possible regressions or improvements - are shown below (thus, an empty table means that all
benchmark results remained invariant between builds).

ID time ratio memory ratio
["contract", "matmul_100"] 1.12 (5%) ❌ 1.00 (1%)
["contract", "matmul_40"] 1.07 (5%) ❌ 1.00 (1%)
["contract", "matmul_60"] 1.13 (5%) ❌ 1.00 (1%)
["contract", "matmul_80"] 1.09 (5%) ❌ 1.00 (1%)
["contract", "matmul_inplace_100"] 1.08 (5%) ❌ 1.00 (1%)
["contract", "matmul_inplace_60"] 0.88 (5%) ✅ 1.00 (1%)
["getsetindex", "getindex end"] 0.87 (5%) ✅ 1.00 (1%)
["getsetindex", "getindex indval end"] 1.05 (5%) ❌ 1.00 (1%)
["getsetindex", "getindex"] 1.10 (5%) ❌ 1.00 (1%)
["getsetindex", "setindex! end"] 0.83 (5%) ✅ 1.00 (1%)
["getsetindex", "setindex!"] 0.91 (5%) ✅ 1.00 (1%)
["indexset", "constructor", "function, tuple"] 0.95 (5%) ✅ 1.00 (1%)
["indexset", "filter", "function"] 0.84 (5%) ✅ 1.00 (1%)
["indexset", "filter", "kwargs"] 0.83 (5%) ✅ 1.00 (1%)
["indexset", "set_functions", "commoninds, ITensor"] 1.13 (5%) ❌ 1.00 (1%)
["indexset", "set_functions", "unioninds, ITensor"] 1.06 (5%) ❌ 1.00 (1%)
["indexset", "set_functions", "uniqueinds", "filter_not_tags"] 0.90 (5%) ✅ 1.00 (1%)
["indexset", "set_functions", "uniqueinds", "nofilter2"] 0.93 (5%) ✅ 1.00 (1%)
["inplace", "axpy!"] 0.87 (5%) ✅ 1.00 (1%)
["tagset", "tagset_unicode"] 0.86 (5%) ✅ 1.00 (1%)

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Target

Julia Version 1.7.3
Commit 742b9abb4d (2022-05-06 12:58 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.13.0-1031-azure #37~20.04.1-Ubuntu SMP Mon Jun 13 22:51:01 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2095 MHz      11766 s          1 s       1609 s       1321 s          0 s
       #2  2095 MHz       3099 s          1 s        826 s      10759 s          0 s
       
  Memory: 6.783607482910156 GB (1479.91796875 MB free)
  Uptime: 1475.73 sec
  Load Avg:  1.0  1.09  1.0
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Baseline

Julia Version 1.7.3
Commit 742b9abb4d (2022-05-06 12:58 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.13.0-1031-azure #37~20.04.1-Ubuntu SMP Mon Jun 13 22:51:01 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2095 MHz      17974 s          1 s       2116 s       2873 s          0 s
       #2  2095 MHz       4930 s          1 s       1630 s      16376 s          0 s
       
  Memory: 6.783607482910156 GB (1808.0078125 MB free)
  Uptime: 2303.22 sec
  Load Avg:  1.0  1.07  1.06
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Target result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmark: 7 Jul 2022 - 15:20
  • Package commit: bb7b88
  • Julia commit: 742b9a
  • Julia command flags: None
  • Environment variables: None

Results

Below is a table of this job's results, obtained by running the benchmarks.
The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to
index into the BaseBenchmarks suite to retrieve the corresponding benchmarks.
The percentages accompanying time and memory values in the below table are noise tolerances. The "true"
time/memory value for a given benchmark is expected to fall within this percentage of the reported value.
An empty cell means that the value was zero.

ID time GC time memory allocations
["autompo", "Quartic Hamiltonian"] 52.594 s (5%) 6.786 s 11.15 GiB (1%) 154115523
["autompo", "Quartic QN Hamiltonian"] 74.601 s (5%) 10.693 s 20.56 GiB (1%) 211069516
["contract", "heff_2site"] 5.275 ms (5%) 19.41 MiB (1%) 305
["contract", "matmul_100"] 36.800 μs (5%) 80.47 KiB (1%) 15
["contract", "matmul_20"] 2.822 μs (5%) 5.55 KiB (1%) 14
["contract", "matmul_40"] 6.660 μs (5%) 14.92 KiB (1%) 14
["contract", "matmul_60"] 17.000 μs (5%) 30.47 KiB (1%) 15
["contract", "matmul_80"] 22.900 μs (5%) 52.34 KiB (1%) 15
["contract", "matmul_inplace_100"] 30.600 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_20"] 1.500 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_40"] 3.650 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_60"] 9.267 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_80"] 17.200 μs (5%) 1.25 KiB (1%) 10
["dmrg", "1d_S=1_heisenberg"] 21.627 s (5%) 1.035 s 38.81 GiB (1%) 1983963
["dmrg", "1d_S=1_heisenberg_qn"] 14.412 s (5%) 1.281 s 10.03 GiB (1%) 66905843
["getsetindex", "getindex end"] 219.942 ns (5%) 800 bytes (1%) 5
["getsetindex", "getindex indval end"] 74.168 ns (5%) 384 bytes (1%) 3
["getsetindex", "getindex indval"] 81.316 ns (5%) 400 bytes (1%) 3
["getsetindex", "getindex"] 21.206 ns (5%) 16 bytes (1%) 1
["getsetindex", "setindex! end"] 288.240 ns (5%) 1.14 KiB (1%) 6
["getsetindex", "setindex! indval end"] 123.199 ns (5%) 736 bytes (1%) 3
["getsetindex", "setindex! indval"] 123.217 ns (5%) 752 bytes (1%) 3
["getsetindex", "setindex!"] 80.191 ns (5%) 368 bytes (1%) 1
["indexset", "constructor", "function"] 655.500 ns (5%) 2.20 KiB (1%) 11
["indexset", "constructor", "function, tuple"] 433.171 ns (5%) 2.09 KiB (1%) 7
["indexset", "filter", "function"] 209.909 ns (5%) 1.77 KiB (1%) 1
["indexset", "filter", "function, tuple"] 79.237 ns (5%) 368 bytes (1%) 1
["indexset", "filter", "kwargs"] 222.670 ns (5%) 1.77 KiB (1%) 1
["indexset", "set_functions", "commoninds, ITensor"] 572.084 ns (5%) 2.84 KiB (1%) 5
["indexset", "set_functions", "noncommoninds, ITensor"] 593.458 ns (5%) 2.84 KiB (1%) 5
["indexset", "set_functions", "prime, ITensor"] 193.786 ns (5%) 1.08 KiB (1%) 3
["indexset", "set_functions", "unioninds, ITensor"] 840.750 ns (5%) 4.23 KiB (1%) 6
["indexset", "set_functions", "uniqueinds", "3_inputs"] 590.847 ns (5%) 3.48 KiB (1%) 9
["indexset", "set_functions", "uniqueinds", "filter_not_tags"] 349.754 ns (5%) 1.33 KiB (1%) 6
["indexset", "set_functions", "uniqueinds", "filter_tags"] 215.042 ns (5%) 976 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter0"] 141.398 ns (5%) 464 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter2"] 194.665 ns (5%) 976 bytes (1%) 2
["indexset", "set_functions", "uniqueinds, ITensor"] 654.559 ns (5%) 2.92 KiB (1%) 7
["inplace", "axpy!"] 15.701 μs (5%) 79.42 KiB (1%) 16
["op", "op QN"] 8.151 μs (5%) 12.48 KiB (1%) 110
["op", "op"] 4.938 μs (5%) 5.27 KiB (1%) 46
["tagset", "tagset"] 322.618 ns (5%) 336 bytes (1%) 5
["tagset", "tagset_long"] 379.298 ns (5%) 336 bytes (1%) 5
["tagset", "tagset_unicode"] 429.720 ns (5%) 336 bytes (1%) 5

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Julia Version 1.7.3
Commit 742b9abb4d (2022-05-06 12:58 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.13.0-1031-azure #37~20.04.1-Ubuntu SMP Mon Jun 13 22:51:01 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2095 MHz      11766 s          1 s       1609 s       1321 s          0 s
       #2  2095 MHz       3099 s          1 s        826 s      10759 s          0 s
       
  Memory: 6.783607482910156 GB (1479.91796875 MB free)
  Uptime: 1475.73 sec
  Load Avg:  1.0  1.09  1.0
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Baseline result

Benchmark Report for /home/runner/work/ITensors.jl/ITensors.jl

Job Properties

  • Time of benchmark: 7 Jul 2022 - 15:34
  • Package commit: efacea
  • Julia commit: 742b9a
  • Julia command flags: None
  • Environment variables: None

Results

Below is a table of this job's results, obtained by running the benchmarks.
The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to
index into the BaseBenchmarks suite to retrieve the corresponding benchmarks.
The percentages accompanying time and memory values in the below table are noise tolerances. The "true"
time/memory value for a given benchmark is expected to fall within this percentage of the reported value.
An empty cell means that the value was zero.

ID time GC time memory allocations
["autompo", "Quartic Hamiltonian"] 52.983 s (5%) 6.907 s 11.15 GiB (1%) 154115569
["autompo", "Quartic QN Hamiltonian"] 75.044 s (5%) 11.163 s 20.56 GiB (1%) 211069516
["contract", "heff_2site"] 5.229 ms (5%) 19.41 MiB (1%) 305
["contract", "matmul_100"] 32.801 μs (5%) 80.47 KiB (1%) 15
["contract", "matmul_20"] 2.722 μs (5%) 5.55 KiB (1%) 14
["contract", "matmul_40"] 6.220 μs (5%) 14.92 KiB (1%) 14
["contract", "matmul_60"] 15.000 μs (5%) 30.47 KiB (1%) 15
["contract", "matmul_80"] 21.000 μs (5%) 52.34 KiB (1%) 15
["contract", "matmul_inplace_100"] 28.300 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_20"] 1.450 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_40"] 3.663 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_60"] 10.500 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_80"] 16.800 μs (5%) 1.25 KiB (1%) 10
["dmrg", "1d_S=1_heisenberg"] 22.057 s (5%) 1.084 s 38.81 GiB (1%) 1983963
["dmrg", "1d_S=1_heisenberg_qn"] 14.956 s (5%) 1.362 s 10.03 GiB (1%) 66905843
["getsetindex", "getindex end"] 252.153 ns (5%) 800 bytes (1%) 5
["getsetindex", "getindex indval end"] 70.314 ns (5%) 384 bytes (1%) 3
["getsetindex", "getindex indval"] 79.229 ns (5%) 400 bytes (1%) 3
["getsetindex", "getindex"] 19.296 ns (5%) 16 bytes (1%) 1
["getsetindex", "setindex! end"] 346.574 ns (5%) 1.14 KiB (1%) 6
["getsetindex", "setindex! indval end"] 121.962 ns (5%) 736 bytes (1%) 3
["getsetindex", "setindex! indval"] 126.841 ns (5%) 752 bytes (1%) 3
["getsetindex", "setindex!"] 87.997 ns (5%) 368 bytes (1%) 1
["indexset", "constructor", "function"] 629.884 ns (5%) 2.20 KiB (1%) 11
["indexset", "constructor", "function, tuple"] 457.291 ns (5%) 2.09 KiB (1%) 7
["indexset", "filter", "function"] 248.766 ns (5%) 1.77 KiB (1%) 1
["indexset", "filter", "function, tuple"] 75.829 ns (5%) 368 bytes (1%) 1
["indexset", "filter", "kwargs"] 267.623 ns (5%) 1.77 KiB (1%) 1
["indexset", "set_functions", "commoninds, ITensor"] 506.500 ns (5%) 2.84 KiB (1%) 5
["indexset", "set_functions", "noncommoninds, ITensor"] 583.339 ns (5%) 2.84 KiB (1%) 5
["indexset", "set_functions", "prime, ITensor"] 200.780 ns (5%) 1.08 KiB (1%) 3
["indexset", "set_functions", "unioninds, ITensor"] 790.750 ns (5%) 4.23 KiB (1%) 6
["indexset", "set_functions", "uniqueinds", "3_inputs"] 606.885 ns (5%) 3.48 KiB (1%) 9
["indexset", "set_functions", "uniqueinds", "filter_not_tags"] 390.457 ns (5%) 1.33 KiB (1%) 6
["indexset", "set_functions", "uniqueinds", "filter_tags"] 214.778 ns (5%) 976 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter0"] 146.107 ns (5%) 464 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter2"] 209.655 ns (5%) 976 bytes (1%) 2
["indexset", "set_functions", "uniqueinds, ITensor"] 645.462 ns (5%) 2.92 KiB (1%) 7
["inplace", "axpy!"] 18.100 μs (5%) 79.42 KiB (1%) 16
["op", "op QN"] 8.200 μs (5%) 12.48 KiB (1%) 110
["op", "op"] 4.913 μs (5%) 5.27 KiB (1%) 46
["tagset", "tagset"] 319.598 ns (5%) 336 bytes (1%) 5
["tagset", "tagset_long"] 375.258 ns (5%) 336 bytes (1%) 5
["tagset", "tagset_unicode"] 500.006 ns (5%) 336 bytes (1%) 5

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["autompo"]
  • ["contract"]
  • ["dmrg"]
  • ["getsetindex"]
  • ["indexset", "constructor"]
  • ["indexset", "filter"]
  • ["indexset", "set_functions"]
  • ["indexset", "set_functions", "uniqueinds"]
  • ["inplace"]
  • ["op"]
  • ["tagset"]

Julia versioninfo

Julia Version 1.7.3
Commit 742b9abb4d (2022-05-06 12:58 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      Ubuntu 20.04.4 LTS
  uname: Linux 5.13.0-1031-azure #37~20.04.1-Ubuntu SMP Mon Jun 13 22:51:01 UTC 2022 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz: 
              speed         user         nice          sys         idle          irq
       #1  2095 MHz      17974 s          1 s       2116 s       2873 s          0 s
       #2  2095 MHz       4930 s          1 s       1630 s      16376 s          0 s
       
  Memory: 6.783607482910156 GB (1808.0078125 MB free)
  Uptime: 2303.22 sec
  Load Avg:  1.0  1.07  1.06
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)

Runtime information

Runtime Info
BLAS #threads 2
BLAS.vendor() openblas64
Sys.CPU_THREADS 2

lscpu output:

Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   46 bits physical, 48 bits virtual
CPU(s):                          2
On-line CPU(s) list:             0,1
Thread(s) per core:              1
Core(s) per socket:              2
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           85
Model name:                      Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Stepping:                        4
CPU MHz:                         2095.077
BogoMIPS:                        4190.15
Hypervisor vendor:               Microsoft
Virtualization type:             full
L1d cache:                       64 KiB
L1i cache:                       64 KiB
L2 cache:                        2 MiB
L3 cache:                        35.8 MiB
NUMA node0 CPU(s):               0,1
Vulnerability Itlb multihit:     KVM: Mitigation: VMX unsupported
Vulnerability L1tf:              Mitigation; PTE Inversion
Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT Host state unknown
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Mmio stale data:   Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Spec store bypass: Vulnerable
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Retpolines, STIBP disabled, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Mitigation; Clear CPU buffers; SMT Host state unknown
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xsaves md_clear
Cpu Property Value
Brand Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Vendor :Intel
Architecture :Skylake
Model Family: 0x06, Model: 0x55, Stepping: 0x04, Type: 0x00
Cores 2 physical cores, 2 logical cores (on executing CPU)
No Hyperthreading hardware capability detected
Clock Frequencies Not supported by CPU
Data Cache Level 1:3 : (32, 1024, 36608) kbytes
64 byte cache line size
Address Size 48 bits virtual, 46 bits physical
SIMD 512 bit = 64 byte max. SIMD vector size
Time Stamp Counter TSC is accessible via rdtsc
TSC increased at every clock cycle (non-invariant TSC)
Perf. Monitoring Performance Monitoring Counters (PMC) are not supported
Hypervisor Yes, Microsoft

@codecov-commenter
Copy link

Codecov Report

Merging #950 (bb7b883) into main (efacea7) will increase coverage by 0.09%.
The diff coverage is 88.23%.

❗ Current head bb7b883 differs from pull request most recent head 688bb06. Consider uploading reports for the commit 688bb06 to get more accurate results

@@            Coverage Diff             @@
##             main     #950      +/-   ##
==========================================
+ Coverage   67.02%   67.11%   +0.09%     
==========================================
  Files          88       88              
  Lines        9423     9388      -35     
==========================================
- Hits         6316     6301      -15     
+ Misses       3107     3087      -20     
Impacted Files Coverage Δ
src/ITensorChainRules/mps/mpo.jl 82.50% <66.66%> (ø)
src/ITensorChainRules/itensor.jl 67.17% <85.71%> (ø)
src/ITensorChainRules/indexset.jl 100.00% <100.00%> (+40.00%) ⬆️
src/ITensorChainRules/zygoterules.jl 75.00% <100.00%> (-8.34%) ⬇️
src/ITensorChainRules/ITensorChainRules.jl 84.61% <0.00%> (-7.70%) ⬇️
src/Deprecated/autompo/opsum.jl 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update efacea7...688bb06. Read the comment docs.

@mtfishman mtfishman merged commit 6a83a83 into main Jul 7, 2022
@mtfishman mtfishman deleted the ITensors_simplify_mps_index_ad branch July 7, 2022 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants