Skip to content

1. Pass recurse=True to _convert_all_gradient_functions inside builder() so nested custom gradients inside gradient functions are registered lazily on demand. - #283

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_982462168
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_982462168

Conversation

@copybara-service

Copy link
Copy Markdown
  1. Pass recurse=True to _convert_all_gradient_functions inside builder() so nested custom gradients inside gradient functions are registered lazily on demand.
  2. Apply jax.lax.stop_gradient to _eval_subgraph inputs in _Subgraph.__call__.fn_fwd so higher-order autodiff does not attempt to differentiate through XlaCallModule (mhlo_apply), while keeping un-stopped args in lookup so captured residuals retain their tracers for fn_bwd.

…uilder()` so nested custom gradients inside gradient functions are registered lazily on demand.

2. Apply `jax.lax.stop_gradient` to `_eval_subgraph` inputs in `_Subgraph.__call__.fn_fwd` so higher-order autodiff does not attempt to differentiate through `XlaCallModule` (`mhlo_apply`), while keeping un-stopped `args` in `lookup` so captured residuals retain their tracers for `fn_bwd`.

PiperOrigin-RevId: 982462168
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.

1 participant