minerllabs / minerl

MineRL Competition for Sample Efficient Reinforcement Learning - Python Package
http://minerl.io/docs/
Other
711 stars 153 forks source link

Are all v1.0.0 envs slower or just those using the new defaults? #679

Closed danijar closed 2 years ago

danijar commented 2 years ago

Hi, I found the versions.rst file that says v1.0.0 is slower than previous versions:

[Minecraft: 1.16.5] Slower than previous versions, but has more realistic action spaces (e.g. no autocrafting) and Minecraft Nether Update version.

The readme lists as major changes in v1.0.0:

New Minecraft version (11.2 -> 16.5) Larger resolution by default (64x64 -> 640x360) Near-human action-space: no more craft and smelt actions. Only GUI and mouse control (camera action moves mouse around). Observation space is only pixels, no more inventory observation by default.

What is the mentioned slowdown of v1.0.0 over v0.4.4 mainly caused by?

I'm wondering whether it only applies to envs that use the new defaults (especially larger render resolution) or to all environments, even when using the "old" observation and action spaces?

Thanks!

Miffyli commented 2 years ago

Hey! It is bit hard to pinpoint the exact reason why v1.0 is slower then previous ones, but short version is that v1.0 does not use Malmo and instead uses custom coded interaction API. This probably is notably slower than Malmo one as Malmo people spent good amount of time to make things fast.

There are no "older" envs in v1.0 so the impact is hard to measure (e.g., the crafting helper functions do not exist in v1.0 as they were part of Malmo), but at least two big things come to mind:

1) Resolution (as you stated). You can try changing this with HumanSurvival env with the resolution parameter (example). 2) All additional info on top of pixels slows things down, which are being used in the HumanSurvival env. E.g. all these observations as well as these "monitors". These were removed in the BASALT environments (e.g., MineRLBasaltFindCave-v0), so you could tinker around with that to see how fast things can be. 3) Minecraft version, but this is probably negligible compared to other overhead. Minecraft 1.16 might even be faster than 1.11 with all the optimizations game devs added.

PS: MineDojo has modified MineRL version which has been bit more optimized for speed: https://github.com/MineDojo/MineDojo . They also shared docker images which can run MineRL on the GPU instead of using CPU rendering: https://github.com/MineDojo/egl-docker

danijar commented 2 years ago

Thanks for the details, that's really helpful! I'll stick with v0.4.4 for now then because of the abstract crafting actions.