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

Generate symbol derivatives for outputs when requested #1916

Merged

Conversation

lukasstockner
Copy link
Contributor

Description

Currently, symbols are only flagged for derivative computation if

  • They're a dependency of an operation which requires derivatives
  • They're connected to a downstream layer parameter which requires derivatives
  • They're writable globals (except for N)

However, there's a fourth relevant case - when the renderer requests the symbol to be written as an output with derivatives. This is possible via SymLocationDesc, but in the current implementation, this only ends up writing derivatives if one of the three cases above also happens to be true.

Therefore, detect this case and explicitly mark the symbol as requiring dependencies.

Tests

No tests at the moment since it would require extensive changes to testshade. Let me know if this is something that you'd consider necessary here.

Checklist:

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have ensured that the change is tested somewhere in the testsuite (adding new test cases if necessary).
  • My code follows the prevailing code style of this project. If I haven't
    already run clang-format v17 before submitting, I definitely will look at
    the CI test that runs clang-format and fix anything that it highlights as
    being nonconforming.

Copy link

linux-foundation-easycla bot commented Jan 6, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

@lgritz
Copy link
Collaborator

lgritz commented Jan 6, 2025

CI doesn't (yet) test Windows -- I am working on it now, actually -- but I trust that you two have verified that this is the right fix, so I will merge.

@lgritz
Copy link
Collaborator

lgritz commented Jan 6, 2025

Sorry, that last comment was bogus, I had a different PR in mind. :-)

Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

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

LGTM2

@lgritz lgritz merged commit 016a468 into AcademySoftwareFoundation:main Jan 6, 2025
22 checks passed
@lukasstockner lukasstockner deleted the generate-output-derivs branch January 7, 2025 12:27
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.

3 participants