-
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
Option to not emit the full MLIR (only emit .tmp file) #2997
Conversation
Signed-off-by: Haruki Imai <[email protected]>
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. It would be an useful option. Thanks!
Could you add a lit test for this option if you don't mind?
src/Compiler/CompilerOptions.cpp
Outdated
@@ -281,6 +282,13 @@ static llvm::cl::opt<bool, true> printIROpt("printIR", | |||
llvm::cl::desc("Print the IR to stdout:."), llvm::cl::location(printIR), | |||
llvm::cl::init(false), llvm::cl::cat(OnnxMlirOptions)); | |||
|
|||
static llvm::cl::opt<bool, true> emitElidedIROnlyOpt("emitElidedIROnly", |
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.
emitElidedIROnly
is a bit confusing in the sense that it looks like other EmitONNXIR
, EmitMLIR
, ... How about doNotEmitFullMLIRCode
(--do-not-emit-full-mlir-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.
Updated the option name. Thanks!
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.
Also, added the lit test.
Signed-off-by: Haruki Imai <[email protected]>
Signed-off-by: Haruki Imai <[email protected]>
Jenkins Linux ppc64le Build #14981 [push] Option to not emit the f... started at 01:27 |
Jenkins Linux s390x Build #15955 [push] Option to not emit the f... started at 01:14 |
Jenkins Linux amd64 Build #15952 [push] Option to not emit the f... started at 00:14 |
Jenkins Linux amd64 Build #15952 [push] Option to not emit the f... passed after 1 hr 20 min |
Jenkins Linux s390x Build #15955 [push] Option to not emit the f... passed after 1 hr 58 min |
Jenkins Linux ppc64le Build #14981 [push] Option to not emit the f... passed after 2 hr 21 min |
When emitting MLIR by the option such as
--EmitONNXIR
etc., there are two versions of IR,<name>.onnx.mlir
and<name>.tmp
. Since the constant values are embedded in<name>.onnx.mlir
, we got memory and disk pressure especially in large models. In mistral-7b model, the MLIR size is about 50GB.This PR provides an option to not emit full MLIR(
<name>.onnx.mlir
). This option works with emitting MLIR options such as --EmitONNXIR and --EmitMLIR.