-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[training] splitting forward and backward graphs (#334)
A pass is added, which takes the forge graph and creates a `ForgeGraphModule`, by splitting the forward and backward parts of the graph. Since we are currently executing forward and backward pass as separate programs (functions) within a binary, splitting the graphs seems to be the natural approach. Forward graph is created by cloning the forward nodes of the original graph, and adding output nodes for all the intermediaate results the backward pass will need. The backward graph is constructed from backward nodes of the original graph and utilizing the intermediate results from the forward graph. For each gradient an output node is created. The `CompiledModel` is updated to have the state from both graphs. Additionally, `CompiledGraphState` is cleaned up a little - removing the unused stuff. In `lower_to_mlir()` removed the previous hacks - now we simply emit mlir function for each graph in `ForgeGraphModule` and no special hacks are needed for getting inputs/params/outputs of each graph. This change enables MNIST Linear training to work. Closes #100 #163
- Loading branch information
Showing
25 changed files
with
572 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.