添加MPI并行TN benchmark及辅助脚本,移除旧benchmark
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>
This commit is contained in:
2026-05-05 19:04:09 +08:00
parent a3f39a1d67
commit 5a692033a6
9 changed files with 410 additions and 561 deletions

21
inspect_path.py Normal file
View File

@@ -0,0 +1,21 @@
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}")