Skip to content
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

Error in runtime #57

Open
maartenvd opened this issue Jul 9, 2024 · 0 comments
Open

Error in runtime #57

maartenvd opened this issue Jul 9, 2024 · 0 comments

Comments

@maartenvd
Copy link

maartenvd commented Jul 9, 2024

I'm trying to combine MPSKit with CasetteOverlay, and depending on the julia version I'm running into different problems. On master I obtain crashes during type inference:

Internal error: during type inference of
...
MethodError(f=Base.string, args=(Expr(:||, Expr(:call, :===, Expr(:ref, Expr(:., :e, :(:args)), 1), Expr(:., :Core, :(:tuple))), Expr(:call, :===, Expr(:ref, Expr(:., :e, :(:args)), 1), Expr(:call, :GlobalRef, :Core, :(:tuple)))),), world=0x0000000000001776)
Encountered unexpected error in runtime:
MethodError(f=Base.string, args=(Expr(:||, Expr(:call, :===, Expr(:ref, Expr(:., :e, :(:args)), 1), Expr(:., :Core, :(:tuple))), Expr(:call, :===, Expr(:ref, Expr(:., :e, :(:args)), 1), Expr(:call, :GlobalRef, :Core, :(:tuple)))),), world=0x0000000000001776)
jl_method_error_bare at /home/maarten/julia/src/gf.c:2349
jl_method_error at /home/maarten/julia/src/gf.c:2367
jl_lookup_generic_ at /home/maarten/julia/src/gf.c:3282 [inlined]
ijl_apply_generic at /home/maarten/julia/src/gf.c:3297
_assert_tostring at ./error.jl:246
unknown function (ip: 0x7f0ebbbbd802)
abstract_eval_value_expr at ./compiler/abstractinterpretation.jl:2381
abstract_eval_value at ./compiler/abstractinterpretation.jl:2393
collect_argtypes at ./compiler/abstractinterpretation.jl:2405 [inlined]
abstract_eval_call at ./compiler/abstractinterpretation.jl:2435
abstract_eval_statement_expr at ./compiler/abstractinterpretation.jl:2675
abstract_eval_statement at ./compiler/abstractinterpretation.jl:2783
abstract_eval_basic_statement at ./compiler/abstractinterpretation.jl:3101
typeinf_local at ./compiler/abstractinterpretation.jl:3354
typeinf_nocycle at ./compiler/abstractinterpretation.jl:3436
_typeinf at ./compiler/typeinfer.jl:262
typeinf at ./compiler/typeinfer.jl:207
jfptr_typeinf_38163 at /home/maarten/julia/usr/lib/julia/sys.so (unknown line)
typeinf_edge at ./compiler/typeinfer.jl:923
abstract_call_method at ./compiler/abstractinterpretation.jl:660
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:101
abstract_call_known at ./compiler/abstractinterpretation.jl:2202
abstract_call at ./compiler/abstractinterpretation.jl:2284
abstract_call at ./compiler/abstractinterpretation.jl:2277
abstract_call at ./compiler/abstractinterpretation.jl:2427
abstract_eval_call at ./compiler/abstractinterpretation.jl:2440
abstract_eval_statement_expr at ./compiler/abstractinterpretation.jl:2675
abstract_eval_statement at ./compiler/abstractinterpretation.jl:2783
abstract_eval_basic_statement at ./compiler/abstractinterpretation.jl:3101
typeinf_local at ./compiler/abstractinterpretation.jl:3354
typeinf_nocycle at ./compiler/abstractinterpretation.jl:3436
_typeinf at ./compiler/typeinfer.jl:262
typeinf at ./compiler/typeinfer.jl:207
jfptr_typeinf_38163 at /home/maarten/julia/usr/lib/julia/sys.so (unknown line)
typeinf_edge at ./compiler/typeinfer.jl:923
abstract_call_method at ./compiler/abstractinterpretation.jl:660
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:101
abstract_call_known at ./compiler/abstractinterpretation.jl:2202
abstract_call at ./compiler/abstractinterpretation.jl:2284
abstract_call at ./compiler/abstractinterpretation.jl:2277
abstract_call at ./compiler/abstractinterpretation.jl:2427
abstract_eval_call at ./compiler/abstractinterpretation.jl:2440
abstract_eval_statement_expr at ./compiler/abstractinterpretation.jl:2675
abstract_eval_statement at ./compiler/abstractinterpretation.jl:2783
abstract_eval_basic_statement at ./compiler/abstractinterpretation.jl:3101
typeinf_local at ./compiler/abstractinterpretation.jl:3354
typeinf_nocycle at ./compiler/abstractinterpretation.jl:3436
_typeinf at ./compiler/typeinfer.jl:262
typeinf at ./compiler/typeinfer.jl:207
jfptr_typeinf_38163 at /home/maarten/julia/usr/lib/julia/sys.so (unknown line)
typeinf_edge at ./compiler/typeinfer.jl:923
abstract_call_method at ./compiler/abstractinterpretation.jl:660
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:101
abstract_call_known at ./compiler/abstractinterpretation.jl:2202
abstract_call at ./compiler/abstractinterpretation.jl:2284
abstract_call at ./compiler/abstractinterpretation.jl:2277
abstract_call at ./compiler/abstractinterpretation.jl:2427
abstract_eval_call at ./compiler/abstractinterpretation.jl:2440
abstract_eval_statement_expr at ./compiler/abstractinterpretation.jl:2675
abstract_eval_statement at ./compiler/abstractinterpretation.jl:2783
abstract_eval_basic_statement at ./compiler/abstractinterpretation.jl:3101
typeinf_local at ./compiler/abstractinterpretation.jl:3354
typeinf_nocycle at ./compiler/abstractinterpretation.jl:3436
_typeinf at ./compiler/typeinfer.jl:262
typeinf at ./compiler/typeinfer.jl:207
jfptr_typeinf_38163 at /home/maarten/julia/usr/lib/julia/sys.so (unknown line)
typeinf_edge at ./compiler/typeinfer.jl:923
abstract_call_method at ./compiler/abstractinterpretation.jl:660
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:101
abstract_call_known at ./compiler/abstractinterpretation.jl:2202
abstract_call at ./compiler/abstractinterpretation.jl:2284
abstract_call at ./compiler/abstractinterpretation.jl:2277
abstract_call at ./compiler/abstractinterpretation.jl:2427
abstract_eval_call at ./compiler/abstractinterpretation.jl:2440
abstract_eval_statement_expr at ./compiler/abstractinterpretation.jl:2675
abstract_eval_statement at ./compiler/abstractinterpretation.jl:2783
abstract_eval_basic_statement at ./compiler/abstractinterpretation.jl:3101
typeinf_local at ./compiler/abstractinterpretation.jl:3354
typeinf_nocycle at ./compiler/abstractinterpretation.jl:3436
_typeinf at ./compiler/typeinfer.jl:262
typeinf at ./compiler/typeinfer.jl:207
jfptr_typeinf_38163 at /home/maarten/julia/usr/lib/julia/sys.so (unknown line)
typeinf_edge at ./compiler/typeinfer.jl:923
abstract_call_method at ./compiler/abstractinterpretation.jl:660
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:101
abstract_call_known at ./compiler/abstractinterpretation.jl:2202
abstract_call at ./compiler/abstractinterpretation.jl:2284
abstract_call at ./compiler/abstractinterpretation.jl:2277
abstract_call at ./compiler/abstractinterpretation.jl:2427
abstract_eval_call at ./compiler/abstractinterpretation.jl:2440
abstract_eval_statement_expr at ./compiler/abstractinterpretation.jl:2675
abstract_eval_statement at ./compiler/abstractinterpretation.jl:2783
abstract_eval_basic_statement at ./compiler/abstractinterpretation.jl:3101
typeinf_local at ./compiler/abstractinterpretation.jl:3354
typeinf_nocycle at ./compiler/abstractinterpretation.jl:3436
_typeinf at ./compiler/typeinfer.jl:262
typeinf at ./compiler/typeinfer.jl:207
jfptr_typeinf_38163 at /home/maarten/julia/usr/lib/julia/sys.so (unknown line)
typeinf_edge at ./compiler/typeinfer.jl:923
abstract_call_method at ./compiler/abstractinterpretation.jl:660
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:101
abstract_call_known at ./compiler/abstractinterpretation.jl:2202
abstract_call at ./compiler/abstractinterpretation.jl:2284
abstract_call at ./compiler/abstractinterpretation.jl:2277
abstract_call at ./compiler/abstractinterpretation.jl:2427
abstract_eval_call at ./compiler/abstractinterpretation.jl:2440
abstract_eval_statement_expr at ./compiler/abstractinterpretation.jl:2675
abstract_eval_statement at ./compiler/abstractinterpretation.jl:2783
abstract_eval_basic_statement at ./compiler/abstractinterpretation.jl:3077
typeinf_local at ./compiler/abstractinterpretation.jl:3354
typeinf_nocycle at ./compiler/abstractinterpretation.jl:3436
_typeinf at ./compiler/typeinfer.jl:262
typeinf at ./compiler/typeinfer.jl:207
jfptr_typeinf_38163 at /home/maarten/julia/usr/lib/julia/sys.so (unknown line)
typeinf_edge at ./compiler/typeinfer.jl:923
abstract_call_method at ./compiler/abstractinterpretation.jl:660
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:101
abstract_call_known at ./compiler/abstractinterpretation.jl:2202
abstract_call at ./compiler/abstractinterpretation.jl:2284
abstract_call at ./compiler/abstractinterpretation.jl:2277
abstract_call at ./compiler/abstractinterpretation.jl:2427
abstract_eval_call at ./compiler/abstractinterpretation.jl:2440
abstract_eval_statement_expr at ./compiler/abstractinterpretation.jl:2675
abstract_eval_statement at ./compiler/abstractinterpretation.jl:2783
abstract_eval_basic_statement at ./compiler/abstractinterpretation.jl:3101
typeinf_local at ./compiler/abstractinterpretation.jl:3354
typeinf_nocycle at ./compiler/abstractinterpretation.jl:3436
_typeinf at ./compiler/typeinfer.jl:262
typeinf at ./compiler/typeinfer.jl:207
...

It also doesn't seem to run the detoured code, it at least fails to capture a few calls to my detoured function.

I don't have a small minimal example, the smallest example that reproduces this issue requires install MPSKit, MPSKitModels and TensorKit.

using TensorKit, MPSKit, MPSKitModels, CassetteOverlay
@MethodTable tighthacktable;
@overlay tighthacktable function MPSKit.∂∂AC(pos::Int, mps, mpoham::Union{MPOHamiltonian,SparseMPO}, cache)
    @show "highjacked",pos

    return MPSKit.MPO_∂∂AC(cache.opp[pos], leftenv(cache, pos, mps), rightenv(cache, pos, mps))
end

fmps_len = 20;
middle_site = Int(round(fmps_len/2))

ts = FiniteMPS(rand,ComplexF64,fmps_len,Rep[SU₂](1=>1),Rep[SU₂](i => 10 for i in 0:10));
th_orig = heisenberg_XXX(SU2Irrep);

tt = @overlaypass  tighthacktable;
  tt() do
    find_groundstate(ts,th_orig,DMRG(maxiter=3));
  end;
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

No branches or pull requests

1 participant