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

Core: Multiple input/param gradient modification #168

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Nov 4, 2022

  1. Core: Multiple input/param gradient modification

    - change the core Hook to support the modification of multiple inputs
      and params
    - for this, now each input and parameter that requires a gradient will
      be hooked, and a backward, which is aware of which the current 'sink'
      is, will be called for each
    - use View instead of custom Identity to produce a .grad_fn
    
    Note:
    - this may be a breaking change for custom hooks based on the old
      implementation
    
    TODO:
    - finish implementation:
        - parameters have no grad_fn, and we cannot simply overwrite them
          with a view; hooking directly with tensor hooks is problematic
          when the parameters are used in different functions
        - there may be potentially a better approach than calling the
          backward function once per 'sink', although the current
          implementation may allow for better modularity
        - multiple outputs are still not supported, it may be worth to think
          how to do it, however, it may also be better to do this at a later
          stage
    - implement tests
      - new tests for the new functionality: multiple inputs and params in
        hooks
      - fix old tests that assume the use of Identity and are not sink-aware
    - add documentation
    chr5tphr committed Nov 4, 2022
    Configuration menu
    Copy the full SHA
    8f11583 View commit details
    Browse the repository at this point in the history