diku-dk / futhark

:boom::computer::boom: A data-parallel functional programming language
http://futhark-lang.org
ISC License
2.4k stars 167 forks source link

Internal compiler error when supplying incorrct array size when using `futhark run` #1682

Closed Alexnortung closed 1 year ago

Alexnortung commented 2 years ago

I have the following program here. When running the following command I get an internal compiler error

echo "[[[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]]]
[2.0, 3.0]
[[[10.0, 2.0],[-1.0, -2.0]],[[20.0, 4.0], [-3.0, -4.0]]]
" | futhark run layers/convolutional.fut -e conv_layer_channels

The error I get is

Internal compiler error (unhandled IO exception).
Please report this at https://github.com/diku-dk/futhark/issues
src/Language/Futhark/Interpreter.hs:1918:13-63: Non-exhaustive patterns in (ShapeDim n
                                                         (ShapeDim m shape),
                                                xs')

In the previous command I use a 3 dimensional array, but the program expects a 4 dimensional array, so the following command works

echo "[[[[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]]]]
[2.0, 3.0]
[[[10.0, 2.0],[-1.0, -2.0]],[[20.0, 4.0], [-3.0, -4.0]]]
" | futhark run layers/convolutional.fut -e conv_layer_channels
athas commented 2 years ago

There is actually a FIXME in the source code for this one. I don't remember if I was just too lazy to fix it, or if it was just annoying and assumed to be a very rare situation, but having an issue for it can't hurt.