Skip to content

Conversation

@chr5tphr
Copy link
Owner

@chr5tphr chr5tphr commented Jul 12, 2025

TODO:

  • attribution scores are currently wrong in BasicHook, likely an issue
    with the gradient inside BasicHook? Might be some cross-terms
    interacting that should not interact
  • finish draft and test implementation
  • add tests
  • add documentation

chr5tphr added 2 commits July 12, 2025 21:16
- torch 2.0.0 allows us to to pass multiple args and kwargs to hooks
- handle multiple inputs and outputs in core.Hook and core.BasicHook, by
  passing all required grad_outputs and inputs to the backward
  implementation
- BasicHook still only processes a single input
- Hook checks the function signature to allow backwards-compatibility

TODO:

- add tests
- add documentation

- This stands in conflict with #168, but promises a better
  implementation by handling inputs and outpus as common to a single
  function, rather than individually as proposed in #168
- This does not deal with parameter gradients, which are better left to a seperate PR
- This will implement #176
- based on #196, allow BasicHook to process multiple inputs/outputs at
  once
- not sure how useful this is

TODO:

- attribution scores are currently wrong in BasicHook, likely an issue
  with the gradient inside BasicHook? Might be some cross-terms
  interacting that should not interact
- finish draft and test implementation
- add tests
- add documentation
@chr5tphr chr5tphr force-pushed the main branch 4 times, most recently from 3fbdb43 to 6204e31 Compare July 31, 2025 14:44
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.

2 participants