Skip to content

Commit

Permalink
remove torch
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengjieLi28 committed Jun 28, 2023
1 parent 860e3ed commit 3135a51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
5 changes: 0 additions & 5 deletions cpp/collective/rendezvous/include/store.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class Store {
compareSet(const std::string &key,
const std::vector<uint8_t> &currentValue,
const std::vector<uint8_t> &newValue) {
// TORCH_INTERNAL_ASSERT(false, "Not implemented.");
throw std::runtime_error("Not implemented.");
}

Expand Down Expand Up @@ -91,10 +90,6 @@ class Store {
// DELETE: callback(currentValue, c10::nullopt) // null newValue
virtual void watchKey(const std::string & /* unused */,
WatchKeyCallback /* unused */) {
// TORCH_CHECK(
// false,
// "watchKey only implemented for TCPStore and PrefixStore that
// wraps TCPStore.");
throw std::runtime_error("watchKey only implemented for TCPStore and "
"PrefixStore that wraps TCPStore.");
}
Expand Down
13 changes: 2 additions & 11 deletions cpp/collective/rendezvous/src/tcp_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ limitations under the License. */
#include <unordered_map>
#include <utility>

// TODO: Currently not support windows
#ifdef _WIN32
# include <io.h>
# include <winsock2.h>
Expand All @@ -33,7 +34,7 @@ limitations under the License. */
#endif

#ifdef _WIN32
# include <torch/csrc/distributed/xoscar/WinSockUtils.hpp>
// # include <WinSockUtils.hpp>
#else
# include "unix_sock_utils.hpp"
#endif
Expand Down Expand Up @@ -120,10 +121,6 @@ void BackgroundThread::stop() { SetEvent(ghStopEvent_); }
#else
void BackgroundThread::initStopSignal() {
if (pipe(controlPipeFd_.data()) == -1) {
// TORCH_CHECK(
// false,
// "Failed to create the control pipe to start the "
// "BackgroundThread run");
throw std::runtime_error("Failed to create the control pipe to start "
"the BackgroundThread run");
}
Expand Down Expand Up @@ -323,7 +320,6 @@ void TCPStoreMasterDaemon::query(int socket) {
} else if (qt == QueryType::MULTI_SET) {
multiSetHandler(socket);
} else {
// TORCH_CHECK(false, "Unexpected query type");
throw std::runtime_error("Unexpected query type");
}
}
Expand Down Expand Up @@ -1226,7 +1222,6 @@ bool TCPStore::check(const std::vector<std::string> &keys) {
if (response == detail::CheckResponseType::NOT_READY) {
return false;
}
// TORCH_CHECK(false, "ready or not_ready response expected");
throw std::runtime_error("ready or not_ready response expected");
}

Expand Down Expand Up @@ -1260,7 +1255,6 @@ void TCPStore::doWait(std::vector<std::string> keys,

auto response = client_->receiveValue<detail::WaitResponseType>();
if (response != detail::WaitResponseType::STOP_WAITING) {
// TORCH_CHECK(false, "Stop_waiting response is expected");
throw std::runtime_error("Stop_waiting response is expected");
}
}
Expand Down Expand Up @@ -1301,9 +1295,6 @@ TCPStore::multiGet(const std::vector<std::string> &keys) {

void TCPStore::multiSet(const std::vector<std::string> &keys,
const std::vector<std::vector<uint8_t>> &values) {
// TORCH_CHECK(
// keys.size() == values.size(),
// "multiSet keys and values vectors must be of same size");
assert(keys.size() == values.size());
const std::lock_guard<std::mutex> lock(activeOpLock_);

Expand Down

0 comments on commit 3135a51

Please sign in to comment.