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

Write to disk for ProjMPOSum (DiskProjMPOSum) #1043

Merged
merged 3 commits into from Jan 24, 2023
Merged

Conversation

emstoudenmire
Copy link
Collaborator

Description

Fixes the request by Steve W. on the forum at this link. This fix is minimal, and intentially just follows a combination of the current styles used for DiskProjMPO and ProjMPOSum. (I mention this because while I could have updated ProjMPOSum to use the AbstractProjMPO interface, this whole subsystem is slated for a redesign anyway. I'd be ok with submitting a new PR in the near future updating these to use the Abstract interface.)

How Has This Been Tested?

Added a small new unit test that runs DMRG on a sum of two Hamiltonians and uses write_when_maxdim_exceeds.

Checklist:

  • My code follows the style guidelines of this project. Please run using JuliaFormatter; format(".") in the base directory of the repository (~/.julia/dev/ITensors) to format your code according to our style guidelines.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that verify the behavior of the changes I made.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.

@github-actions
Copy link
Contributor

Benchmark result

Judge result

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

Job Properties

  • Time of benchmarks:
    • Target: 24 Jan 2023 - 07:01
    • Baseline: 24 Jan 2023 - 07:22
  • Package commits:
    • Target: 772105
    • Baseline: b16307
  • Julia commits:
    • Target: 17cfb8
    • Baseline: 17cfb8
  • 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
["getsetindex", "getindex end"] 0.95 (5%) ✅ 1.00 (1%)
["getsetindex", "getindex"] 1.06 (5%) ❌ 1.00 (1%)
["getsetindex", "setindex! indval end"] 1.05 (5%) ❌ 1.00 (1%)
["getsetindex", "setindex! indval"] 1.05 (5%) ❌ 1.00 (1%)
["indexset", "set_functions", "uniqueinds, ITensor"] 1.05 (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.8.5
Commit 17cfb8e65ea (2023-01-08 06:45 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
      Ubuntu 22.04.1 LTS
  uname: Linux 5.15.0-1031-azure #38-Ubuntu SMP Mon Jan 9 12:49:59 UTC 2023 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz: 
              speed         user         nice          sys         idle          irq
       #1  2793 MHz      19235 s          0 s        819 s       6687 s          0 s
       #2  2793 MHz       4047 s          0 s        716 s      21927 s          0 s
  Memory: 6.781219482421875 GB (2126.98046875 MB free)
  Uptime: 2679.79 sec
  Load Avg:  1.0  1.0  0.99
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, icelake-server)
  Threads: 1 on 2 virtual cores

Baseline

Julia Version 1.8.5
Commit 17cfb8e65ea (2023-01-08 06:45 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
      Ubuntu 22.04.1 LTS
  uname: Linux 5.15.0-1031-azure #38-Ubuntu SMP Mon Jan 9 12:49:59 UTC 2023 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz: 
              speed         user         nice          sys         idle          irq
       #1  2793 MHz      19347 s          0 s        859 s      19387 s          0 s
       #2  2793 MHz      16013 s          0 s       1554 s      22021 s          0 s
  Memory: 6.781219482421875 GB (1725.890625 MB free)
  Uptime: 3970.93 sec
  Load Avg:  1.0  1.0  1.0
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, icelake-server)
  Threads: 1 on 2 virtual cores

Target result

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

Job Properties

  • Time of benchmark: 24 Jan 2023 - 7:1
  • Package commit: 772105
  • Julia commit: 17cfb8
  • 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"] 338.002 s (5%) 6.062 s 20.51 GiB (1%) 170312952
["autompo", "Quartic QN Hamiltonian"] 69.196 s (5%) 8.871 s 21.63 GiB (1%) 227267341
["contract", "heff_2site"] 6.903 ms (5%) 19.41 MiB (1%) 196
["contract", "matmul_100"] 36.900 μs (5%) 80.47 KiB (1%) 15
["contract", "matmul_20"] 2.122 μs (5%) 5.55 KiB (1%) 14
["contract", "matmul_40"] 3.971 μs (5%) 14.92 KiB (1%) 14
["contract", "matmul_60"] 10.999 μs (5%) 30.47 KiB (1%) 15
["contract", "matmul_80"] 16.500 μs (5%) 52.34 KiB (1%) 15
["contract", "matmul_inplace_100"] 33.699 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_20"] 1.150 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_40"] 2.844 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_60"] 9.400 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_80"] 14.800 μs (5%) 1.25 KiB (1%) 10
["dmrg", "1d_S=1_heisenberg"] 22.422 s (5%) 655.623 ms 38.86 GiB (1%) 1915625
["dmrg", "1d_S=1_heisenberg_qn"] 9.410 s (5%) 780.499 ms 9.79 GiB (1%) 55410408
["getsetindex", "getindex end"] 224.390 ns (5%) 800 bytes (1%) 5
["getsetindex", "getindex indval end"] 67.074 ns (5%) 384 bytes (1%) 3
["getsetindex", "getindex indval"] 74.409 ns (5%) 400 bytes (1%) 3
["getsetindex", "getindex"] 24.372 ns (5%) 16 bytes (1%) 1
["getsetindex", "setindex! end"] 323.377 ns (5%) 1.14 KiB (1%) 6
["getsetindex", "setindex! indval end"] 118.339 ns (5%) 736 bytes (1%) 3
["getsetindex", "setindex! indval"] 117.742 ns (5%) 752 bytes (1%) 3
["getsetindex", "setindex!"] 80.888 ns (5%) 368 bytes (1%) 1
["indexset", "constructor", "function"] 701.361 ns (5%) 2.20 KiB (1%) 11
["indexset", "constructor", "function, tuple"] 439.896 ns (5%) 2.09 KiB (1%) 7
["indexset", "filter", "function"] 232.960 ns (5%) 1.77 KiB (1%) 1
["indexset", "filter", "function, tuple"] 64.944 ns (5%) 368 bytes (1%) 1
["indexset", "filter", "kwargs"] 202.165 ns (5%) 1.77 KiB (1%) 1
["indexset", "set_functions", "commoninds, ITensor"] 486.598 ns (5%) 2.84 KiB (1%) 5
["indexset", "set_functions", "noncommoninds, ITensor"] 535.829 ns (5%) 2.84 KiB (1%) 5
["indexset", "set_functions", "prime, ITensor"] 164.975 ns (5%) 1.08 KiB (1%) 3
["indexset", "set_functions", "unioninds, ITensor"] 665.605 ns (5%) 4.23 KiB (1%) 6
["indexset", "set_functions", "uniqueinds", "3_inputs"] 605.051 ns (5%) 3.48 KiB (1%) 9
["indexset", "set_functions", "uniqueinds", "filter_not_tags"] 328.571 ns (5%) 1.23 KiB (1%) 4
["indexset", "set_functions", "uniqueinds", "filter_tags"] 217.964 ns (5%) 976 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter0"] 146.761 ns (5%) 464 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter2"] 166.667 ns (5%) 976 bytes (1%) 2
["indexset", "set_functions", "uniqueinds, ITensor"] 692.407 ns (5%) 2.92 KiB (1%) 7
["inplace", "axpy!"] 16.900 μs (5%) 79.42 KiB (1%) 16
["op", "op QN"] 7.375 μs (5%) 11.63 KiB (1%) 96
["op", "op"] 4.129 μs (5%) 5.52 KiB (1%) 43
["tagset", "tagset"] 224.477 ns (5%) 144 bytes (1%) 1
["tagset", "tagset_long"] 290.633 ns (5%) 144 bytes (1%) 1
["tagset", "tagset_unicode"] 326.786 ns (5%) 144 bytes (1%) 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

