Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RPC] Terminate worker's childs first. #3669

Merged
merged 1 commit into from
Jul 30, 2019
Merged

[RPC] Terminate worker's childs first. #3669

merged 1 commit into from
Jul 30, 2019

Conversation

cbalint13
Copy link
Contributor

@cbalint13 cbalint13 commented Jul 30, 2019

This small PR address the issue of orphaned sub-process in the RPC.

Description:
During autotune process on small remote edges (like rpi, rk3399, etc) the transfered tar is unpacked and further compiled into shared object. It can happen that sub-process (usually compile process) runs much longer and will get orphaned on timeout .terminate(). See the list below.

Problem:
Such longer running orphans overlaps with current measuring process using CPU cycles and even on worse case can lead to out of memory on limited 1G-4G low memory devices.

Fix:
The PR assures that in case of timeout all childen instances are terminated with parent too and with help of #3574 the residual files are now cleaned properly.

  ├─g++ -shared -fPIC -o /tmp/tmpy1javnqz/tmp_func_4ad0b36aa69fae99.tar.so /tmp/tmpy1javnqz/tmp_func_4ad0b36aa69fae99/devc.cc...
  │   └─cc1plus -quiet -D_GNU_SOURCE /tmp/tmpy1javnqz/tmp_func_4ad0b36aa69fae99/devc.cc -quiet -dumpbase devc.cc-ml
  ├─g++ -shared -fPIC -o /tmp/tmpy3cbmbck/tmp_func_34edb6ad7349ebf1.tar.so /tmp/tmpy3cbmbck/tmp_func_34edb6ad7349ebf1/devc.cc...
  │   └─cc1plus -quiet -D_GNU_SOURCE /tmp/tmpy3cbmbck/tmp_func_34edb6ad7349ebf1/devc.cc -quiet -dumpbase devc.cc-ml
  ├─g++ -shared -fPIC -o /tmp/tmp182f7df1/tmp_func_4888c9a4c281177d.tar.so /tmp/tmp182f7df1/tmp_func_4888c9a4c281177d/devc.cc...
  │   └─cc1plus -quiet -D_GNU_SOURCE /tmp/tmp182f7df1/tmp_func_4888c9a4c281177d/devc.cc -quiet -dumpbase devc.cc-ml
  ├─g++ -shared -fPIC -o /tmp/tmpjk358ic7/tmp_func_99d315bf5d46550.tar.so /tmp/tmpjk358ic7/tmp_func_99d315bf5d46550/devc.cc...
  │   └─cc1plus -quiet -D_GNU_SOURCE /tmp/tmpjk358ic7/tmp_func_99d315bf5d46550/devc.cc -quiet -dumpbase devc.cc-mli
  ├─rngd -f
  │   └─4*[{rngd}]
  ├─sshd -D -oCiphers=aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc
  │   ├─sshd                                                                                                                                  
  │   │   └─sshd                                                                                                                                ...
  │   │       └─bash
  │   │           └─python3 -m tvm.exec.rpc_server --tracker=192.168.1.2:9190 --key=rk3399
  │   │               └─python3 -m tvm.exec.rpc_server --tracker=192.168.1.2:9190 --key=rk3399
  │   │                   └─python3 -m tvm.exec.rpc_server --tracker=192.168.1.2:9190 --key=rk3399
  │   │                       └─g++ -shared -fPIC -o /tmp/tmps7iiv8bj/tmp_func_7e67258cb8079498.tar.so ...
  │   │                           └─cc1plus -quiet -D_GNU_SOURCE /tmp/tmps7iiv8bj/tmp_func_7e67258cb8079498/devc.cc -quiet -dumpbase devc.cc-ml

@cbalint13
Copy link
Contributor Author

cbalint13 commented Jul 30, 2019

@eqy, @zhiics, @vinx13, @kevinthesun, @tqchen,
Please help with the review.

@cbalint13
Copy link
Contributor Author

@tqchen tqchen merged commit e099a6e into apache:master Jul 30, 2019
@tqchen
Copy link
Member

tqchen commented Jul 30, 2019

Thanks @cbalint13 !

@cbalint13 cbalint13 deleted the rpc branch July 30, 2019 23:57
wweic pushed a commit to wweic/tvm that referenced this pull request Aug 9, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants