modular
modular copied to clipboard
[BUG]: internal c++ exception breakpoint(-5) from the example notebook
Bug description
The example notebook Mandelbrot.ipynb fails at first command
Steps to reproduce
Try to execute https://github.com/modularml/mojo/blob/main/examples/notebooks/Mandelbrot.ipynb locally From the first command
#|code-fold: true
import benchmark
from complex import ComplexSIMD, ComplexFloat64
from math import iota
from python import Python
from sys.info import num_physical_cores
from algorithm import parallelize, vectorize
from tensor import Tensor
from utils.index import Index
alias float_type = DType.float64
alias simd_width = 2 * simdwidthof[float_type]()
got
error: Expression [4]:1:30: use of unknown declaration 'float_type'
def show_plot(tensor: Tensor[float_type]):
^~~~~~~~~~
error: Expression [4]:11:29: unexpected token in expression
for row in range(height):
^
error: Expression [4]:11:29: statements must start at the beginning of a line
for row in range(height):
^
error: Expression [4]:2:19: could not find builtin 'IntLiteral' type
alias scale = 10
^
error: Expression [4]:3:17: could not find builtin 'IntLiteral' type
alias dpi = 64
^
expression failed to parse (no further compiler diagnostics)
error: Expression [6]:2:20: use of unknown declaration 'float_type', 'fn' declarations require explicit variable declarations
let t = Tensor[float_type](height, width)
^~~~~~~~~~
error: Expression [6]:12:37: use of unknown declaration 'iota', 'fn' declarations require explicit variable declarations
let cx = min_x + (col + iota[float_type, simd_width]()) * scale_x
^~~~
error: Expression [6]:14:21: use of unknown declaration 'ComplexSIMD', 'fn' declarations require explicit variable declarations
let c = ComplexSIMD[float_type, simd_width](cx, cy)
^~~~~~~~~~~
error: Expression [6]:20:9: use of unknown declaration 'vectorize', 'fn' declarations require explicit variable declarations
vectorize[simd_width, compute_vector](width)
^~~~~~~~~
error: Expression [6]:27:22: use of unknown declaration 'benchmark', 'fn' declarations require explicit variable declarations
let vectorized = benchmark.run[bench[simd_width]](
^~~~~~~~~
error: Expression [6]:34:13: use of unknown declaration 'show_plot'
_ = show_plot(t)
^~~~~~~~~
expression failed to parse (no further compiler diagnostics)
error: Expression [7]:2:20: use of unknown declaration 'float_type', 'fn' declarations require explicit variable declarations
let t = Tensor[float_type](height, width)
^~~~~~~~~~
error: Expression [7]:12:37: use of unknown declaration 'iota', 'fn' declarations require explicit variable declarations
let cx = min_x + (col + iota[float_type, simd_width]()) * scale_x
^~~~
error: Expression [7]:14:21: use of unknown declaration 'ComplexSIMD', 'fn' declarations require explicit variable declarations
let c = ComplexSIMD[float_type, simd_width](cx, cy)
^~~~~~~~~~~
error: Expression [7]:18:9: use of unknown declaration 'vectorize', 'fn' declarations require explicit variable declarations
vectorize[simd_width, compute_vector](width)
^~~~~~~~~
error: Expression [7]:23:9: use of unknown declaration 'parallelize', 'fn' declarations require explicit variable declarations
parallelize[worker](height, height)
^~~~~~~~~~~
error: Expression [7]:25:24: use of unknown declaration 'benchmark', 'fn' declarations require explicit variable declarations
let parallelized = benchmark.run[bench_parallel[simd_width]](
^~~~~~~~~
error: Expression [7]:32:13: use of unknown declaration 'show_plot'
_ = show_plot(t)
^~~~~~~~~
expression failed to parse (no further compiler diagnostics)
error: Expression [9]:2:1: use of unknown declaration 'compare'
compare()
^~~~~~~
expression failed to parse (no further compiler diagnostics)
error: Execution was interrupted, reason: internal c++ exception breakpoint(-5)..
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
System information
On:
Apple M2 Pro
14.2.1 (23C71)
Apple clang version 15.0.0
mojo 0.7.0 (af002202)
modular 0.4.1 (2d8afe15)
jupyter --version
Selected Jupyter core packages...
IPython : 8.20.0
ipykernel : 6.29.0
ipywidgets : not installed
jupyter_client : 8.6.0
jupyter_core : 5.7.1
jupyter_server : 2.12.5
jupyterlab : 4.0.11
nbclient : 0.9.0
nbconvert : 7.14.2
nbformat : 5.9.2
notebook : not installed
qtconsole : not installed
traitlets : 5.14.1
The notebook itself only show a simplified error message, I select all from the output to got the full.
Hi @Renkai are any of the example notebooks working for you? is it just this one that's failing?
I'm getting the same problem with multiple notebooks (my own and "HelloMojo.ipynb". The exception prevents even the smallest code from running. The REPL works OK in the terminal. I've tried this on Ubuntu Jammy and Ubuntu Mantic.