Julia Version 1.8.5
Commit 17cfb8e65ea (2023-01-08 06:45 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
      Ubuntu 22.04.1 LTS
  uname: Linux 5.15.0-1031-azure #38-Ubuntu SMP Mon Jan 9 12:49:59 UTC 2023 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz: 
              speed         user         nice          sys         idle          irq
       #1  2793 MHz      19235 s          0 s        819 s       6687 s          0 s
       #2  2793 MHz       4047 s          0 s        716 s      21927 s          0 s
  Memory: 6.781219482421875 GB (2126.98046875 MB free)
  Uptime: 2679.79 sec
  Load Avg:  1.0  1.0  0.99
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, icelake-server)
  Threads: 1 on 2 virtual cores

Baseline result

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

Job Properties

  • Time of benchmark: 24 Jan 2023 - 7:22
  • Package commit: b16307
  • Julia commit: 17cfb8
  • 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"] 353.131 s (5%) 6.277 s 20.51 GiB (1%) 170312965
["autompo", "Quartic QN Hamiltonian"] 69.866 s (5%) 8.953 s 21.63 GiB (1%) 227267333
["contract", "heff_2site"] 6.991 ms (5%) 19.41 MiB (1%) 196
["contract", "matmul_100"] 37.500 μs (5%) 80.47 KiB (1%) 15
["contract", "matmul_20"] 2.222 μs (5%) 5.55 KiB (1%) 14
["contract", "matmul_40"] 4.043 μs (5%) 14.92 KiB (1%) 14
["contract", "matmul_60"] 11.000 μs (5%) 30.47 KiB (1%) 15
["contract", "matmul_80"] 17.000 μs (5%) 52.34 KiB (1%) 15
["contract", "matmul_inplace_100"] 33.700 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_20"] 1.150 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_40"] 2.856 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_60"] 9.599 μs (5%) 1.25 KiB (1%) 10
["contract", "matmul_inplace_80"] 14.899 μs (5%) 1.25 KiB (1%) 10
["dmrg", "1d_S=1_heisenberg"] 22.732 s (5%) 711.754 ms 38.86 GiB (1%) 1915625
["dmrg", "1d_S=1_heisenberg_qn"] 9.552 s (5%) 770.754 ms 9.79 GiB (1%) 55410250
["getsetindex", "getindex end"] 236.382 ns (5%) 800 bytes (1%) 5
["getsetindex", "getindex indval end"] 70.133 ns (5%) 384 bytes (1%) 3
["getsetindex", "getindex indval"] 74.203 ns (5%) 400 bytes (1%) 3
["getsetindex", "getindex"] 22.969 ns (5%) 16 bytes (1%) 1
["getsetindex", "setindex! end"] 323.372 ns (5%) 1.14 KiB (1%) 6
["getsetindex", "setindex! indval end"] 112.406 ns (5%) 736 bytes (1%) 3
["getsetindex", "setindex! indval"] 111.613 ns (5%) 752 bytes (1%) 3
["getsetindex", "setindex!"] 79.442 ns (5%) 368 bytes (1%) 1
["indexset", "constructor", "function"] 716.327 ns (5%) 2.20 KiB (1%) 11
["indexset", "constructor", "function, tuple"] 443.005 ns (5%) 2.09 KiB (1%) 7
["indexset", "filter", "function"] 228.475 ns (5%) 1.77 KiB (1%) 1
["indexset", "filter", "function, tuple"] 63.424 ns (5%) 368 bytes (1%) 1
["indexset", "filter", "kwargs"] 193.333 ns (5%) 1.77 KiB (1%) 1
["indexset", "set_functions", "commoninds, ITensor"] 490.722 ns (5%) 2.84 KiB (1%) 5
["indexset", "set_functions", "noncommoninds, ITensor"] 528.342 ns (5%) 2.84 KiB (1%) 5
["indexset", "set_functions", "prime, ITensor"] 165.609 ns (5%) 1.08 KiB (1%) 3
["indexset", "set_functions", "unioninds, ITensor"] 650.955 ns (5%) 4.23 KiB (1%) 6
["indexset", "set_functions", "uniqueinds", "3_inputs"] 583.146 ns (5%) 3.48 KiB (1%) 9
["indexset", "set_functions", "uniqueinds", "filter_not_tags"] 320.536 ns (5%) 1.23 KiB (1%) 4
["indexset", "set_functions", "uniqueinds", "filter_tags"] 215.170 ns (5%) 976 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter0"] 142.637 ns (5%) 464 bytes (1%) 2
["indexset", "set_functions", "uniqueinds", "nofilter2"] 170.539 ns (5%) 976 bytes (1%) 2
["indexset", "set_functions", "uniqueinds, ITensor"] 656.552 ns (5%) 2.92 KiB (1%) 7
["inplace", "axpy!"] 17.400 μs (5%) 79.42 KiB (1%) 16
["op", "op QN"] 7.500 μs (5%) 11.63 KiB (1%) 96
["op", "op"] 4.200 μs (5%) 5.52 KiB (1%) 43
["tagset", "tagset"] 225.105 ns (5%) 144 bytes (1%) 1
["tagset", "tagset_long"] 292.135 ns (5%) 144 bytes (1%) 1
["tagset", "tagset_unicode"] 328.121 ns (5%) 144 bytes (1%) 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

