Skip to content

Commit

Permalink
Update on "[Gradient Compression] Refactor CommHookInterface and Pyth…
Browse files Browse the repository at this point in the history
…onCommHook."

1. Let CommHookInterface::processFuture be a non-virtual method, which can be shared by both Python and C++ implementations.
2. Merge 1-line PythonCommHook constructor into the header for simplicity.
3. Rename processFuture method as parseFromHookResult for readability.
4. Simplify the comments.

Original PR issue: C++ DDP Communication Hook #46348

Differential Revision: [D24374282](https://our.internmc.facebook.com/intern/diff/D24374282/)

[ghstack-poisoned]
  • Loading branch information
wayi committed Oct 17, 2020
1 parent b284620 commit d01a4d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/csrc/distributed/c10d/comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class TORCH_API CommHookInterface {
class TORCH_PYTHON_API PythonCommHook : public CommHookInterface {
public:
PythonCommHook(py::object state, py::object hook)
: state_(std::move(state)), hook_(std::move(hook)){};
: state_(std::move(state)), hook_(std::move(hook)) {}

~PythonCommHook() override {
py::gil_scoped_acquire ag;
Expand Down

0 comments on commit d01a4d5

Please sign in to comment.