JuliaPy / JuliaPy/PyCall.jl

multiprocessing problem

オープン
#755 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Julia
スター
1.5k
フォーク
186
PR マージ指標
30日以内にマージされた PR はありません

説明

I tried to call PyStan using PyCall in Windows, but found repeating ``ERROR: unknown option `-c` ``.

Example:
```julia
using PyCall

pystan = pyimport("pystan")

schools_code = """
data {
vector[8] y; // estimated treatment effects
}
parameters {
real mu;
}
model {
y ~ normal(mu, 1.0);
}
"""

schools_dat = Dict("y" => [28, 8, -3, 7, -1, 1, 18, 12],)

sm = pystan.StanModel(model_code=schools_code)
fit = sm.sampling(data=schools_dat, iter=1000, chains=4)
```

Since I encountered a similar problem in pymc, I replaced `num_chains=4` with `num_chains=1` and "fixed" it. But it is still a problem considering exactly the same code works in pure Python.

I guess that the problem is due to multiprocessing (maybe only on Windows), so PyTorch `dataloader`, a well known lightweight multiprocessing caller is tested. Still, `num_workers=0` (non-multiprocessing) works but `num_workers=4` like the following example will not work.

Example:
```julia
using PyCall

torch = pyimport("torch")
torchvision = pyimport("torchvision")
transforms = pyimport("torchvision.transforms")
datasets = pyimport("torchvision.datasets")

dataset = datasets.FakeData(transform=transforms.ToTensor())
dataloader = torch.utils.data.DataLoader(dataset, batch_size=10, num_workers=4)

for batch in dataloader
println(batch)
break
end
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず Windows で PyCall の例を再現し、PyStan と PyTorch DataLoader について、単一プロセスと multiprocessing の設定を比較します。payload にはリポジトリのファイルやテストが記載されていないため、最初に PyCall の multiprocessing エントリポイントを特定し、`-c` エラーが Windows に固有のものかどうかを確認します。完了条件は、示されている複数 worker のケースがエラーなしで動作することです。

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

評価

技術スタック
julia, python, pytorch
領域
backend, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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