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
and contains about 3000 lines of code, each of which has a few (on average, close to 1) arithmetic operations (only + and *) which take some mix of one of the 103 arguments, one of about 80 temporary (stack) variables, and floating point constants.
In forward mode, the file compiles in a second or two and creates a 50kB object (including debug info etc.)
However, templating the function and attempting to compute its adjoint took clang ~25 minutes to compile (at -O2), and resulted in a 55MB object. Adding #undef XAD_USE_STRONG_INLINE reduced the compile time to ~23 minutes, and the resulting object to ~30MB.
In any case, it seems that both the compile time and object size have increased by about 1000x - is that expected?
I am able to manually break up this function into about 12 smaller functions each emitting a scalar, which are then assembled by another ~100 or so operations into the final scalar. Would that help?
To Reproduce
I think that any (non-degenerate) random with this signature and this number of intermediate operations will experience the same issue.
Perhaps a test to validate compile time, object size, and runtime performance scaling as a function of input function size/complexity is worth writing?
Expected behaviour
I was expecting compile and runtime to increase by 10x or so, not 1000x.
Environment (please complete the following information):
OS: Ubuntu 24.04 LTS
Compiler: Clang 20, -O2 -g
CMake Configuration (if not default): Not using CMake (just including/linking to xad separately); xad was built with the default CMake configuration.
The text was updated successfully, but these errors were encountered:
I have a function with the following signature:
double F(double, double, double, std::array<double, 100>)
and contains about 3000 lines of code, each of which has a few (on average, close to 1) arithmetic operations (only + and *) which take some mix of one of the 103 arguments, one of about 80 temporary (stack) variables, and floating point constants.
In forward mode, the file compiles in a second or two and creates a 50kB object (including debug info etc.)
However, templating the function and attempting to compute its adjoint took clang ~25 minutes to compile (at -O2), and resulted in a 55MB object. Adding
#undef XAD_USE_STRONG_INLINE
reduced the compile time to ~23 minutes, and the resulting object to ~30MB.In any case, it seems that both the compile time and object size have increased by about 1000x - is that expected?
I am able to manually break up this function into about 12 smaller functions each emitting a scalar, which are then assembled by another ~100 or so operations into the final scalar. Would that help?
To Reproduce
I think that any (non-degenerate) random with this signature and this number of intermediate operations will experience the same issue.
Perhaps a test to validate compile time, object size, and runtime performance scaling as a function of input function size/complexity is worth writing?
Expected behaviour
I was expecting compile and runtime to increase by 10x or so, not 1000x.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: