forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PT FE] Optimize memory usage of patch_model (openvinotoolkit#27428)
### Details: - *`no_jit_trace` was using extra memory to get and store trace state, which contained all graph that was produced before, that increase memory consumption of tracing. For example for FLUX model it used about 20Gb of extra memory* - *Saving `args` on meta device didn't work without `no_jit_trace`. To workaround this issue we now pass args directly to forward without saving them in `Trampoline`. This allows better flow for arguments and reduce memory used to save those args. However this changes the behavior of `evaluate` of `ModuleExtension`, because now it uses the args that were passed to `convert` and not the original args.* optimum-cli for FLUX with `torch_dtype=torch.bfloat16` before change:  optimum-cli for FLUX with `torch_dtype=torch.bfloat16` after change:  Note: optimum doesn't yet support `torch_dtype=torch.bfloat16` for FLUX. ### Tickets: - *CVS-151254* --------- Signed-off-by: Maxim Vafin <[email protected]>
- Loading branch information
1 parent
f77795b
commit f7d7f38
Showing
1 changed file
with
29 additions
and
51 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