Skip to content

Commit

Permalink
Remove auto_gil.h (pytorch#108492)
Browse files Browse the repository at this point in the history
auto_gil.h has been deprecated for a long time. We can switch to pybind11.

Pull Request resolved: pytorch#108492
Approved by: https://github.com/Skylion007
  • Loading branch information
cyyever authored and pytorchmergebot committed Sep 5, 2023
1 parent a9d9803 commit efc7c36
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 48 deletions.
1 change: 0 additions & 1 deletion buckbuild.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,6 @@ def define_buck_targets(
# Don't need on mobile.
"torch/csrc/Exceptions.h",
"torch/csrc/python_headers.h",
"torch/csrc/utils/auto_gil.h",
"torch/csrc/jit/serialization/mobile_bytecode_generated.h",
],
),
Expand Down
2 changes: 1 addition & 1 deletion tools/autograd/templates/python_variable_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ static Tensor dispatch_to(const Tensor & self, Device device, bool non_blocking,
}

static Tensor dispatch_to(const Tensor & self, bool non_blocking, bool copy, c10::optional<c10::MemoryFormat> optional_memory_format) {
AutoNoGIL no_gil;
pybind11::gil_scoped_release no_gil;
return self.to(self.options().memory_format(optional_memory_format), non_blocking, copy);
}

Expand Down
1 change: 0 additions & 1 deletion torch/csrc/Exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <pybind11/pybind11.h>
#include <torch/csrc/Export.h>
#include <torch/csrc/jit/runtime/jit_exception.h>
#include <torch/csrc/utils/auto_gil.h>
#include <torch/csrc/utils/cpp_stacktraces.h>
#include <torch/csrc/utils/pybind.h>

Expand Down
1 change: 0 additions & 1 deletion torch/csrc/autograd/python_anomaly_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <torch/csrc/autograd/python_anomaly_mode.h>
#include <torch/csrc/autograd/python_cpp_function.h>
#include <torch/csrc/python_headers.h>
#include <torch/csrc/utils/auto_gil.h>
#include <torch/csrc/utils/object_ptr.h>
#include <torch/csrc/utils/pybind.h>
#include <torch/csrc/utils/python_strings.h>
Expand Down
1 change: 0 additions & 1 deletion torch/csrc/autograd/python_anomaly_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <pybind11/pybind11.h>
#include <torch/csrc/autograd/anomaly_mode.h>
#include <torch/csrc/python_headers.h>
#include <torch/csrc/utils/auto_gil.h>
#include <torch/csrc/utils/pybind.h>

namespace torch {
Expand Down
1 change: 0 additions & 1 deletion torch/csrc/jit/python/pybind_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <torch/csrc/jit/python/python_tracer.h>
#include <torch/csrc/jit/resource_guard.h>
#include <torch/csrc/jit/runtime/operator.h>
#include <torch/csrc/utils/auto_gil.h>
#include <torch/csrc/utils/pybind.h>
#include <torch/csrc/utils/python_arg_parser.h>
#include <torch/csrc/utils/six.h>
Expand Down
42 changes: 0 additions & 42 deletions torch/csrc/utils/auto_gil.h

This file was deleted.

0 comments on commit efc7c36

Please sign in to comment.