mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-19 19:00:47 +00:00
Improve performance by running ApplyTransformers on gradient graph
This commit is contained in:
parent
e986ae5f86
commit
e5fdb455ed
1 changed files with 5 additions and 0 deletions
|
|
@ -168,6 +168,11 @@ Status ModuleGradientGraphBuilder::BuildAndSplit(std::istream& model_istream,
|
|||
|
||||
gradient_graph.Resolve();
|
||||
|
||||
// Run the transformers again mainly for backward part.
|
||||
for (int i = static_cast<int>(TransformerLevel::Level1); i <= static_cast<int>(TransformerLevel::MaxLevel); i++) {
|
||||
ORT_RETURN_IF_ERROR(graph_transformation_mgr.ApplyTransformers(gradient_graph, static_cast<TransformerLevel>(i), *logger_));
|
||||
}
|
||||
|
||||
// Create two copies of gradient model for forward and backward models respectively.
|
||||
auto gradient_model_proto = model_->ToProto();
|
||||
ORT_RETURN_IF_ERROR(Model::Load(gradient_model_proto, forward_model_, nullptr, *logger_));
|
||||
|
|
|
|||
Loading…
Reference in a new issue