Skip to content

UndefVarError: Ops not defined in Reactant #1943

@baggepinnen

Description

@baggepinnen

On latest released version of Reactant, julia v1.12

Since this is an undefvar error, I figured the stack trace is enough?

ERROR: UndefVarError: `Ops` not defined in `Reactant`
Suggestion: define the const at top-level before running function that uses it (stricter Julia v1.12+ rule).
Note: the binding state changed since the error occurred (was: 11, now: 0).
Stacktrace:
  [1] should_rewrite_call(ft::Any)
    @ Reactant ~/.julia/packages/Reactant/woboD/src/utils.jl:245
  [2] should_rewrite_invoke
    @ ~/.julia/packages/Reactant/woboD/src/utils.jl:280 [inlined]
  [3] call_with_reactant_generator(world::UInt64, source::Union{LineNumberNode, Method}, self::Any, redub_arguments::Any)
    @ Reactant ~/.julia/packages/Reactant/woboD/src/utils.jl:735
  [4] make_mlir_fn(f::typeof(create), args::Tuple{…}, kwargs::@NamedTuple{}, name::String, concretein::Bool; toscalar::Bool, return_dialect::Symbol, args_in_result::Symbol, construct_function_without_args::Bool, do_transpose::Bool, input_shardings::Nothing, output_shardings::Nothing, runtime::Val{…}, verify_arg_names::Nothing, argprefix::Symbol, resprefix::Symbol, resargprefix::Symbol, num_replicas::Int64, optimize_then_pad::Bool)
    @ Reactant.TracedUtils ~/.julia/packages/Reactant/woboD/src/TracedUtils.jl:347
  [5] make_mlir_fn
    @ ~/.julia/packages/Reactant/woboD/src/TracedUtils.jl:275 [inlined]
  [6] compile_mlir!(mod::Reactant.MLIR.IR.Module, f::typeof(create), args::Tuple{…}, compile_options::CompileOptions, callcache::Dict{…}, sdycache::Dict{…}, sdygroupidcache::Tuple{…}; fn_kwargs::@NamedTuple{}, backend::String, runtime::Val{…}, legalize_stablehlo_to_mhlo::Bool, client::Reactant.XLA.PJRT.Client, kwargs::@Kwargs{})
    @ Reactant.Compiler ~/.julia/packages/Reactant/woboD/src/Compiler.jl:1627
  [7] compile_xla(f::Function, args::Tuple{…}; before_xla_optimizations::Bool, client::Nothing, serializable::Bool, kwargs::@Kwargs{})
    @ Reactant.Compiler ~/.julia/packages/Reactant/woboD/src/Compiler.jl:3550
  [8] compile_xla
    @ ~/.julia/packages/Reactant/woboD/src/Compiler.jl:3522 [inlined]
  [9] compile(f::Function, args::Tuple{…}; kwargs::@Kwargs{})
    @ Reactant.Compiler ~/.julia/packages/Reactant/woboD/src/Compiler.jl:3626
 [10] macro expansion
    @ ~/.julia/packages/Reactant/woboD/src/Compiler.jl:2695 [inlined]
 [11] create_r(A::SMatrix{…}, B::SMatrix{…}, C::SMatrix{…}, Q::SMatrix{…}, R::SMatrix{…}, Rr::SMatrix{…}, Ts::Float64, umin::SVector{…}, umax::SVector{…}; Np::Int64)
    @ Main ~/.julia/dev/LinearMPC/example/bench_creation.jl:56

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions