Skip to content

Fix DeepLift adjacent nonlinear hooks (#1104) (#1843)#1843

Open
craymichael wants to merge 1 commit into
meta-pytorch:masterfrom
craymichael:fix/1104-deeplift-adjacent-nonlinear
Open

Fix DeepLift adjacent nonlinear hooks (#1104) (#1843)#1843
craymichael wants to merge 1 commit into
meta-pytorch:masterfrom
craymichael:fix/1104-deeplift-adjacent-nonlinear

Conversation

@craymichael
Copy link
Copy Markdown
Contributor

@craymichael craymichael commented May 22, 2026

Summary:
Fixes #1104.

Issue: #1104
Issue summary: adjacent supported nonlinear modules could use stale output gradients in DeepLift.

  • Capture non-inplace module output gradients with a full backward pre-hook.
  • Keep the tensor-output fallback for inplace modules.
  • Add a regression test for adjacent MaxPool and ReLU modules with nonzero baselines.

Test Plan:

  • venv/uv/bin/python -m pytest -q tests/attr/test_deeplift_basic.py
  • Pyre: attempted venv/uv/bin/pyre --noninteractive --dot-pyre-directory /tmp/captum-pyre-logs-config check; blocked locally by broad pre-existing Pyre type-resolution failures resolving stdlib / torch imports.

Differential Revision: D106053881

Pulled By: craymichael

@meta-cla meta-cla Bot added the cla signed label May 22, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 22, 2026

@craymichael has imported this pull request. If you are a Meta employee, you can view this in D106053881.

…ch#1843)

Summary:
Fixes meta-pytorch#1104.

Issue: meta-pytorch#1104
Issue summary: adjacent supported nonlinear modules could use stale output gradients in DeepLift.
- Capture non-inplace module output gradients with a full backward pre-hook.
- Keep the tensor-output fallback for inplace modules.
- Add a regression test for adjacent MaxPool and ReLU modules with nonzero baselines.


Test Plan:
- venv/uv/bin/python -m pytest -q tests/attr/test_deeplift_basic.py
- Pyre: attempted `venv/uv/bin/pyre --noninteractive --dot-pyre-directory /tmp/captum-pyre-logs-config check`; blocked locally by broad pre-existing Pyre type-resolution failures resolving stdlib / torch imports.

Differential Revision: D106053881

Pulled By: craymichael
@meta-codesync meta-codesync Bot changed the title Fix DeepLift adjacent nonlinear hooks (#1104) Fix DeepLift adjacent nonlinear hooks (#1104) (#1843) May 26, 2026
@craymichael craymichael force-pushed the fix/1104-deeplift-adjacent-nonlinear branch from 29111e9 to 5ff6180 Compare May 26, 2026 21:19
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 26, 2026

@craymichael has exported this pull request. If you are a Meta employee, you can view the originating Diff in D106053881.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReLU activations causing divergence for DeepLiftShap

1 participant