Some checks failed
Build wheels / build (ubuntu-latest, 3.11) (push) Has been cancelled
Build wheels / build (ubuntu-latest, 3.12) (push) Has been cancelled
Build wheels / build (ubuntu-latest, 3.13) (push) Has been cancelled
Tests / check (push) Has been cancelled
Tests / build (ubuntu-latest, 3.11) (push) Has been cancelled
Tests / build (ubuntu-latest, 3.12) (push) Has been cancelled
Tests / build (ubuntu-latest, 3.13) (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
688 B
Python
22 lines
688 B
Python
import pickle
|
|
import sys
|
|
|
|
path = sys.argv[1] if len(sys.argv) > 1 else 'path/path.pkl.34.mpi'
|
|
|
|
with open(path, 'rb') as f:
|
|
d = pickle.load(f)
|
|
tree = d['tree']
|
|
|
|
width = tree.contraction_width()
|
|
slices = tree.multiplicity
|
|
sliced_width = width - (slices.bit_length() - 1)
|
|
|
|
print(f"Path: {path}")
|
|
print(f"Width (unsliced): {width:.1f}")
|
|
print(f"Slices: {slices}")
|
|
print(f"Sliced width: {sliced_width:.1f}")
|
|
print(f"Peak memory (total): {2**width * 16 / 1e9:.1f} GB")
|
|
print(f"Peak per slice: {2**sliced_width * 16 / 1e9:.2f} GB")
|
|
print(f"Sliced indices: {len(tree.sliced_inds)}")
|
|
print(f"Cost (log2 flops): {tree.contraction_cost(log=True):.2f}")
|