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
Running this code with Clad results in a compile-time crash.
Stack Trace
Stack dump:
0. Program arguments: /usr/lib/llvm-10/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name bug-rev-fn-call-array.cpp -mrelocation-model static -mthread-model posix -mframe-pointer=all -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -resource-dir /usr/lib/llvm-10/lib/clang/10.0.0 -I /home/parth/clubs/open-source/clad/pristine/builds/build-10/inst/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-10/lib/clang/10.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /home/parth/clubs/open-source/clad/tutorial -ferror-limit 19 -fmessage-length 0 -fgnuc-version=4.2.1 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -add-plugin clad -load /home/parth/clubs/open-source/clad/pristine/builds/build-10/inst/lib/clad.so -plugin-arg-clad -fdump-derived-fn -faddrsig -o /tmp/bug-rev-fn-call-array-e55a8c.o -x c++ bug-rev-fn-call-array.cpp
1. <eof> parser at end of file
#0 0x00007f06970be4ff llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x9814ff)
#1 0x00007f06970bc7b0 llvm::sys::RunSignalHandlers() (/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x97f7b0)
#2 0x00007f06970beac5 (/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x981ac5)
#3 0x00007f069d88e3c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
#4 0x00007f069b6e94f1 clang::ASTContext::getTypeInfoImpl(clang::Type const*) const (/lib/x86_64-linux-gnu/libclang-cpp.so.10+0x9184f1)
#5 0x00007ffcf00c8960
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-10/bin
clang: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/bug-rev-fn-call-array-847715.cpp
clang: note: diagnostic msg: /tmp/bug-rev-fn-call-array-847715.sh
clang: note: diagnostic msg:
********************
/usr/lib/llvm-10/bin/clang++ -g -Xclang -add-plugin -Xclang clad -Xclang -load -Xclang /home/parth/clubs/open-source/clad/pristine/builds/build-10/inst/lib/clad.so -Xclang -plugin-arg-clad -Xclang -fdump-derived-fn -I/home/parth/clubs/open-source/clad/pristine/builds/build-10/inst/include -x c++ -std=c++11 bug-rev-fn-call-array.cpp -o build/bug-rev-fn-call-array && build/bug-rev-fn-call-array
The root cause of the error is that we are trying to differentiate the function call using the forward mode AD since there is only one argument. We cannot use the forward mode AD on array arguments because array has multiple elements, thus we should not try to use forward mode AD for single array argument functions.
The text was updated successfully, but these errors were encountered:
The pullback function approach allows to "continue" the reverse mode automatic derivation when required.
This allows correctly computing derivatives when arguments are passed by reference or pointers.
This commit also modifies custom gradient functions to custom pullback functions.
Closesvgvassilev#281, Closesvgvassilev#386, Closesvgvassilev#387
The pullback function approach allows to "continue" the reverse mode automatic derivation when required.
This allows correctly computing derivatives when arguments are passed by reference or pointers.
This commit also modifies custom gradient functions to custom pullback functions.
Closes#281, Closes#386, Closes#387
Reproducible example:
Running this code with Clad results in a compile-time crash.
Stack Trace
The root cause of the error is that we are trying to differentiate the function call using the forward mode AD since there is only one argument. We cannot use the forward mode AD on array arguments because array has multiple elements, thus we should not try to use forward mode AD for single array argument functions.
The text was updated successfully, but these errors were encountered: