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

Integer overflow when memory limit is less than NN cache memory usage #1597

Open
mooskagh opened this issue Jul 1, 2021 · 8 comments
Open
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@mooskagh
Copy link
Member

mooskagh commented Jul 1, 2021

Example with memory limit 1MB:

0630 18:21:32.324037 36208 c:\projects\lc0\src\mcts\stoppers\stoppers.cc:110] RAM limit 1MB. Cache takes 59MB. Remaining memory is enough for 92233720368256758 nodes.
@mooskagh mooskagh added bug Something isn't working good first issue Good for newcomers labels Jul 1, 2021
@ErdoganSeref
Copy link

Does the integer overflow occur regarding the number of available nodes? How can we reproduce the issue?

@mooskagh
Copy link
Member Author

I believe if you run ./lc0 with --ramlimit-mb=1 "--logfile=<stderr>", the issue will show up.
(instead of <stderr>, you can write log to a logfile, --logfile=filename.txt)

@ErdoganSeref
Copy link

When I run ./lc0 --ramlimit-mb=1 "--logfile=log.txt" I get the following log:

0516 17:20:23.509182 140325955516224 ../../src/main.cc:45] Lc0 started. 0516 17:20:23.509351 140325955516224 ../../src/main.cc:46] _ 0516 17:20:23.509421 140325955516224 ../../src/main.cc:47] | _ | | 0516 17:20:23.509476 140325955516224 ../../src/main.cc:48] |_ |_ |_| v0.30.0-dev+git.dirty built May 10 2022 0516 17:20:23.525305 140325955516224 ../../src/utils/commandline.cc:56] Command line: ./lc0 --ramlimit-mb=1 --logfile=log.txt

I can't see the issue in the log file.

@mooskagh
Copy link
Member Author

Run some actual search, with go wtime 1000 or something like that.

@ErdoganSeref
Copy link

I reproduced the issue by running ./lc0 --ramlimit-mb=1 "--logfile=log.txt" followed by go wtime 1000 as you've said. But I still don't understand what the exact issue is. What should the expected output be?

@mooskagh
Copy link
Member Author

When "negative" amount of RAM is available (cache use is larger than total avaialable), it should allocate 0 nodes and not 92233720368256758.

@Naphthalin
Copy link
Contributor

Was this addressed lately when RAM limit was discussed?

@KarlKfoury
Copy link
Contributor

i believe #2058 fixes issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants