Skip to content

Conversation

avik-pal
Copy link
Collaborator

julia> @code_hlo legalize_chlo_to_stablehlo=true dot(x_ra, x_ra)
error: 'builtin.module' op trying to schedule a pass on an unsupported operation
┌ Error: Compilation failed, MLIR module written to /tmp/reactant_lPiNJx/module_001_3yi4_post_all_pm.mlir
└ @ Reactant.MLIR.IR /mnt/software/lux/Reactant.jl/src/mlir/IR/Pass.jl:119
ERROR: "failed to run pass manager on module"
Stacktrace:
  [1] run!(pm::Reactant.MLIR.IR.PassManager, mod::Reactant.MLIR.IR.Module, key::String)
    @ Reactant.MLIR.IR /mnt/software/lux/Reactant.jl/src/mlir/IR/Pass.jl:163
  [2] run_pass_pipeline!(mod::Reactant.MLIR.IR.Module, pass_pipeline::String, key::String; enable_verifier::Bool)
    @ Reactant.Compiler /mnt/software/lux/Reactant.jl/src/Compiler.jl:1188
  [3] run_pass_pipeline!
    @ /mnt/software/lux/Reactant.jl/src/Compiler.jl:1183 [inlined]
  [4] compile_mlir!(mod::Reactant.MLIR.IR.Module, f::typeof(dot), args::Tuple{…}, callcache::Dict{…}, sdycache::Dict{…}; fn_kwargs::@NamedTuple{}, optimize::Bool, cudnn_hlo_optimize::Bool, shardy_passes::Symbol, no_nan::Bool, transpose_propagate::Symbol, reshape_propagate::Symbol, optimize_communications::Bool, assert_nonallocating::Bool, backend::String, raise::Bool, raise_first::Bool, donated_args::Symbol, optimize_then_pad::Bool, runtime::Val{…}, legalize_chlo_to_stablehlo::Bool, kwargs::@Kwargs{})
    @ Reactant.Compiler /mnt/software/lux/Reactant.jl/src/Compiler.jl:1563
  [5] (::Reactant.Compiler.var"#8#9"{Nothing, @Kwargs{}, typeof(dot), Tuple{}})(ctx::Reactant.MLIR.IR.Context)
    @ Reactant.Compiler /mnt/software/lux/Reactant.jl/src/Compiler.jl:1236
  [6] with_context(f::Reactant.Compiler.var"#8#9"{Nothing, @Kwargs{}, typeof(dot), Tuple{}}; allow_use_existing::Bool)
    @ Reactant.MLIR.IR /mnt/software/lux/Reactant.jl/src/mlir/IR/Context.jl:99
  [7] with_context(f::Function)
    @ Reactant.MLIR.IR /mnt/software/lux/Reactant.jl/src/mlir/IR/Context.jl:82
  [8] compile_mlir(f::Function, args::Tuple{…}; client::Nothing, kwargs::@Kwargs{})
    @ Reactant.Compiler /mnt/software/lux/Reactant.jl/src/Compiler.jl:1233
  [9] top-level scope
    @ /mnt/software/lux/Reactant.jl/src/Compiler.jl:2462
 [10] top-level scope
    @ none:1
Some type information was truncated. Use `show(err)` to see complete types.

I am not too sure why this fails

@Pangoraw
Copy link
Collaborator

Pangoraw commented Jun 12, 2025

I am not too sure why this fails

It is a func pass so you can try ["func.func(chlo-legalize-to-stablehlo)"] instead

@avik-pal
Copy link
Collaborator Author

Thanks that did the job

@avik-pal avik-pal requested a review from wsmoses June 12, 2025 16:06
@avik-pal avik-pal marked this pull request as ready for review June 12, 2025 16:06
avik-pal and others added 2 commits June 12, 2025 12:09
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@avik-pal avik-pal merged commit 632964e into main Jun 13, 2025
55 of 56 checks passed
@avik-pal avik-pal deleted the ap/new_passes branch June 13, 2025 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants