-
Notifications
You must be signed in to change notification settings - Fork 179
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
Allow memory to grow larger than 4GB per thread #389
Comments
Dear Mate, thank you for the fast reaction. Because I let the jobs run in verb=4 I wonder why there was no memory overload message in the log-files. But if you say it, it must be so. It is a pity because I really have very much memory on my system. For cryptographic purposes termination is important. Big instances should be able to run longer. Thank you very much! |
+1 Errormessage: Benjamin |
I can imagine that the duration of the execution, before the solver stops, varies with the magnitude of the problem but also with the switches which manipulate the learned clauses. The longer it runs the bigger the data base and from a point and on the matter becomes not manageable. I was surprised to read in an older paper of Henry Kautz & Bart Selman ("The State of SAT") about solvers terminating successfully after 25 days! I wonder if other modern solvers have a memory limitation like CMS |
All the serious ones do. The State of SAT was written in 2007. The optimisation that restricts to 32b offsets is a new one. MiniSat, Glucose, lingeling, etc. all have it. However, it is true that current CryptoMiniSat hoards a bit too many learnt clauses, hence it terminates earlier than other solvers. But they all would. Again, I am working on it, but 2007 is not 2017 :) |
Mate you mean that what was solved in 25 days in the year 2007, is now solvable is some minutes ? :-) |
:) Unfortunately, no. But what was true then is not necessarily true now, because the incentives for SAT solver writers are not to solve issues that take 25 days to solve, but to solve issues that take at most 3-4h to solve. A new idea came around since 2007 that restricts the maximum time, but lowers the time to solve when under 4h. So everybody is using it. If the SAT competition was set up such that a solver has to be able to run for 25 days, then nobody would use this idea, because it would prevent the people from winning. So, it's a double-edged sword. Again, I will fix it, there is no need to push :) |
I didn't mean to push Mate! But this limitation doesn't fit the cryptography-business ;-) |
Running the same instance in 8 separate tread leads to longer execution times (since 26h no error). One thread uses currently 2GB ram slowly increasing, reaching the 4GB limit in approx 2 days. This observation suggests, that running 8 threads in parallel leads to 8 times as fast clause collection (somehow logic), therefore the 4GB limit is reached 8 times faster. A workaround could be, that a thread deletes clauses which came from others threads more aggressively. |
Hello BA-Bartsch. I am not sure that clause deleting out of memory considerations would be a useful strategy for all cases. It could be that useful clauses get lost in this way. And maybe the relation of the number of threads to the fastness of reaching the memory limit is also not "linear". I take 48 threads. Some jobs run for fast 5 days before they die out, other run even a bit longer. The jobs which I let run with 35 threads do not manage to survive longer though. This is why I doubt the direct proportionality suggested above... |
If you compare 48 threads to 35 threads then the "linearity" would only apply if the pc has true 48 cores (or HT), otherwise the 48 threads are slowed down. Nevertheless I really love your program and I thank you very much for programming/debugging it! |
Actually, the whole diff to add this feature is a hell of a lot less than the number of lines written in this issue :) I'm about to push it. Let's just stick to that :) |
Mate, this is a Word! Wishing you both a nice evening! |
It's now been added. You can test this by:
It should print that the memory get consolidated correctly even after e.g. 10GB of clause memory usage. Note that the test is currently not enabled, and the "test" it performs is rather stupid, it just checks that the solve() doesn't crash. Which it would if the consolidation made a mistake. Note that I cannot run this test, as I only have 12GB of memory. I'd need about twice that to test this. Note that this may start using your swap and "crash" (make it unusable) your computer. So, thread carefully. Make sure you have a lot of RAM, say, 64GB. Feedback would be appreciated, especially the output of that executable. PS: I can go up to:
which means 2.7GB of memory usage, offset is only at 29b usage. We need >32b to correctly test this (i.e. 16x more RAM usage), so you need a lot of RAM, possibly over 100GB (as it needs to grab 2x what it needs + there is overhead from other parts of the solver that affect the overall memory usage -- at 2.7GB of clause usage it was using over 4GB of real RAM + on consolidation it was using 8GB, so ~16x8GB is what is needed for a proper test. You might need to adjust the max number of clauses, currently set to |
I see that this thread was very busy, which is great! I spent a full 4h (i.e. my evening) on this. It'd be nice one of you could take the ~10 minutes to do the test, as I cannot perform it :S Thanks in advance! |
how do I compile clause_alloc_test.cpp?
|
good morning to all! THANK YOU Mate! I have 256GB real RAM, so that is no problem! But I first have to compile the new version and send the jobs. I will be back soon. And again: Many thanks ! |
Well, it says "pip install lit" is needed, so maybe that would help? :)
Install pip then install lit with pip :)
…On 3 May 2017 05:51, "BA-Bartsch" ***@***.***> wrote:
how do I compile clause_alloc_test.cpp?
"cmake ." in the "test" directory leads to following error:
CMake Error at CMakeLists.txt:17 (message):
Could not find 'lit' tool. You need to install it by e.g. 'pip install
lit' If it's already installed, set LIT_TOOL to the full path for lit
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.5)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#389 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABReOTg2w9dw3agPigKI2xJuFcFbCqbNks5r2AeygaJpZM4M3yXW>
.
|
Since this is a per-thread limit, running with many threads will only limit
us in terms of testing. I *strongly* recommend testing with only *one*
thread so you can reach e. g. 16 Gigs with one thread. Then we can be more
sure it's fixed :)
…On 4 May 2017 08:35, "BA-Bartsch" ***@***.***> wrote:
I did not manage to compile the cpp-file. So I started one of my
calculations with 8 threads on a system with 64GB ram. Here is a diagram
which shows "Time vs. Ram".
Benjamin
[image: time_vs_ram]
<https://cloud.githubusercontent.com/assets/28258470/25694074/019a7ae6-30ad-11e7-9a24-f954cec94c29.png>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#389 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABReOexP-0ylGahaYkavcus1HFHyODQSks5r2X_WgaJpZM4M3yXW>
.
|
I have no idea how to install them. I am so bad at linux, I can only copy-paste things or use 1-click-links. I managed to compile cryptominisat after more than 2 hours trial and error and I saved it for the future:
could you provide me a "sudo apt-get install ...." line to install pip / lit.
did not work. |
ohh there was the hint: ok lets run: it tells me in german that git is not installed: ok lets run: seems to be installed, ok lets run again: and it tells me: now I am stuck |
@BA-Bartsch I have now added instructions how to build this from the ground up in the README. You need to first of all delete your cryptominisat -- you are probably using the tarball/zip, that's not good. Now you need to do the following:
On top of that, you need to enable the test as per my instructions above, removing the "#" from the CMakeLists.txt indicated before running the "cmake" command. But in all honesty, you are probably better off not doing testing in case you don't have a software developer background. It's a bit tricky :) |
Hey, everything worked, thank you!
and explicit calling "./clause_alloc_test"
But should'nt it try to allocate more ram? |
I'll close this now, it seems fixed. Thanks everyone! |
Currently, long-running instances die with memory overload.
The text was updated successfully, but these errors were encountered: