mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
[TCPStore] Remove deprecated constructor (#136004)
While looking at TCPStore code again and found it confusing that we still keep the deprecated constructor for TCPStore in cpp while we don't expose it in python via pybind already. I checked both internal and external, all use cases in cpp (aside from unit test fixed in this PR) already moved to using option. So let's remove this legacy constructor to avoid confusion. Differential Revision: [D62653634](https://our.internmc.facebook.com/intern/diff/D62653634) Pull Request resolved: https://github.com/pytorch/pytorch/pull/136004 Approved by: https://github.com/Skylion007, https://github.com/XilunWu
This commit is contained in:
@ -178,11 +178,12 @@ TEST(TCPStoreTest, testCleanShutdown) {
|
||||
|
||||
auto serverTCPStore = std::make_unique<c10d::TCPStore>(
|
||||
"127.0.0.1",
|
||||
0,
|
||||
c10d::TCPStoreOptions{
|
||||
/* port */ 0,
|
||||
/* isServer */ true,
|
||||
numWorkers,
|
||||
true,
|
||||
std::chrono::seconds(defaultTimeout),
|
||||
/* wait */ false);
|
||||
/* waitWorkers */ false,
|
||||
/* timeout */ std::chrono::seconds(defaultTimeout)});
|
||||
c10d::test::set(*serverTCPStore, "key", "val");
|
||||
|
||||
auto clientTCPStore = c10::make_intrusive<c10d::TCPStore>(
|
||||
|
@ -249,23 +249,10 @@ class SendBuffer {
|
||||
using detail::Socket;
|
||||
|
||||
// TCPStore class methods
|
||||
TCPStore::TCPStore(
|
||||
const std::string& masterAddr,
|
||||
std::uint16_t masterPort,
|
||||
std::optional<int> numWorkers,
|
||||
bool isServer,
|
||||
const std::chrono::milliseconds& timeout,
|
||||
bool waitWorkers)
|
||||
: TCPStore{
|
||||
masterAddr,
|
||||
TCPStoreOptions{
|
||||
masterPort,
|
||||
isServer,
|
||||
numWorkers ? std::optional<std::size_t>(*numWorkers)
|
||||
: std::nullopt,
|
||||
waitWorkers,
|
||||
timeout}} {}
|
||||
|
||||
// Although we still allow multi-params in ctor in Python, that behavior is
|
||||
// removed from cpp and we construct the opts implicitly for users in the pybind
|
||||
// of TCPStore.
|
||||
TCPStore::TCPStore(std::string host, const TCPStoreOptions& opts)
|
||||
: Store{opts.timeout},
|
||||
addr_{std::move(host)},
|
||||
|
@ -75,14 +75,6 @@ class TORCH_API TCPStore : public Store {
|
||||
|
||||
explicit TCPStore(std::string host, const TCPStoreOptions& opts = {});
|
||||
|
||||
[[deprecated("Use TCPStore(host, opts) instead.")]] explicit TCPStore(
|
||||
const std::string& masterAddr,
|
||||
std::uint16_t masterPort,
|
||||
std::optional<int> numWorkers = std::nullopt,
|
||||
bool isServer = false,
|
||||
const std::chrono::milliseconds& timeout = kDefaultTimeout,
|
||||
bool waitWorkers = true);
|
||||
|
||||
~TCPStore() override;
|
||||
|
||||
void set(const std::string& key, const std::vector<uint8_t>& value) override;
|
||||
|
Reference in New Issue
Block a user