-
-
Notifications
You must be signed in to change notification settings - Fork 601
Cache assumptions and only send to Maxima when needed #23138
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
Comments
comment:1
Thanks. The Author field is for the developer, you're the Reporter as you can see top left. |
Changed author from schymans to none |
comment:3
The "more persistent domains() database" exists already in part as GiNaC/Pynac info flags that are set in parallel to Maxima's assumptions. They can be queried with ex.is_real() etc...What is not saved in Pynac are less elementary assumptions like x>1, y+z==pi. Now instead of caching all assumptions in a database (either Python or C++) and sending to Maxima on demand in bulk, another possibility could be, as you say, to just remove the assume calls on variable creation because they are all elementary assumptions. Then when Maxima needs them for integration, solving etc take the information from Pynac and do assumes for just those variables that are needed. Am I missing something? |
This comment has been minimized.
This comment has been minimized.
comment:4
@rwst, that would be awesome. My current workaround is not to pass the domain information to var() at all, but just save it in a separate assumptions database, in case it is needed at some point. Unfortunately, this also prevents the domain information from being passed to GiNaC/Pynac. Removing the assume() calls during variable creation would be a neater way of going about this. The problem that assume() takes longer and longer the more assumptions have already been passed, could then be approached independently. Should I try to remove the assume() calls, run the doctests and try to create a patch, or could someone else? Sorry about my ignorance regarding the development processes for SageMath. |
comment:5
Replying to @sagetrac-schymans:
Only removing the calls will make all doctests fail that rely on different variable domains than complex with operations that use Maxima, like integration and solving equations. So additional code is needed. I'll look into it. Of course you can change it in your local copy if you don't need these operation. However it *is possible that other things break. |
comment:6
I thought that in most doctests relying on other variable domains in maxima those would be passed as assume() anyway. I haven't really seen the |
comment:7
Replying to @sagetrac-schymans:
|
comment:8
OK, the doctests do indeed use |
comment:9
Replying to @rwst:
Okay, it's not as simple as that. |
Dependencies: pynac-0.7.9 |
Author: Ralf Stephan |
comment:11
The first commit prevents calls to Maxima, so it should result in a speedup. There is however a bug in Pynac (fixed in 0.7.9) that prevents it from working correctly. With the fix a few doctests fail, so this needs the planned injection of variable domains (EDITED). New commits:
|
Commit: |
comment:12
Following on from https://groups.google.com/forum/#!topic/sage-devel/-A8ZzSKvYsA, Therefore, instead of removing send_sage_domain_to_maxima as in the patch, I would propose to substitute Replying to @rwst:
|
comment:13
Replying to @sagetrac-schymans:
What takes the time with inconsistency checking is |
comment:14
Replying to @rwst:
Just to mention that |
Changed dependencies from pynac-0.7.9 to #23325 |
comment:16
Setting to review in order to get a patchbot assessment, now that the abovementioned Pynac fix is in develop. Please set back afterwards. |
comment:17
See patchbot log. |
As described in https://groups.google.com/forum/#!topic/sage-devel/jN6inWPyElM,
assume()
takes more and more time the bigger theassumptions()
data base is. This causes a lot of slow-downs when e.g. declaring variables with adomain
argument. Nils Bruin suggested that this is due to excessive interactions with the Maxima library and Ralf Stephan suggested that the assumptions could be cached and only sent to Maxima when needed, to speed up the process.Depends on #23325
CC: @rwst @egourgoulhon
Component: performance
Keywords: Maxima, symbolics, assume
Author: Ralf Stephan
Branch/Commit: u/rws/cache_assumptions_and_only_send_to_maxima_when_needed @
10c31a1
Issue created by migration from https://trac.sagemath.org/ticket/23138
The text was updated successfully, but these errors were encountered: