Reinforce scheduling invariants (#17132)
authorIlia Cherniavskii <iliacher@fb.com>
Thu, 21 Feb 2019 00:22:01 +0000 (16:22 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 21 Feb 2019 00:32:23 +0000 (16:32 -0800)
commit0337494c6a498f5c208a402d01a2a46020f9e6bd
treee166bb294de782bd79afa83493a2a27a0602064a
parent3e44880d4d91792ceb8235d7db0787028efe62cd
Reinforce scheduling invariants (#17132)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17132

schedule() function is not supposed to throw exception and is supposed
to succeed in scheduling the full graph of tasks, potential errors (e.g. errors
from underlying thread pool, out of memory exceptions etc) are considered not
recoverable.
The invariant - the graph of tasks is either not executed or
executed in full before the call to finishRun()

Reviewed By: andrewwdye

Differential Revision: D14092457

fbshipit-source-id: a3e5d65dfee5ff5e5e71ec72bb9e576180019698
caffe2/core/net_async_base.cc
caffe2/core/net_async_base.h
caffe2/core/net_async_scheduling.cc
caffe2/core/net_async_scheduling.h