Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ if(Python3_EXECUTABLE)
)
endif()

find_package(Torch 1.13 REQUIRED PATHS ${torch_cmake_prefix_path})
find_package(Torch 2.1.0 REQUIRED PATHS ${torch_cmake_prefix_path})

# ------------------------------------------------------------
# Targets
Expand Down
6 changes: 6 additions & 0 deletions src/cc/torchdistx/deferred_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,12 @@ class ProxyVariableHooks : public VariableHooksInterface {
inner_->requires_grad_(self, value);
}

void basic_autograd_not_implemented_fallback(const c10::OperatorHandle& op,
c10::DispatchKeySet dispatch_keys,
torch::jit::Stack* stack) const override {
inner_->basic_autograd_not_implemented_fallback(op, dispatch_keys, stack);
}

VariableHooksInterface* inner() noexcept {
return inner_;
}
Expand Down
6 changes: 3 additions & 3 deletions src/python/torchdistx/_C/fake.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <ATen/Context.h>
#include <ATen/Tensor.h>
#include <torch/csrc/utils/cuda_lazy_init.h>
#include <torch/csrc/utils/device_lazy_init.h>
#include <torch/csrc/utils/pybind.h>
#include <torchdistx/fake.h>

Expand All @@ -22,7 +22,7 @@ void pyEnterFakeMode(bool fake_cuda) {
// subsystem which would fail and prevent us from instantiating CUDA devices.
if (fake_cuda) {
if (!at::hasCUDA()) {
torch::utils::set_requires_cuda_init(false);
torch::utils::set_requires_device_init(at::kCUDA, false);
}
}
}
Expand All @@ -31,7 +31,7 @@ void pyLeaveFakeMode() {
leaveFakeMode();

if (!isFakeModeActive() && !at::hasCUDA()) {
torch::utils::set_requires_cuda_init(true);
torch::utils::set_requires_device_init(at::kCUDA,true);
}
}

Expand Down