pytorch
0ccc38b7 - [caffe2] adds Cancel to SafeDequeueBlobsOp and SafeEnqueueBlobsOp (#44495)

Commit
5 years ago
[caffe2] adds Cancel to SafeDequeueBlobsOp and SafeEnqueueBlobsOp (#44495) Summary: ## Motivation * To be able to make C2 ops cancellable so we can safely exit. * Some C2 operators are now blocking thus being non-cancellable. If an error occurs we need to be able to safely stop all net execution so we can throw the exception to the caller. * When an error occurs in a net or it got cancelled, running ops will have the `Cancel` method called. * This diff adds `Cancel` method to the `SafeEnqueueBlobsOp` and `SafeDequeueBlobsOp` to have the call queue->close() to force all the blocking ops to return. * Adds unit test that verified the error propagation. Pull Request resolved: https://github.com/pytorch/pytorch/pull/44495 Test Plan: ## Unit Test added to verify that queue ops propagate errors ``` buck test caffe2/caffe2/python:hypothesis_test ``` Reviewed By: dzhulgakov Differential Revision: D23236088 Pulled By: dahsh fbshipit-source-id: daa90d9ee32483fb51195e269a52cf5987bb0a5a
Author
Parents
Loading