how to throttle CPU usage for fitrgp?

2 ビュー (過去 30 日間)
jessupj
jessupj 2023 年 12 月 14 日
コメント済み: Drew 2023 年 12 月 15 日
(I hate asking something this trivial, but I'm frustrated... thanks for reading.)
My gaussian process regression via fitrgp automatically uses the maximum number of physical cores.
maxNumCompThreads(1)
mdl = fitrgp(X_train, Y_train,'KernelFunction', 'squaredexponential');
Specifically, setting the maxNumCompThreads is not effective in limiting CPU usage.
What am i missing here for throttling built-ins? I want to hard-limit it to may maybe 20 or 30 cores on this shared memory system.

採用された回答

jessupj
jessupj 2023 年 12 月 14 日
移動済み: Walter Roberson 2023 年 12 月 15 日
(SOLVED)
So... for whatever reason, restarting matlab got maxNumCompThreads to start managing usage. (Same system environment, same workspace definitions). I think the explanation/answer here is 'something broke internally; restart the matlab kernel to fix it' unless there's a better answer that doesn't require that.
  1 件のコメント
Drew
Drew 2023 年 12 月 15 日
On what platform & CPU configuration did you observe reaching a state where maxNumCompThreads is not managing max thread usage? Please file a support case with reproduction steps if the condition is repeatable.

サインインしてコメントする。

その他の回答 (1 件)

Drew
Drew 2023 年 12 月 14 日
Use maxNumCompThreads https://www.mathworks.com/help/matlab/ref/maxnumcompthreads.html to set the desired max number of computational threads.
LASTN = maxNumCompThreads(N)
If this answer helps you, please remember to accept the answer.
  2 件のコメント
Walter Roberson
Walter Roberson 2023 年 12 月 14 日
? they are already doing that, but it isn't helping.
jessupj
jessupj 2023 年 12 月 14 日
maxNumCompThreads is ignored. the code snippet, when i run it, uses O(100) cores even despite the instruction maxNumCompThreads(k) for whatever value of k I throw at it

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGaussian Process Regression についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by