Warn users if multicore summarise_draws risks exhausting available ram

オープン
#148 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
r
領域
performance

調査の方向性

summarise_draws の multicore パスから始めて、パッケージの依存関係がどのように宣言されているか、特に memuse を推奨依存関係として追加できるかどうかを調べます。Issue で説明されている RAM 警告とオプトアウトの動作を定義し、その後、推定メモリが使用可能な RAM を超えたときに multicore 実行が警告し、安全性が無効になっているときには処理を続行することを確認します。

索引モデルが issue の本文から書いたものです。

説明

documentation efficiency

My first big test of multicore summarise_draws on a really big (~9 GB in memory) array plowed straight into the swap on my 40 GB machine and I had to kill it. Second test, after reducing cores from 4 to 3, was awesome!

If a naive user runs their big model for days and then overenthusiastically runs summarise_draws prior to saving, they could be in a world of hurt.

Given that the main use case for multicore processing with summarise_draws involves really big draws arrays, we could consider adding a .ram_safety = TRUE argument, and then doing:

if (.cores > 1 & .ram_safety & (memuse::memuse(object.size(x)) > (memuse::Sys.meminfo()$totalram / (.cores + 1)))) {
  warning(paste("The memory requirements of multi-core processing with", .cores, "cores may exceed the RAM on your system.",
                "Consider using fewer cores. If you wish to proceed with", .cores, "cores, set `.ram_safety = FALSE`",
                "and save any important objects prior to running."))
} else {
  # Do the computation
}

Main drawback is the extra package requirement for multicore (which could go in suggests).

主要言語
R
スター
172
フォーク
27
平均マージ
5日 12時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

stan-dev/posterior のほかの issue

stan-dev/posterior の issue をすべて見る

似ている issue

R の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。