Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this PR added a offloading pass to offloading a large live range buffer to the host and reloading to device at the right place to reduce the memory peak.
![image](https://private-user-images.githubusercontent.com/1426912/345240324-e7345462-4154-44d7-8ef9-af7929a4f28e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODI3NDMsIm5iZiI6MTczOTI4MjQ0MywicGF0aCI6Ii8xNDI2OTEyLzM0NTI0MDMyNC1lNzM0NTQ2Mi00MTU0LTQ0ZDctOGVmOS1hZjc5MjlhNGYyOGUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMTQwMDQzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MzJiNTE5OTVlMzRkZjY4NjQ0ZGI1YjhmYzM2MTIxZTI3ZjhjMGZlZDk2ZjJmY2I3ZDVlYThkZDdhZjAzYzQ5ZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.ftcJqOe4rnMYiSb_KWb3sf2IQxG-HN9nFt9G4elrmx4)
benchmark on part training graph, this pass reduced 32% peak memory: