Skip to content

[Perf] Another round of performance improvements#229

Merged
lkdvos merged 9 commits intomasterfrom
perf-projector
Jun 23, 2025
Merged

[Perf] Another round of performance improvements#229
lkdvos merged 9 commits intomasterfrom
perf-projector

Conversation

@lkdvos
Copy link
Member

@lkdvos lkdvos commented Jun 21, 2025

This is another round of improvements for generic performances.

In particular, the renormalize_west_edge function now got the same treatment with optimizing intermediate permutations, and I altered some implementations with dtmap as these were completely type-unstable.
At least now, from what I can test, ctmrg_iteration is actually type-stable, and while I don't think this would lead to massive speedups, I do believe this might help with compilation times.

@codecov
Copy link

codecov bot commented Jun 21, 2025

Codecov Report

Attention: Patch coverage is 88.52459% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/algorithms/contractions/ctmrg_contractions.jl 20.00% 4 Missing ⚠️
src/algorithms/ctmrg/sparse_environments.jl 0.00% 2 Missing ⚠️
src/utility/svd.jl 75.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/PEPSKit.jl 100.00% <ø> (ø)
src/algorithms/correlators.jl 100.00% <100.00%> (ø)
src/algorithms/ctmrg/ctmrg.jl 90.47% <100.00%> (ø)
src/algorithms/ctmrg/sequential.jl 98.41% <100.00%> (+0.05%) ⬆️
src/algorithms/ctmrg/simultaneous.jl 100.00% <100.00%> (+1.72%) ⬆️
src/utility/diffable_threads.jl 100.00% <100.00%> (ø)
src/utility/svd.jl 86.95% <75.00%> (-0.27%) ⬇️
src/algorithms/ctmrg/sparse_environments.jl 29.85% <0.00%> (-0.92%) ⬇️
src/algorithms/contractions/ctmrg_contractions.jl 55.62% <20.00%> (-0.48%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pbrehmer
Copy link
Collaborator

This is really great, thanks! I have high hopes that the improved type-stable dtmap and ctmrg_iteration will actually improve the compilation times (especially for the backwards pass with Zygote) since these have gotten really bad.

I was wondering, the other edge renormalization functions (renormalize_north_edge, etc.) should have the exact same intermediate permutations, right? The only difference should be which of the bra/ket bond indices will be connected.

Let me know if I can help out or when I should review!

@lkdvos
Copy link
Member Author

lkdvos commented Jun 23, 2025

For me this would be ready to review/merge, I'm actually 🤒 right now so I won't be able to continue this anytime soon.
Indeed the other contractions should get the same treatment, I focused on the sequential ctmrg to start with though. It's a bit manual in any case, I can't say I'm super confident I always have the best permutations so I'd say it's better to check explicitly the performances, and that takes quite a bit of effort.

Copy link
Collaborator

@pbrehmer pbrehmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Other than the import thing, this would be good to go for me.

Get well soon!

@lkdvos lkdvos requested a review from pbrehmer June 23, 2025 14:46
@lkdvos lkdvos enabled auto-merge (squash) June 23, 2025 14:47
@lkdvos lkdvos mentioned this pull request Jun 23, 2025
@lkdvos lkdvos merged commit 14b3630 into master Jun 23, 2025
45 checks passed
@lkdvos lkdvos deleted the perf-projector branch June 23, 2025 16:27
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.

2 participants