juliacon2021-workshop-pkgdev icon indicating copy to clipboard operation
juliacon2021-workshop-pkgdev copied to clipboard

Unable to run JET.jl tutorial notebooks - `MethodError: no method matching iterate(::Nothing)`

Open Arpit-Babbar opened this issue 4 years ago • 5 comments

Hi, thanks for the very nice workshop (still only 30 minutes in though!)

I get an error when I try to run the third cell of the jet.ipynb.

The cell is

@report_toplevel begin
    fib(n) = n ≤ 2 ? n : fib(n-1) + fib(n-2)
    fib(1000)
    fib(1000.0)
    fib(BigInt(1000))
    fib("1000")       # error !
end

The error I get is

MethodError: no method matching iterate(::Nothing)
Closest candidates are:
  iterate(::Union{LinRange, StepRangeLen}) at C:\Users\arpit\AppData\Local\Programs\Julia-1.7.0\share\julia\base\range.jl:826
  iterate(::Union{LinRange, StepRangeLen}, ::Integer) at C:\Users\arpit\AppData\Local\Programs\Julia-1.7.0\share\julia\base\range.jl:826
  iterate(::T) where T<:Union{Base.KeySet{<:Any, <:Dict}, Base.ValueIterator{<:Dict}} at C:\Users\arpit\AppData\Local\Programs\Julia-1.7.0\share\julia\base\dict.jl:695
  ...
Stacktrace:
 [1] indexed_iterate(I::Nothing, i::Int64)
   @ Base .\tuple.jl:92
 [2] abstract_call_method_with_const_args(analyzer::JET.JETAnalyzer{JET.BasicPass}, result::Core.Compiler.MethodCallResult, f::Any, argtypes::Vector{Any}, match::Core.MethodMatch, sv::Core.Compiler.InferenceState, va_override::Bool)
   @ JET C:\Users\arpit\.julia\packages\JET\jK0v3\src\abstractinterpretation.jl:187
 [3] abstract_call_gf_by_type(interp::JET.JETAnalyzer{JET.BasicPass}, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
   @ Core.Compiler .\compiler\abstractinterpretation.jl:113
 [4] abstract_call_gf_by_type
   @ C:\Users\arpit\.julia\packages\JET\jK0v3\src\abstractinterpretation.jl:64 [inlined]
 [5] abstract_call_known(interp::JET.JETAnalyzer{JET.BasicPass}, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
   @ Core.Compiler .\compiler\abstractinterpretation.jl:1342

Here's my output of versioninfo()

Julia Version 1.7.0
Commit 3bf9d17731 (2021-11-30 12:12 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: AMD Ryzen 7 1700 Eight-Core Processor
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-12.0.1 (ORCJIT, znver1)

Here's my JET version - [c3a54625] JET v0.5.2

I use WSL, but got the same error on native Windows.

Arpit-Babbar avatar Dec 18 '21 03:12 Arpit-Babbar

Please follow the installation instructions described in README -- then your JET version should be pinned to v0.4.5.

aviatesk avatar Dec 18 '21 07:12 aviatesk

Even after following the instructions to ensure my JET version is of v0.4.5(checked within the Jupyter notebook), I still seem to be getting the same error.

Arpit-Babbar avatar Dec 20 '21 13:12 Arpit-Babbar

What ] st outputs in notebook?

aviatesk avatar Dec 20 '21 13:12 aviatesk

Here it is -

  [1520ce14] AbstractTrees v0.3.4
  [6e4b80f9] BenchmarkTools v1.1.1
  [f68482b8] Cthulhu v2.1.0
  [587475ba] Flux v0.12.6
  [7073ff75] IJulia v1.23.2
  [c3a54625] JET v0.4.5
  [a79fb612] JETTest v0.1.4
  [1914dd2f] MacroTools v0.5.6
  [85b6ec6f] MethodAnalysis v0.4.4
  [132c30aa] ProfileSVG v0.2.1
  [c46f51b8] ProfileView v0.6.10
  [d330b81b] PyPlot v2.9.0
  [295af30f] Revise v3.1.17
  [aa65fe97] SnoopCompile v2.7.0

Arpit-Babbar avatar Dec 20 '21 13:12 Arpit-Babbar

ok, that sounds weird. Will look into this issue.

aviatesk avatar Dec 21 '21 08:12 aviatesk