Closed sotetsuk closed 1 year ago
compile速度のbenchmarkに倣いました.
library | game | type | n_envs | steps | time | time per step |
---|---|---|---|---|---|---|
open_spiel |
go | subprocess | 10 | 1000 | 2.58 | 0.000258s |
petting_zoo |
go | subprocess | 10 | 1000 | 4.22 | 0.000422s |
open_spiel |
go | forloop | 10 | 1000 | 1.32 | 0.000132s |
petting_zoo |
go | forloop | 10 | 1000 | 9.42 | 0.000942s |
open_spielとpetting zooでsubproc, forloopの速度の関係が逆なのが気になっています. stable_baselinesの実装が悪いのか, open_spielがsub_processに向いていないのか. 少し調べてみます.
compile速度のbenchmarkに倣いました.
library game type n_envs steps time time per step
open_spiel
go subprocess 10 2.84 0.000284s
petting_zoo
go subprocess 10 4.69 0.000469s
open_spiel
go forloop 10 1000 1.35 0.000135spetting_zoo
go forloop 10 1000 9.46 0.000946s
library | game | type | n_envs | steps | time | time per step |
---|---|---|---|---|---|---|
open_spiel |
go | subprocess | 10 | 1000 | 2.84 | 0.000284s |
petting_zoo |
go | subprocess | 10 | 1000 | 4.69 | 0.000469s |
open_spiel |
go | forloop | 10 | 1000 | 1.35 | 0.000135s |
petting_zoo |
go | forloop | 10 | 1000 | 9.46 | 0.000946s |
こう?まあ 0.0001 sec/step
のオーダーではfor-loopの方が速く、0.000946=0.001 sec/step
のオーダーではsubprocessの方が速いって考えれば別におかしくはないと思いますけど。
でもobservationとかの転送速度とかがOpenSpielで遅くなったりしてないか確認したほうがいいかもですね。
そうですね. 転送速度とりあえず調べてみます.
TODO 速度比較
open spiel subproc 実装方法比較
SyncVectorEnv
とMarkovVectorEnv
を使った比較は最低限行って、rllib
を使ったものも追加でやるのがいいか。OpenSpiel
open_spiel.python.vector_env import SyncVectorEnv
PettingZoo