EnzymeAD / Enzyme

High-performance automatic differentiation of LLVM and MLIR.

Home Page:https://enzyme.mit.edu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segmentation fault on Kalman example

gaurav-arya opened this issue · comments

Error: ./build.sh: line 8: 1292571 Segmentation fault ./example_robot1

To reproduce, run cmake on ZuseZ4/kalman@162449f and then execute example_robot1

The error does not occur for small matrix size n, but does for n around 10 or larger

On the latest PR's, and LLVM15 [what I'm using since my 16 install is borked], this works for me successfully

wmoses@beast:~/git/Enzyme/enzyme/build16/kalman/build ((HEAD detached at 162449f)) $ ./example_robot1 
f(A) = 2014996114.987548, f(A + delta) = 2015560041.208067, f'(A)[0, 0] fd = 563926220.519066
Adup[0, 0] = 563787904.000000, Adup[0, 1] = 564505472.000000wmoses@beast:~/git/Enzyme/enzyme/build16/kalman/build ((HEAD detached at 162449f)) $ ./example_robot1 
f(A) = 2014996114.987548, f(A + delta) = 2015560041.208067, f'(A)[0, 0] fd = 563926220.519066
Adup[0, 0] = 563787904.000000, Adup[0, 1] = 564505472.000000wmoses@beast:~/git/Enzyme/enzyme/build16/kalman/build ((HEAD detached at 162449f)) $ ./example_robot1 
f(A) = 2014996114.987548, f(A + delta) = 2015560041.208067, f'(A)[0, 0] fd = 563926220.519066
Adup[0, 0] = 563787904.000000, Adup[0, 1] = 564505472.000000wmoses@beast:~/git/Enzyme/enzyme/build16/kalman/build ((HEAD detached at 162449f)) $ valgrind ./example_robot1 
==54593== Memcheck, a memory error detector
==54593== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==54593== Using Valgrind-3.22.0.GIT and LibVEX; rerun with -h for copyright info
==54593== Command: ./example_robot1
==54593== 
f(A) = 2014996114.987548, f(A + delta) = 2015560041.208067, f'(A)[0, 0] fd = 563926220.519066
Adup[0, 0] = 563787904.000000, Adup[0, 1] = 564505472.000000==54593== 
==54593== HEAP SUMMARY:
==54593==     in use at exit: 0 bytes in 0 blocks
==54593==   total heap usage: 149 allocs, 149 frees, 142,920 bytes allocated
==54593== 
==54593== All heap blocks were freed -- no leaks are possible
==54593== 
==54593== For lists of detected and suppressed errors, rerun with: -s
==54593== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
wmoses@beast:~/git/Enzyme/enzyme/build16/kalman/build ((HEAD detached at 162449f)) $ 

That said i never earlier had it erroring so @gaurav-arya it may be worth trying?