Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The RAM caches of the CGCs, F-symbols and R-symbols were bounded at 100 000 entries each. That bound is meaningless for the CGCs, which range from bytes to hundreds of megabytes. With TensorKitSectors' sector testsuite (#44), the pentagon test for SU(3) alone keeps about 28 000 CGCs of large intermediate irreps in RAM, using 34 GiB, and the full run was killed at 143 GB.
This PR bounds the caches in bytes instead (MemoizationKit's
measure = "bytes", usingBase.summarysize):SUN_CGCSUN_FsymbolSUN_RsymbolAs before, these are defaults that can be changed through preferences, e.g.
MemoizationKit.set_cache_preferences!(SUNRepresentations.SUN_CGC; maxsize = 2^34). CGCs evicted from RAM are reloaded from the disk cache.The F- and R-symbols are small arrays, so their byte bounds hold many more entries than before. The F-symbol cache was thrashing in the pentagon test: it ran at its 10⁵-entry limit with 2.7 million misses, while those 2.5 million F-symbols take only 180 MB.
Measuring is cheap:
Base.summarysizeof a CGC with 10⁵ nonzero entries takes about 30 µs, since theDictof aSparseArrayholds only isbits data.Pentagon test of the sector testsuite for SU(3), smallset of #44:
main)The time measured here is with a 2 GiB CGC bound, and that test is too large regardless; #44 will need a smaller smallset. The full test suite passes.
🤖 Generated with Claude Code