facebookresearch / phyre

PHYRE is a benchmark for physical reasoning.
https://phyre.ai
Apache License 2.0
431 stars 64 forks source link

phyre.initialize_simulator() is too slow #23

Closed ndrwmlnk closed 4 years ago

ndrwmlnk commented 4 years ago

Hi,

phyre.initialize_simulator() takes ~15 sec, no matter how many tasks we need, e.g. one task or all available tasks.

This is probably due to loading and unpacking of phyre/data/generated_tasks/tasks.bin.lzma permalink

with lzma.open(path) as stream:
    collection = phyre.simulator.deserialize(task_if.TaskCollection(), stream.read())

while debugging our solver, this every time delay of ~15 sec becomes annoying.

Would you consider e.g., unpacking all the tasks for the first time of usage of PHYRE in a local folder, and loading unpacked tasks from the folder for every further execution of PHYRE? phyre.initialize_simulator() should take ~1 sec then.

Any other ideas/solutions?

Thanks!

lauragustafson commented 4 years ago

I replicated this locally, and phyre.initialize_simulator takes ~1 second for me for a single task.

ndrwmlnk commented 4 years ago

System: macOS 10.14 PyCharm 2019.3 python=3.6 phyre=0.2.1

The timing depends on the Run/Debug mode: 8 sec in the Run mode vs. 29 sec in the Debug mode.

Terminal$ _python mysolver.py simulator = phyre.initialize_simulator( ('00000:000',) , 'ball' ) initialize_simulator done in 8 sec

PyCharm Run: _mysolver.py simulator = phyre.initialize_simulator( ('00000:000',) , 'ball' ) initialize_simulator done in 8 sec

PyCharm Debug: _mysolver.py simulator = phyre.initialize_simulator( ('00000:000',) , 'ball' ) initialize_simulator done in 29 sec

Any idea on how to reduce the timing from 29 sec to 1 sec in the PyCharm Debug mode?

Thanks!

akhti commented 4 years ago

Closing as stale