File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
paddle/fluid/framework/details Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,9 @@ static const char kLocalScopes[] = "local_scopes";
127
127
static const char kStrategy [] = " strategy" ;
128
128
129
129
void MultiDevSSAGraphBuilder::Init () const {
130
+ all_vars_.clear ();
131
+ balance_vars_.clear ();
132
+
130
133
loss_var_name_ = Get<const std::string>(kLossVarName );
131
134
places_ = Get<const std::vector<platform::Place>>(kPlaces );
132
135
local_scopes_ = Get<const std::vector<Scope *>>(kLocalScopes );
Original file line number Diff line number Diff line change @@ -40,12 +40,6 @@ class MultiDevSSAGraphBuilder : public ir::Pass {
40
40
size_t device_id) const ;
41
41
void Init () const ;
42
42
43
- private:
44
- mutable std::string loss_var_name_;
45
- mutable std::vector<platform::Place> places_;
46
- mutable std::vector<Scope *> local_scopes_;
47
- mutable std::unordered_set<std::string> grad_names_;
48
-
49
43
#ifdef PADDLE_WITH_CUDA
50
44
mutable platform::NCCLContextMap *nccl_ctxs_;
51
45
#endif
@@ -95,13 +89,17 @@ class MultiDevSSAGraphBuilder : public ir::Pass {
95
89
size_t GetAppropriateDeviceID (
96
90
const std::vector<std::string> &var_names) const ;
97
91
98
- private:
92
+ void SetCommunicationContext (OpHandleBase *op_handle,
93
+ const platform::Place &p) const ;
94
+
95
+ mutable std::string loss_var_name_;
96
+ mutable std::vector<platform::Place> places_;
97
+ mutable std::vector<Scope *> local_scopes_;
98
+ mutable std::unordered_set<std::string> grad_names_;
99
+
99
100
mutable BuildStrategy strategy_;
100
101
mutable std::unordered_map<std::string, VarDesc *> all_vars_;
101
102
mutable std::vector<int64_t > balance_vars_;
102
-
103
- void SetCommunicationContext (OpHandleBase *op_handle,
104
- const platform::Place &p) const ;
105
103
};
106
104
} // namespace details
107
105
} // namespace framework
You can’t perform that action at this time.
0 commit comments