Julia Version 1.8.5
Commit 17cfb8e65ea (2023-01-08 06:45 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
      Ubuntu 22.04.1 LTS
  uname: Linux 5.15.0-1031-azure #38-Ubuntu SMP Mon Jan 9 12:49:59 UTC 2023 x86_64 x86_64
  CPU: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz: 
              speed         user         nice          sys         idle          irq
       #1  2793 MHz      19347 s          0 s        859 s      19387 s          0 s
       #2  2793 MHz      16013 s          0 s       1554 s      22021 s          0 s
  Memory: 6.781219482421875 GB (1725.890625 MB free)
  Uptime: 3970.93 sec
  Load Avg:  1.0  1.0  1.0
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, icelake-server)
  Threads: 1 on 2 virtual cores

Runtime information

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

lscpu output:

Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Address sizes:                   46 bits physical, 48 bits virtual
Byte Order:                      Little Endian
CPU(s):                          2
On-line CPU(s) list:             0,1
Vendor ID:                       GenuineIntel
Model name:                      Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
CPU family:                      6
Model:                           106
Thread(s) per core:              1
Core(s) per socket:              2
Socket(s):                       1
Stepping:                        6
BogoMIPS:                        5586.87
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 avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xsaves md_clear
Hypervisor vendor:               Microsoft
Virtualization type:             full
L1d cache:                       96 KiB (2 instances)
L1i cache:                       64 KiB (2 instances)
L2 cache:                        2.5 MiB (2 instances)
L3 cache:                        48 MiB (1 instance)
NUMA node(s):                    1
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 Retbleed:          Not affected
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, PBRSB-eIBRS Not affected
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Mitigation; Clear CPU buffers; SMT Host state unknown
Cpu Property Value
Brand Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
Vendor :Intel
Architecture :UnknownIntel
Model Family: 0x06, Model: 0x6a, Stepping: 0x06, 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 : (48, 1280, 49152) 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

@emstoudenmire emstoudenmire merged commit c4991ae into main Jan 24, 2023
@emstoudenmire emstoudenmire deleted the diskprojmposum branch January 24, 2023 13:28
@mtfishman
Copy link
Member

I think we should make a single parametrized type:

struct ProjMPOSum{T}
  pm::Vector{T}
end

instead, this is a lot of code repetition.

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