-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
speedup crystal weight and spin e/f #27057
Comments
Commit: |
Author: Martin Rubey |
comment:2
I need faster crystals, but I am not sure how to go about it. Here is a first try - old:
new:
Removing the assertions Somewhat surprisingly, a large amount of time is used in recomputing New commits:
|
comment:3
I am worried that caching We do not want to do To really get a good speedup, I would cythonize the spin crystals (use some sort of bitset or bint array) and implement a custom |
comment:4
Thank you for looking into this! One question: I realize that the index set does not need to be Since I'll keep pushing to this ticket, but leave it as |
comment:5
Yea, it seems to be that way for |
comment:6
#18426 is the ticket concerning a memory leak involving root systems. |
comment:8
Besides, is there a good reason to cache I am frequently iterating over the highest weight vectors of tensor powers. In fact, I would prefer it to be an iterator, but that's probably asking for too much. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:10
Caching |
comment:11
Retarging tickets optimistically to the next milestone. If you are responsible for this ticket (either its reporter or owner) and don't believe you are likely to complete this ticket before the next release (8.7) please retarget this ticket's milestone to sage-pending or sage-wishlist. |
comment:12
So I am not fully convinced of the elements having a How much of a speedup do you get with caching it? I am probably in favor of caching it, but I would be interested in seeing how performance critical it is first (at least, I do not think computing the weight is the slow part). We cache the Also, I think if you really need speed, you should cythonize this. I might be able to do that soon, but it is a little lower on the priority list for me right now. |
comment:13
Thanks for looking into this! I can only answer to your comment on the
I do not know how to free the memory - and until very recently, I did not understand why my computer became unusable... |
comment:14
That is a misrepresenation. It is not the |
comment:15
Are you saying that the highest weight vectors shouldn't take up so much space?
after which, according to htop, a big portion of the available memory on my laptop was used. It is not a big problem for me, because I can do such experiments with "large" tensor powers (eg., yesterday I had to check something for |
comment:16
No. I am asking you what you observed. Are you seeing a memory leak or is it just high usage in that specific computation? It is almost certainly not the caching of the highest weight vectors that is causing the high memory usage. The highest weight vectors requires a certain amount of iteration over the crystal, which is not O(1) in memory (I am not sure of an algorithm that could be). So you might get some memory improvement for your particular computation by storing the list of elements in the crystal (currently I believe it regenerates them for each factor, a by-product of being an iterator). |
comment:17
I don't really understand the question. I am observing that after the sequence of instructions above the memory of my computer is used up, and it doesn't go down anymore. In numbers:
|
comment:18
By doing a cythonization, I get the following:
vs Sage 8.6:
However, there is a definite memory leak with the tensor product:
I get the same when just doing for New commits:
|
Changed branch from u/mantepse/speedup_crystal_weight_and_spin_e_f to public/crystals/cythonize_spins-27057 |
Changed author from Martin Rubey to Martin Rubey, Travis Scrimshaw |
Reviewer: Travis Scrimshaw |
comment:19
That looks wonderful! I'll be playing with this until (something like) tomorrow! 1+1/2 immediate questions:
doesn't exist anymore.
I created #27083 for the memory leak. |
comment:20
After some thought, I think it is best for now to have a |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Changed reviewer from Travis Scrimshaw to Travis Scrimshaw, Martin Rubey |
comment:23
Excellent! Many thanks! |
Changed author from Martin Rubey, Travis Scrimshaw to Travis Scrimshaw |
Changed branch from public/crystals/cythonize_spins-27057 to |
CC: @tscrim @anneschilling
Component: combinatorics
Author: Travis Scrimshaw
Branch/Commit:
d2fe93d
Reviewer: Travis Scrimshaw, Martin Rubey
Issue created by migration from https://trac.sagemath.org/ticket/27057
The text was updated successfully, but these errors were encountered: