Hi,
It was on my todo list for a while too, since our implementations are very
slow. Here "very" means "prohibitively", since some systems can not be
solved with Sage in decent time (via Singular), while FGb could solve them
quickly.
Unfortunately, the fact that is is neither free-software nor open-source
made it lower on my todo list. I wonder whether it could be possible to
kindly ask J.C. Faugere to free his code, especially since his work on
this is founded by the (french) public service.
Did you make some comparisons with Giac ?Some benchmarks from Roman Pearce and my own tests, about 2 years old.
I walk into this discussion with some hesitancy, but Christian Eder has developed a rather efficient F4 algorithm. [1] I know it works and is quite fast, though I haven't compared it to the implementations mentioned above. Unfortunately, I haven't heard from him in a while after he went off to Iran for a few weeks, and he doesn't seem to have updated his site since then, either.
Is integrating Eder's project something a group might be interested in doing at [2]? I had planned to apply to work on integrating a similar project at [2] (a different sort of F4-style Gröbner basis algorithm [3,4]) but perhaps [1] would be a good bet since there's no doubt about it and Eder spent at least a year in Paris working with Faugère.regards[4] https://dl.acm.org/citation.cfm?id=3087643
On Wednesday, November 21, 2018 at 4:43:01 PM UTC-6, Markus Wageringel wrote:Hi everyone.I created a Sage wrapper for the C interface of FGb, which makes it easy to call FGb from within Sage. The sources are available on Github [1] and can be installed as a Python package into Sage:FGb is a C-library by J. C. Faugère for computing Gröbner bases and supposedly it is one of the faster implementations that exist. It is included with Maple [2]. FGb is closed source, but comes with a C interface that is freely distributed for academic use. Some of the features:• The computations run in parallel. (This only seems to work for computations over finite fields.)• Elimination/block orders are supported.• It runs on Linux and Mac. (There seem to be some issues, though. I could not get FGb to work on my Ubuntu machine. It fails with an "Illegal instruction" error.)In my Sage interface, I implemented just two functions: computing Gröbner bases and elimination ideals. Supposedly, the FGb C-library supports other functionality like computing Hilbert polynomials, but that part of the library is not documented very well, so it does not make sense to try to create wrappers for that. The focus is finding a Gröbner basis which, once computed, can be used by Sage for further computations.I just wanted to share this. Maybe it is useful for someone.Markus
Thanks for the feedback everyone.
Am Donnerstag, 22. November 2018 09:53:43 UTC+1 schrieb parisse:Did you make some comparisons with Giac ?Some benchmarks from Roman Pearce and my own tests, about 2 years old.I have not done any comparisons, mainly because I cannot do anything about the performance of FGb anyway. Moreover, to my knowledge, Giac does not support elimination orders (at least the Sage interface does not), which made it less suitable for my use cases.
I remember having seen those benchmarks before, but I cannot find them anymore. If you send a copy of the polynomial systems, I can make some rough comparisons of the options available within Sage.
Hi,
speaking of Giac (sorry, if this should rather be on sage-support or off-list):
Can I get the degree reached during the computation and the sizes of the matrices considered out somehow?
I walk into this discussion with some hesitancy, but Christian Eder has developed a rather efficient F4 algorithm. [1] I know it works and is quite fast, though I haven't compared it to the implementations mentioned above. Unfortunately, I haven't heard from him in a while after he went off to Iran for a few weeks, and he doesn't seem to have updated his site since then, either.
From his recent talks, his implementation is nowadays more than competitive.
Hi!
Giac supports double revlex ordering, this is the order used by the eliminate command of Giac. Geogebra has many examples of eliminate commands there https://dev.geogebra.org/trac/browser/trunk/geogebra/giac/src/test
ℤ/p | singular (1) | giac (4) giac (16) | fgb (4) fgb (16) cyclic8 | 62.01 | 7.71 4.88 | 1.86 1.38 cyclic9 | 11519.16 | 258.85 191.30 | 112.31 55.37 katsura11 | 107.91 | 12.62 11.10 | 4.04 2.43 katsura12 | 1090.37 | 67.07 60.25 | 23.09 12.59 bayes148 | 7.19 | 92.63 92.15 | 571.28 471.59 gametwo7 | 934.69 | 122.65 116.37 | 20.78 14.30 jason210 | 2.67 | 23.71 23.39 | 24.58 22.44 mayr42 | 124.74 | 169.94 166.56 | 139.12 111.08 yang1 | 49.79 | [3] [3] | 257.96 177.65
ℚ | singular (1) | giac (4) giac (16) | fgb (1) cyclic7 | [1] | 10.71 10.62 | 4.20 cyclic8 | [2] | 120.44 205.57 | 77.22 katsura9 | 19.19 | 27.30 27.23 | 3.04 katsura10 | 236.62 | 241.32 238.23 | 18.58 alea6 | 35724.62 | 578.94 548.39 | [4] 331.64 eco12 | [1] | 4748.24 4811.32 | 102.06 jason210 | 13.43 | 65.24 83.82 | 49.38 noon9 | 132.82 | 3146.97 3159.49 | 136.55
I am a bit surprised about some of the Singular results being a lot worse than reported in [5], cyclic7 in particular. Perhaps starting this computation with some different options can help here.
Am Samstag, 24. November 2018 23:11:26 UTC+1 schrieb parisse:Giac supports double revlex ordering, this is the order used by the eliminate command of Giac. Geogebra has many examples of eliminate commands there https://dev.geogebra.org/trac/browser/trunk/geogebra/giac/src/testNice. It would probably be good to have this function in the Sage interface for giac, as well. Is it also possible to obtain the full Gröbner basis with respect to the revlex/revlex block order, but without elimination?
Meanwhile, Roman Pearce's website [5] is back online and I used those polynomial systems to compare the Sage interfaces libsingular, giacpy_sage and fgb_sage. I created a gist of the code [6].Versions of libraries used:• Sage 8.5.beta4• libSingular-4.1.1• giacpy_sage-0.6.6, giac-1.4.9.45.p4
All the other systems are using modular methods here, so Roman use the modstd library (the command is modStd) in Singular to get those timings. Indeed cyclic7 over Q takes about 20s on my laptop in Singular using this approach.
ℚ | singular (4) singular (16) cyclic7 | 28.79 21.27 cyclic8 | 1109.03 623.98 katsura9 | 28.07 25.14 katsura10 | 329.86 172.15 alea6 | 3053.70 2549.42 eco12 | 4879.15 1888.11 jason210 | 122.07 106.33 noon9 | 2339.98 1502.74
From giac, call gbasis with the list of polynomial and the list of the first block indets.
The timings on Q do not reflect the timings of native giac, there must be some misconfiguration or something wrong with the sage interface. Higher timings with 16 threads instead of 4 for a modular algorithm is suspicious.
While there will be some overhead due to the conversion from and to Sage, it is the same in both cases. In fact, I observe similar times with the native Giac that is installed into the Sage environment, when applied to the Giac input file cyclic8 you linked above [1]: 0m27.309s using 4 threads and 1m43.493s using 16. Indeed, CPU usage rarely surpasses 400% during the computation. I am not sure what could be wrong here. Perhaps it is something related to the patches of the Giac in Sage [2]?
While there will be some overhead due to the conversion from and to Sage, it is the same in both cases. In fact, I observe similar times with the native Giac that is installed into the Sage environment, when applied to the Giac input file cyclic8 you linked above [1]: 0m27.309s using 4 threads and 1m43.493s using 16. Indeed, CPU usage rarely surpasses 400% during the computation. I am not sure what could be wrong here. Perhaps it is something related to the patches of the Giac in Sage [2]?
How many physical cores do you have on the machine (not logical cores), and how many CPU sockets and what is the cache structure? (I assume it is at least 16 physical cores, but I'm asking more because this sort of thing often happens because of shared caches.)
you can certainly get free cloud resources from Google, to spin out
Linux (and not only) VMs with many cores, they have a faculty
programme like this.
I've been using it since Sept.
https://cloud.google.com/edu/
On Sat, Dec 8, 2018 at 5:03 PM parisse <bernard...@ujf-grenoble.fr> wrote:
> and even if I was, I don't want to depend from google or any company for something like that (the risk of IP problems is much too high
IP problems while working with open source software? Really?
> and anyway I don't like the idea that private company should
replace public support for research). Either I can have ssh access to
some university linux server somewhere
The reality is that many universities already moved to renting servers
in datacenters, and this will become more and more prevalent. There
are universities in UK that do not have any servers at all, and run CS
education programs more or less fully in the cloud.
Just a couple of days ago I spoke to someone from U. of Portsmouth,
where every CS major students gets issued a linux VM at the beginning
of their study, and do most of their graded coursework there (at a
cost for the university for under 7 euro per student per year).
> or this will be delayed until I buy myself a laptop with more than 2 (reals) threads.
whereas you could run your tests on a 100-core VM, for free...
On Sun, Dec 9, 2018 at 1:42 PM parisse <bernard...@ujf-grenoble.fr> wrote:
>
> Efficient code does not depend on how you handle it (git, svn or tarballs or whatever).
Efficiency of handling code does depend upon this; fixing a trivial
C++ issue in Giac takes 10 times longer (and takes 10 times more time
and effort from the community around Giac) than in a similar system
hosted, say, on github.
> And I don't think different practices is the real reason why Giac was/is mostly ignored here.
When ODK proposal was being written, we still tried getting Giac to
stop changing distribution tarballs without bumping up version
numbers...
Le dimanche 9 décembre 2018 20:44:30 UTC+1, Dima Pasechnik a écrit :On Sun, Dec 9, 2018 at 1:42 PM parisse <bernard...@ujf-grenoble.fr> wrote:
>
> Efficient code does not depend on how you handle it (git, svn or tarballs or whatever).
Efficiency of handling code does depend upon this; fixing a trivial
C++ issue in Giac takes 10 times longer (and takes 10 times more time
and effort from the community around Giac) than in a similar system
hosted, say, on github.
Let me remind you that Giac source code is available on Geogebra SVN.
Obviously, I have better things to do than duplicating repositories, especially if the handling software is not the same that the software I'm used too.If you want to fix an issue in my code, the fastest way is to send a bug report on the Xcas forum. Then I usually fix the bug in a couple of days. I don't understand how it could take 10 times more effort from the community.
Actually, I think you just want to coerce me to follow your rules. But well, I have the opposite view than you, the way sage handles bug reports and so would take me 10 * more time than the way I work.
> And I don't think different practices is the real reason why Giac was/is mostly ignored here.
When ODK proposal was being written, we still tried getting Giac to
stop changing distribution tarballs without bumping up version
numbers...
Pfff! My guess is that people were not really interested in giac (and did not really check it) because they have access to magma when it comes to large computations where giac has more efficient code than singular.Ok, I'll stop here.
Fortunately, there are constructive people in the community, I'd like to thank Samuel Lelièvre and William Stein who managed to open me an account on a multi-CPU server.
I cannot comment on why certain implementations did not use Giac code,
I am not involved in this work.
On Sunday, 9 December 2018 11:22:48 UTC+1, Dima Pasechnik wrote:<SNIP>I cannot comment on why certain implementations did not use Giac code,
I am not involved in this work.I am involved in that,
Bill, my feeling is that part of ODK money was used to improve multivariate polynomial arithmetic implementations precisely in a domain where Giac behaves well (and maybe I should emphasize that unlike almost all other CAS, Giac is a library, i.e. is interoperable with any software that can interact with a C++ library). Despite that, ODK ignores Giac.
Well, I'm not sure it's the right place to discuss that, and anyway past is the past.Now that I made the effort to fine tune my gbasis code, it behaves very well on Q on multi-CPUs architectures. We'll see if there is more interest or not.
And even if giac did all that, it is one of many projects doing multivariate polynomial arithmetic in Europe. There's also Trip, Piranha, Factory, Pari/GP, Gap. I really don't think it is a valid argument that just because your CAS/library can do multivariate arithmetic that we should stop working on it!
from sage.libs.singular.function_factory import ff
modStd = ff.modstd__lib.modStd
ff.setcores(4)
I = sage.rings.ideal.Cyclic(PolynomialRing(QQ, 'x', 7))
gb = modStd(I)
singular.load('modstd')
singular.setcores(4)
I = sage.rings.ideal.Cyclic(PolynomialRing(QQ, 'x', 7))
J = singular.modStd(I).sage()