Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[math][RF] Define pullback of ROOT::Math::landau functions for AD #15501

Merged
merged 2 commits into from
May 20, 2024

Conversation

guitargeek
Copy link
Contributor

@guitargeek guitargeek commented May 13, 2024

To avoid fallback to numeric differentiation because the function is not
inlined.

The pullbacks were automatically generated with Clad master, and then
manually simplified. It was carefully checked that the updated unit
tests cover all code branches of the pullback.

@guitargeek guitargeek self-assigned this May 13, 2024
@guitargeek guitargeek requested a review from lmoneta as a code owner May 13, 2024 22:39
Copy link

github-actions bot commented May 14, 2024

Test Results

    11 files      11 suites   2d 6h 40m 29s ⏱️
 2 636 tests  2 636 ✅ 0 💤 0 ❌
27 440 runs  27 440 ✅ 0 💤 0 ❌

Results for commit b0241db.

♻️ This comment has been updated with latest results.

*d_x += _d_v / xi;
*d_x0 += -_d_v / xi;
*d_xi += _d_v * -((x - x0) / (xi * xi));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PetroZarytskyi, @vaithak, you take a look and maybe simplify this code?

Copy link

@vaithak vaithak May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean simplifying it manually or making changes in Clad to simplify the generated code ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplifying it manually.

@guitargeek guitargeek changed the title [math][RF] Define pullback of ROOT::Math::landau_cdf for AD [math][RF] Define pullback of ROOT::Math::landau functions for AD May 14, 2024
@guitargeek
Copy link
Contributor Author

Hi @vgvassilev, thanks for the initiative!

I notices that so far, the CladDerivator.h file only contains templated functions, but the new pullbacks in this PR are not. And they are quite big, so I'm not sure if inlining is worth it? Should we introduce a CladDerivator.cxx for them?

@vgvassilev
Copy link
Member

We will have a problem if we need to build hessians because we will need to provide the higher order propagators ourselves.

@vgvassilev
Copy link
Member

I suspect we could reduce the code of the landau pullback quite a lot.

To avoid fallback to numeric differentiation because the function is not
inlined.

The pullbacks were automatically generated with Clad master, and then
manually simplified. It was carefully checked that the updated unit
tests cover all code branches of the pullback.
In commit 50c76e1, the `flexibleInterp` function was called in the
code generated by `PiecewiseInterpolation::translate()` with the wrong
template arguments
@guitargeek
Copy link
Contributor Author

I suspect we could reduce the code of the landau pullback quite a lot.

I'm not sure there is still room for much improvement: I have already simplified a lot in my initial PR. Maybe we can merge it, and if you and @vaithak feel like simplifying the pullbacks manually, you can do so in a follow-up PR?

@vgvassilev
Copy link
Member

Yes, let's make progress here.

Copy link
Member

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, assuming we can work on further simplifying the code.

@guitargeek guitargeek merged commit d1ba9e1 into root-project:master May 20, 2024
13 of 14 checks passed
@guitargeek guitargeek deleted the landau_cdf_pullback branch May 20, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants