You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
support request => you might also like to ask your question on the mailing list or gitter chat.
Description
Using LLVM as backend gives different results than using the Interpreter.
From a high-level view, ignoring everything thought irrelevant, I have a simulator executing an iterated function x' = f(x), where f adds or subtracts at most 1 from a subset of elements of x. Domain rules dictate that no element will ever leave the inclusive integer bound [0, 70], which holds true when running with the interpreter. When using LLVM, this does not hold true.
I am inclined to believe that this might be a bug outside of my program for the following reasons:
The simulator checks every iteration (given run-time flags below) if any element of x exceeds 70, and if so,
prints out previous x (where no element should exceed the bounds, lest the simulator would have quit). x here refers to the slice of elements with depth 70 (which is maximum depth) for any spatial position in the 3D array freps, that is, in numpy notation, freps[:, :, -1].
Compare stack exec dca-exe -- --backend interp --log_iter 1
against stack exec dca-exe -- --backend cpu --log_iter 1
The interpreter runs without error and yields expected results.
The second, which uses LLVM, always quits due to previously mentioned check on "out of bounds" values, at a non-deterministic time (usually 200-1000 iterations which takes a minute or 2 on a laptop) despite there being no inherent randomness in the program (random seed is fixed). On exit, it will print (amongst other things), x and x', named Prev frep and Current frep respectively. "Prev" will be the last input without out-of-bounds values, while "Current" will have large values.
Tell me if you need more information about or explanation of the code.
The text was updated successfully, but these errors were encountered:
tsoernes
changed the title
Unexpected numerical results with LLVM but not with the Interpreter
Unexpected numerical results with LLVM Native but not with the Interpreter
Oct 22, 2018
As I just found out, both LLVM and the Interpreter gives the correct results when run with a different stack-yaml and .stack.work, that is, switching from this stack-yaml to this stack-yaml, and building with: stack build --stack-yaml stack-release.yaml.
Do note that the two yamls uses different .stack-work directory, which might point to the problem being corruption of temporary files, however I have tried both stack clean and ./myprog +ACC -fflush-cache -fforce-recomp -ACC without effect.
Uh, that is very strange. I never use ghc-options in the stack.yaml files, so not sure if those are doing something unexpected, though I doubt it? That looks like the only difference between the two files, right?
I wonder if this bug is still lurking somewhere, or if this really was a strange incremental build problem... |:
I am submitting a...
Description
Using LLVM as backend gives different results than using the Interpreter.
From a high-level view, ignoring everything thought irrelevant, I have a simulator executing an iterated function
x' = f(x)
, wheref
adds or subtracts at most 1 from a subset of elements ofx
. Domain rules dictate that no element will ever leave the inclusive integer bound[0, 70]
, which holds true when running with the interpreter. When using LLVM, this does not hold true.I am inclined to believe that this might be a bug outside of my program for the following reasons:
x
exceeds 70, and if so,prints out previous
x
(where no element should exceed the bounds, lest the simulator would have quit).x
here refers to the slice of elements with depth 70 (which is maximum depth) for any spatial position in the 3D arrayfreps
, that is, in numpy notation,freps[:, :, -1]
.x
are only ever changed byf
in increments or decrements of 1Steps to reproduce (for bugs)
https://github.com/tsoernes/haskelldca/tree/070ee164250fe1668392d18075de864107f3fde5
stack build
Compare
stack exec dca-exe -- --backend interp --log_iter 1
against
stack exec dca-exe -- --backend cpu --log_iter 1
The interpreter runs without error and yields expected results.
The second, which uses LLVM, always quits due to previously mentioned check on "out of bounds" values, at a non-deterministic time (usually 200-1000 iterations which takes a minute or 2 on a laptop) despite there being no inherent randomness in the program (random seed is fixed). On exit, it will print (amongst other things),
x
andx'
, namedPrev frep
andCurrent frep
respectively. "Prev" will be the last input without out-of-bounds values, while "Current" will have large values.Your environment
Tell me if you need more information about or explanation of the code.
The text was updated successfully, but these errors were encountered: