Skip to content

Executor should wait for operators before deleting the local scope #9464

Closed
@tonyyang-svail

Description

@tonyyang-svail

In every Executor:Run(), all the temporary variables are created in a local scope. This local scope (including variables belong to it) is deleted at the end of the Executor:Run().

Since operators maybe launched asynchronously, the host code has to explicitly add a wait. Otherwise, delete local scope may happen before the execution of an operator.

Sidenote: fetch_op, usually the last op to be executed, has a wait. So ProgramDesc with fetch op won't have this issue. But it is not guaranteed that every ProgramDesc has a fetch op at the end.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions