Skip to content
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

Resource memory limit exceeded #388

Open
SSoelvsten opened this issue Sep 8, 2022 · 4 comments
Open

Resource memory limit exceeded #388

SSoelvsten opened this issue Sep 8, 2022 · 4 comments
Labels
📁 bdd Binary Decision Diagrams blocked This is to be done... another day! 🔥 bug Something isn't working 📁 zdd Zero-suppressed Decision Diagrams

Comments

@SSoelvsten
Copy link
Owner

SSoelvsten commented Sep 8, 2022

When running the following benchmarks with the minimum of 128 MiB of memory, we get the following error message.

Resource memory limit exceeded by _MiB (_%), while trying to increase usage by 2MiB. Limit is 128MiB, but ___MiB would be used.

Specifically, this happens in the following benchmarks.

  • EPFL: random_control/arbiter_depth
  • Queens (BDD): 15
  • Tic-Tac-Toe (BDD / ZDD): 23, 24, 25...

This seems like there is a missing accounting for some file stream. After lots of digging (and squashing a few bugs that might have been the culprit) this turns out to be an issue in TPIE. I have reported this at thomasmoelhave/tpie#264 .

@SSoelvsten SSoelvsten added the 🔥 bug Something isn't working label Sep 8, 2022
@SSoelvsten SSoelvsten added 📁 bdd Binary Decision Diagrams 📁 zdd Zero-suppressed Decision Diagrams labels Sep 17, 2022
@SSoelvsten
Copy link
Owner Author

SSoelvsten commented Oct 25, 2022

If running with CMAKE_BUILD_TYPE set to Debug, then the assertions for the internal memory versions getting enough space is not satisfied. Maybe some of our memory_usage functions are not valid? Digging a bit deeper, we see this is due to the following two bugs of mine:

  • The memory_fits of the internal_sorter is not always smaller than the memory_fits of the same internal_priority_queue.
  • The levelized priority queue does not change its m_overflow_queue computation based on whether it is internal or external memory.

Fixing this does not seem to address this bug.

As I was looking at this, I also noticed the following issues in the memory computation

  • The m_overflow_queue computation does not take the merger into account.

Fixing this neither solves this issue.

@SSoelvsten
Copy link
Owner Author

SSoelvsten commented Nov 11, 2022

This seems to be a problem with TPIE's external memory priority queue taking up more space than it is given when it has to deal with too large instances.

thomasmoelhave/tpie#264

@SSoelvsten SSoelvsten added the help wanted Extra attention is needed label Nov 11, 2022
@SSoelvsten SSoelvsten added blocked This is to be done... another day! and removed help wanted Extra attention is needed labels Dec 10, 2022
@nhusung
Copy link
Contributor

nhusung commented Aug 9, 2023

I tried to use the bdd-benchmark set to compare a new BDD library to existing ones. However, I’m experiencing problems with Adiar:

$ build/src/adiar_queens_bdd -N 11 -M 4096
11-Queens (Adiar [BDD] 4096 MiB):

   Adiar [BDD] initialisation:
   | time (ms):              1

   Decision diagram construction:
Assert failed:  memory_fits and memory_usage should agree.
Expected:       unsafe_memory_usage(ret) <= memory_bytes
Source:         /[...]/bdd-benchmark/external/adiar/src/adiar/../adiar/internal/data_structures/sorter.h, line 56

Interestingly, I couldn’t observe a fail of this assertion in debug mode. Even in release mode, when inserting a debug print just above the mentioned line, the assert did not fail. Is this problem related?

(I’m on Linux 6.4 and use clang 15.0.7)

@SSoelvsten
Copy link
Owner Author

SSoelvsten commented Aug 10, 2023

This issue, #388, is due to the bug #264 of my dependency on the TPIE library

That debug statement on the other hand is to ensure that the number memory_bytes which is obtained from calling a function tpie::___::memory_fits(...) (how much fits into x bytes of memory?) agrees(ish) with its sibling function tpie::___::memory_usage(...) (how much memory does x elements occupy?).

I'll move your problem into a separate issue, if you don't mind. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📁 bdd Binary Decision Diagrams blocked This is to be done... another day! 🔥 bug Something isn't working 📁 zdd Zero-suppressed Decision Diagrams
Projects
None yet
Development

No branches or pull requests

2 participants