-
-
Notifications
You must be signed in to change notification settings - Fork 599
Make rational matrix rref default to flint_multimodular, add suboptions for flint algorithm #39733
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
Conversation
Documentation preview for this PR (built with commit 5fa99ec; changes) is ready! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much benchmarking did you (or someone else) do for this?
The benchmark I did is just in https://github.com/sagemath/sage/pull/39204/files#diff-6d6c677113f407891fb7d10502e75720ae2a392be8e2b1104502ce99b1b6a342R208 . The author of flint benchmarked between the two algorithms available in flint to make sure the faster one is chosen in flintlib/flint#2144 I haven't go figure out how to install flint from source (required to test flint with the extra pull request). A safer way (if you think it's safer?) would be to provide an extra option |
Actually, that's probably a good idea to add that option just to provide it to the user (even without the utility for benchmarking). Could you add that (and the other flint option)? |
eee3137
to
f66ad94
Compare
Alright, done. Since flint_multimodular is reliably faster than multimodular even before the linked pull request, I set the default to that. (also conveniently hide that implementation detail from the user so that we can change it later without breaking stuff.) #39204 added as a dependency — not strictly necessary, but convenient because it adds a benchmark which I reuse here to demonstrate benchmark of different algorithms against each other. flint_multimodular beats multimodular by an order of magnitude though. Even with #39204 .
Minor nitpickable points:
|
Thank you.
There is very little precedence for such naming, but considering the ideal code uses the color separator, we probably should follow that unless you have an objection.
That's probably overkill on options I think.
I have no objections to changing the links, but I am not an expert.
I probably would leave it alone to avoid the backwards incompatible change. Since we are clearly saying what comes from, e.g., PARI, the lack of the label should indicate it is Sage's own (which will also be in the doc). |
sagemathgh-39867: Run long test in test-new sagemath#39641 introduced an issue that long new tests are not ran in test-new. This is an issue because then the author is only notified by the failure when test-long finishes. (e.g. happened to me in sagemath#39733 .) ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39867 Reported by: user202729 Reviewer(s): Tobias Diez
sagemathgh-39867: Run long test in test-new sagemath#39641 introduced an issue that long new tests are not ran in test-new. This is an issue because then the author is only notified by the failure when test-long finishes. (e.g. happened to me in sagemath#39733 .) ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39867 Reported by: user202729 Reviewer(s): Tobias Diez
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. LGTM.
sagemathgh-39733: Make rational matrix rref default to flint_multimodular, add suboptions for flint algorithm Because one of the algorithms used by flint is multimodular, it ought to be faster than the implementation in Python. At least after we upgrade to a version after flintlib/flint#2129 . (p/s: if someone uses the old version, the current choice of flint might be slower in some cases, see the linked issue. An alternative which is likely always faster is to explicitly use the multimodular algorithm in flint. Do you think the current implementation is fine, or should we provide an explicit `flint_multimodular` option instead?) Fixes sagemath#39197 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> sagemath#39204 URL: sagemath#39733 Reported by: user202729 Reviewer(s): Travis Scrimshaw
sagemathgh-39867: Run long test in test-new sagemath#39641 introduced an issue that long new tests are not ran in test-new. This is an issue because then the author is only notified by the failure when test-long finishes. (e.g. happened to me in sagemath#39733 .) ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39867 Reported by: user202729 Reviewer(s): Tobias Diez
sagemathgh-39867: Run long test in test-new sagemath#39641 introduced an issue that long new tests are not ran in test-new. This is an issue because then the author is only notified by the failure when test-long finishes. (e.g. happened to me in sagemath#39733 .) ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39867 Reported by: user202729 Reviewer(s): Tobias Diez
Because one of the algorithms used by flint is multimodular, it ought to be faster than the implementation in Python.
At least after we upgrade to a version after flintlib/flint#2129 .
(p/s: if someone uses the old version, the current choice of flint might be slower in some cases, see the linked issue. An alternative which is likely always faster is to explicitly use the multimodular algorithm in flint. Do you think the current implementation is fine, or should we provide an explicit
flint_multimodular
option instead?)Fixes #39197
📝 Checklist
⌛ Dependencies
#39204