Skip to content

Commit 3376e43

Browse files
Comment out eliminate-empty-tensors (#1866)
**Context:** The compile time increased too much after the migration to the one-shot bufferization pipeline. The bufferization [documentation](https://mlir.llvm.org/docs/Bufferization/) recommends running -eliminate-empty-tensors before running the one-shot bufferization. However, eliminating empty-tensors takes half of the already expensive compilation time for programs containing large functions. Without a clear benefit of running eliminate-empty-tensors and a clear cost in compilation time for programs of interest, commenting out this pass will drop compile times significantly in the programs of interest. **Description of the Change:** Comment out the -eliminate-empty-tensor pass from the frontend to avoid running it. **Benefits:** Decreased compilation time. **Possible Drawbacks:** Possible (unmeasured) increase in runtime memory allocations. **Related GitHub Issues:** Part 1 of [sc-93707] Co-authored-by: Joseph Lee <[email protected]>
1 parent 42e8605 commit 3376e43

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

frontend/catalyst/pipelines.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,10 @@ def get_bufferization_stage(options: CompileOptions) -> List[str]:
274274
"convert-tensor-to-linalg", # tensor.pad
275275
"convert-elementwise-to-linalg", # Must be run before --one-shot-bufferize
276276
"gradient-preprocess",
277-
"eliminate-empty-tensors",
277+
# "eliminate-empty-tensors",
278+
# Keep eliminate-empty-tensors commented out until benchmarks use more structure
279+
# and produce functions of reasonable size. Otherwise, eliminate-empty-tensors
280+
# will consume a significant amount of compile time along with one-shot-bufferize.
278281
####################
279282
"one-shot-bufferize{" + bufferization_options + "}",
280283
####################

0 commit comments

Comments
 (0)