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

RandomForest def predictRFStat(rf, X, statDictionary,n_jobs) optimization (memory and CPU) #320

Open
miranov25 opened this issue Apr 2, 2023 · 2 comments

Comments

@miranov25
Copy link
Owner

The memory consumption in the predictRFStat is too big because all trees are evaluated for all of the points

2 changes are needed:

  • running in chunks -to keep memory in limit
    • parameters chunkSize or maxMemory
  • optimization of the CPU - statistics should also be calculated in parallel
    • Currently only trees are calculated in parallel

There are 2 implementations of the predictRFStat, predictRFStatNew . This was a quick hack after scikit changed some implementation. The hack was not documented and remained in the code.

As the transition happened 6 month ago, maybe we can make New version default and remove the obsolete version...

@miranov25
Copy link
Owner Author

Start with predictRFStatPar so we can compare it with the previous version and later replace it ...

Benchmark:

  • CPU time
  • Memory
  • results

miranov25 added a commit that referenced this issue Apr 7, 2023
Predict rf stat - parallelization (#320)
@miranov25
Copy link
Owner Author

To save memory the predictRFStat should be optionally split to the chunk
If we consider that to be a function responsibility of the function - new parameter maxRows to be added

If maxRow is set then the function will be called in chunks with maxRows and all data will be merged at the end.

Memory consumption - nRowsxnTrees which can be significantly smaller than current nEntries x nTrees

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant