-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NNPA] Memory reduction of stickified constant by stickifying at file writing #2917
Conversation
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
@jenkins-droid test this please. |
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
"The stickified tensor's buffer size and MemRef's size mismatched"); | ||
|
||
// Create a KrnlGlobalOp. | ||
KrnlGlobalOp constantGlobal = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the previous implementation with KrnlGlobalOp in comment or if false
branch, if you do not want to create an option to control the choice. You can define an option '--disable-krnl-constant-to-file' with default value of 'false'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Is this because we may reuse the previous implementation in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created directive NNPA_ZHIGH_STICKIFIEDCONST_GEN
to keep the original implementation. Currently commented out, but I confirmed it works when enabling this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we may reuse or compare the original implementation.
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Could you review again? |
@chentong319 Do you mind reviewing it? You have been very involved with this PR. Thanks |
Signed-off-by: Haruki Imai <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@jenkins-droid test this please. |
Jenkins Linux s390x Build #15951 [push] [NNPA] Memory reduction ... started at 09:49 |
Jenkins Linux amd64 Build #15948 [push] [NNPA] Memory reduction ... started at 08:49 |
Jenkins Linux ppc64le Build #14978 [push] [NNPA] Memory reduction ... started at 10:03 |
Jenkins Linux amd64 Build #15948 [push] [NNPA] Memory reduction ... passed after 1 hr 20 min |
Jenkins Linux s390x Build #15951 [push] [NNPA] Memory reduction ... passed after 1 hr 24 min |
Jenkins Linux ppc64le Build #14978 [push] [NNPA] Memory reduction ... passed after 2 hr 18 min |
… at file writing (onnx#2917)" This reverts commit 33b466e. Signed-off-by: Tung D. Le <[email protected]>
… at file writing (onnx#2917)" This reverts commit 33b466e. Signed-off-by: Tung D. Le <[email protected]>
This PR reduces memory usage for NNPA compilation. Current main branch creates stickified data in ZHighConstPropagationPass and keeps the data until compilation finish. This PR sets original data, not stickified data, in ZHighConstPropagationPass. Then, in the KrnlToLLVMPass, stickfied data is created and stored in the file, and deleted after writing into the file.