Skip to content

Commit 4f318d5

Browse files
authored
fix: add checks for running shardy without raising (#1823)
* fix: add checks for running shardy without raising * fix: only run in the all case
1 parent 56f206c commit 4f318d5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Compiler.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1738,6 +1738,8 @@ function compile_mlir!(
17381738
()
17391739
end
17401740

1741+
legal_to_run_shardy_passes = compile_options.optimization_passes === :all
1742+
17411743
if compile_options.optimization_passes === :all
17421744
run_pass_pipeline!(
17431745
mod,
@@ -2173,7 +2175,7 @@ function compile_mlir!(
21732175
# shardy passes
21742176
use_shardy_partitioner = false
21752177
result_shardings = missing
2176-
if is_sharded
2178+
if is_sharded && legal_to_run_shardy_passes
21772179
module_op = copy(MLIR.IR.Operation(mod))
21782180
mod_copied = MLIR.IR.Module(module_op)
21792181

0 commit comments

Comments
 (0)