eth-sri / ilf

AI based fuzzer based on imitation learning
Apache License 2.0
149 stars 32 forks source link

running ILF fuzzer in parallel #8

Closed sunbeomso closed 4 years ago

sunbeomso commented 4 years ago

Hi, I am using ILF fuzzer using docker, following the build instruction in the readme.

If I would like to run multiple processes of ILF fuzzer in parallel, is it enough to simply execute multiple commands of ILF fuzzer? Or do I have to do some additional work (e.g., allocating different port number for each process)?

I guess that the ILF would perform fuzzing on the testnet. Then, if multiple processes are executed at the same time, the multiple processes may share the same port number for the testnet. I am curious if sharing the same port number among multiple processes of ILF fuzzer can affect results of ILF fuzzer.

LostBenjamin commented 4 years ago

Hi,

To run python3 -m ilf in parallel, you only need to execute multiple commands. ILF calls APIs of go-ethereum and runs a testnet within the same process. So you don't need to allocate ports for fuzzing.

To run python3 script/extract.py in parallel, you do need to allocate different port numbers.

Best, Jingxuan

sunbeomso commented 4 years ago

@LostBenjamin Thanks for the answers!

I have one more question. Does ILF perform multiprocessing for each invocation of ILF?

When running python -3 ilf in parallel with n multiple commands, ILF used m (>n) CPUs (checked by pressing 1 after typing top command in Ubuntu).

LostBenjamin commented 4 years ago

Hi,

The pytorch CPU computation may take multiple processes. You can restrict it to use only one process by calling torch.set_num_threads(1) in the beginning. However, this may make ILF slow (depending on your CPU model). Alternatively, you can run the pytorch computation on GPU (if available).

Best, Jingxuan

sunbeomso commented 4 years ago

Thanks!