-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Improve debuggability of activation checkpointing #102241
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ghstack-poisoned]
soulitzer
added a commit
that referenced
this pull request
May 25, 2023
ghstack-source-id: bc0782e3977d0844f71ffabaa2002c370bd6f3f6 Pull Request resolved: #102241
soulitzer
added
release notes: autograd
release notes category
topic: improvements
topic category
labels
May 25, 2023
[ghstack-poisoned]
soulitzer
added a commit
that referenced
this pull request
May 25, 2023
ghstack-source-id: c99720afe0bdccf2edfdbe48bc4b47e66d658de5 Pull Request resolved: #102241
[ghstack-poisoned]
soulitzer
added a commit
that referenced
this pull request
May 25, 2023
ghstack-source-id: 35bd4d9e57ce663740a1a62d19103727aa8cdcca Pull Request resolved: #102241
[ghstack-poisoned]
This was referenced Jun 2, 2023
soulitzer
added a commit
that referenced
this pull request
Jun 2, 2023
ghstack-source-id: d07c48373a5d74f7bda8c1fdb382cdb88e0a5482 Pull Request resolved: #102241
[ghstack-poisoned]
soulitzer
added a commit
that referenced
this pull request
Jun 2, 2023
ghstack-source-id: b5e1491c330a4811e83490fe2cf409207c041ba0 Pull Request resolved: #102241
<details> <summary> click to see error message when debug='True' </summary> ``` torch.utils.checkpoint.CheckpointError: torch.utils.checkpoint: Recomputed values for the following tensors have different metadata than during the forward pass. tensor at position 1: saved metadata: {'shape': torch.Size([1]), 'dtype': torch.float32, 'device': device(type='cpu')} recomputed metadata: {'shape': torch.Size([2]), 'dtype': torch.float32, 'device': device(type='cpu')} The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/local/pytorch1/test/test_autograd.py", line 5692, in test_checkpoint_detects_non_determinism out.backward() File "/local/pytorch1/torch/_tensor.py", line 488, in backward torch.autograd.backward( File "/local/pytorch1/torch/autograd/__init__.py", line 204, in backward Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass File "/local/pytorch1/torch/utils/checkpoint.py", line 1065, in unpack_hook_with_error_cb frame.unpack_error_cb(e) File "/local/pytorch1/torch/utils/checkpoint.py", line 936, in unpack_error_cb raise CheckpointError( torch.utils.checkpoint.CheckpointError: An error happened while unpacking tensors; dumping logs of latest computation because you passed `debug=True` to `torch.utils.checkpoint.checkpoint()`. Scroll all the way down for guidance on how to navigate these logs. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ | 1. Stack traces of the operators that ran in the original forward | +------------------------------------------------------------------------------+ $1: f32[1] = torch._ops.aten.sin.default($0) (1 of 2 in original) /local/pytorch1/test/test_autograd.py:5648:save_2_tensors /local/pytorch1/test/test_autograd.py:5658:fn /local/pytorch1/torch/utils/checkpoint.py:1177:_checkpoint_without_reentrant /local/pytorch1/torch/utils/checkpoint.py:431:checkpoint /local/pytorch1/test/test_autograd.py:5691:test_checkpoint_detects_non_determinism /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:550:_callTestMethod /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:592:run /local/pytorch1/torch/testing/_internal/common_utils.py:2248:_run_with_retry /local/pytorch1/torch/testing/_internal/common_utils.py:2319:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:651:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/runner.py:184:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:271:runTests /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:101:__init__ /local/pytorch1/torch/testing/_internal/common_utils.py:892:run_tests /local/pytorch1/test/test_autograd.py:11248:<module> $2: f32[1] = torch._ops.aten.exp.default($1) (2 of 2 in original) /local/pytorch1/test/test_autograd.py:5648:save_2_tensors /local/pytorch1/test/test_autograd.py:5658:fn /local/pytorch1/torch/utils/checkpoint.py:1177:_checkpoint_without_reentrant /local/pytorch1/torch/utils/checkpoint.py:431:checkpoint /local/pytorch1/test/test_autograd.py:5691:test_checkpoint_detects_non_determinism /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:550:_callTestMethod /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:592:run /local/pytorch1/torch/testing/_internal/common_utils.py:2248:_run_with_retry /local/pytorch1/torch/testing/_internal/common_utils.py:2319:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:651:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/runner.py:184:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:271:runTests /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:101:__init__ /local/pytorch1/torch/testing/_internal/common_utils.py:892:run_tests /local/pytorch1/test/test_autograd.py:11248:<module> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ | 2. Stack traces of the operators that ran during recomputation | +------------------------------------------------------------------------------+ $1: f32[1] = torch._ops.aten.detach.default($0) (1 of 8 in recompute) /local/pytorch1/torch/utils/checkpoint.py:998:pack_hook /local/pytorch1/test/test_autograd.py:5651:save_2_tensors_alt /local/pytorch1/test/test_autograd.py:5660:fn /local/pytorch1/torch/utils/checkpoint.py:1161:recompute_fn /local/pytorch1/torch/utils/checkpoint.py:1041:unpack_hook /local/pytorch1/torch/utils/checkpoint.py:1063:unpack_hook_with_error_cb /local/pytorch1/torch/autograd/__init__.py:204:backward /local/pytorch1/torch/_tensor.py:488:backward /local/pytorch1/test/test_autograd.py:5692:test_checkpoint_detects_non_determinism /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:550:_callTestMethod /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:592:run /local/pytorch1/torch/testing/_internal/common_utils.py:2248:_run_with_retry /local/pytorch1/torch/testing/_internal/common_utils.py:2319:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:651:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/runner.py:184:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:271:runTests /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:101:__init__ /local/pytorch1/torch/testing/_internal/common_utils.py:892:run_tests /local/pytorch1/test/test_autograd.py:11248:<module> $2: f32[1] = torch._ops.aten.detach.default($1) (2 of 8 in recompute) /local/pytorch1/torch/utils/checkpoint.py:998:pack_hook /local/pytorch1/test/test_autograd.py:5651:save_2_tensors_alt /local/pytorch1/test/test_autograd.py:5660:fn /local/pytorch1/torch/utils/checkpoint.py:1161:recompute_fn /local/pytorch1/torch/utils/checkpoint.py:1041:unpack_hook /local/pytorch1/torch/utils/checkpoint.py:1063:unpack_hook_with_error_cb /local/pytorch1/torch/autograd/__init__.py:204:backward /local/pytorch1/torch/_tensor.py:488:backward /local/pytorch1/test/test_autograd.py:5692:test_checkpoint_detects_non_determinism /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:550:_callTestMethod /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:592:run /local/pytorch1/torch/testing/_internal/common_utils.py:2248:_run_with_retry /local/pytorch1/torch/testing/_internal/common_utils.py:2319:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:651:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/runner.py:184:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:271:runTests /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:101:__init__ /local/pytorch1/torch/testing/_internal/common_utils.py:892:run_tests /local/pytorch1/test/test_autograd.py:11248:<module> $3: f32[1] = torch._ops.aten.detach.default($0) (3 of 8 in recompute) /local/pytorch1/torch/utils/checkpoint.py:1005:pack_hook /local/pytorch1/test/test_autograd.py:5651:save_2_tensors_alt /local/pytorch1/test/test_autograd.py:5660:fn /local/pytorch1/torch/utils/checkpoint.py:1161:recompute_fn /local/pytorch1/torch/utils/checkpoint.py:1041:unpack_hook /local/pytorch1/torch/utils/checkpoint.py:1063:unpack_hook_with_error_cb /local/pytorch1/torch/autograd/__init__.py:204:backward /local/pytorch1/torch/_tensor.py:488:backward /local/pytorch1/test/test_autograd.py:5692:test_checkpoint_detects_non_determinism /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:550:_callTestMethod /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:592:run /local/pytorch1/torch/testing/_internal/common_utils.py:2248:_run_with_retry /local/pytorch1/torch/testing/_internal/common_utils.py:2319:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:651:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/runner.py:184:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:271:runTests /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:101:__init__ /local/pytorch1/torch/testing/_internal/common_utils.py:892:run_tests /local/pytorch1/test/test_autograd.py:11248:<module> $4: f32[1] = torch._ops.aten.detach.default($3) (4 of 8 in recompute) /local/pytorch1/torch/utils/checkpoint.py:1005:pack_hook /local/pytorch1/test/test_autograd.py:5651:save_2_tensors_alt /local/pytorch1/test/test_autograd.py:5660:fn /local/pytorch1/torch/utils/checkpoint.py:1161:recompute_fn /local/pytorch1/torch/utils/checkpoint.py:1041:unpack_hook /local/pytorch1/torch/utils/checkpoint.py:1063:unpack_hook_with_error_cb /local/pytorch1/torch/autograd/__init__.py:204:backward /local/pytorch1/torch/_tensor.py:488:backward /local/pytorch1/test/test_autograd.py:5692:test_checkpoint_detects_non_determinism /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:550:_callTestMethod /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:592:run /local/pytorch1/torch/testing/_internal/common_utils.py:2248:_run_with_retry /local/pytorch1/torch/testing/_internal/common_utils.py:2319:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:651:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/runner.py:184:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:271:runTests /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:101:__init__ /local/pytorch1/torch/testing/_internal/common_utils.py:892:run_tests /local/pytorch1/test/test_autograd.py:11248:<module> $5: f32[1] = torch._ops.aten.sin.default($0) (5 of 8 in recompute) /local/pytorch1/test/test_autograd.py:5651:save_2_tensors_alt /local/pytorch1/test/test_autograd.py:5660:fn /local/pytorch1/torch/utils/checkpoint.py:1161:recompute_fn /local/pytorch1/torch/utils/checkpoint.py:1041:unpack_hook /local/pytorch1/torch/utils/checkpoint.py:1063:unpack_hook_with_error_cb /local/pytorch1/torch/autograd/__init__.py:204:backward /local/pytorch1/torch/_tensor.py:488:backward /local/pytorch1/test/test_autograd.py:5692:test_checkpoint_detects_non_determinism /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:550:_callTestMethod /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:592:run /local/pytorch1/torch/testing/_internal/common_utils.py:2248:_run_with_retry /local/pytorch1/torch/testing/_internal/common_utils.py:2319:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:651:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/runner.py:184:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:271:runTests /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:101:__init__ /local/pytorch1/torch/testing/_internal/common_utils.py:892:run_tests /local/pytorch1/test/test_autograd.py:11248:<module> $6: f32[2] = torch._ops.aten.lift_fresh.default($6) (6 of 8 in recompute) /local/pytorch1/test/test_autograd.py:5651:save_2_tensors_alt /local/pytorch1/test/test_autograd.py:5660:fn /local/pytorch1/torch/utils/checkpoint.py:1161:recompute_fn /local/pytorch1/torch/utils/checkpoint.py:1041:unpack_hook /local/pytorch1/torch/utils/checkpoint.py:1063:unpack_hook_with_error_cb /local/pytorch1/torch/autograd/__init__.py:204:backward /local/pytorch1/torch/_tensor.py:488:backward /local/pytorch1/test/test_autograd.py:5692:test_checkpoint_detects_non_determinism /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:550:_callTestMethod /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:592:run /local/pytorch1/torch/testing/_internal/common_utils.py:2248:_run_with_retry /local/pytorch1/torch/testing/_internal/common_utils.py:2319:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:651:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/runner.py:184:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:271:runTests /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:101:__init__ /local/pytorch1/torch/testing/_internal/common_utils.py:892:run_tests /local/pytorch1/test/test_autograd.py:11248:<module> $7: f32[2] = torch._ops.aten.detach.default($6) (7 of 8 in recompute) /local/pytorch1/torch/utils/checkpoint.py:998:pack_hook /local/pytorch1/test/test_autograd.py:5651:save_2_tensors_alt /local/pytorch1/test/test_autograd.py:5660:fn /local/pytorch1/torch/utils/checkpoint.py:1161:recompute_fn /local/pytorch1/torch/utils/checkpoint.py:1041:unpack_hook /local/pytorch1/torch/utils/checkpoint.py:1063:unpack_hook_with_error_cb /local/pytorch1/torch/autograd/__init__.py:204:backward /local/pytorch1/torch/_tensor.py:488:backward /local/pytorch1/test/test_autograd.py:5692:test_checkpoint_detects_non_determinism /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:550:_callTestMethod /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:592:run /local/pytorch1/torch/testing/_internal/common_utils.py:2248:_run_with_retry /local/pytorch1/torch/testing/_internal/common_utils.py:2319:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:651:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/runner.py:184:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:271:runTests /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:101:__init__ /local/pytorch1/torch/testing/_internal/common_utils.py:892:run_tests /local/pytorch1/test/test_autograd.py:11248:<module> $8: f32[2] = torch._ops.aten.detach.default($7) (8 of 8 in recompute) /local/pytorch1/torch/utils/checkpoint.py:998:pack_hook /local/pytorch1/test/test_autograd.py:5651:save_2_tensors_alt /local/pytorch1/test/test_autograd.py:5660:fn /local/pytorch1/torch/utils/checkpoint.py:1161:recompute_fn /local/pytorch1/torch/utils/checkpoint.py:1041:unpack_hook /local/pytorch1/torch/utils/checkpoint.py:1063:unpack_hook_with_error_cb /local/pytorch1/torch/autograd/__init__.py:204:backward /local/pytorch1/torch/_tensor.py:488:backward /local/pytorch1/test/test_autograd.py:5692:test_checkpoint_detects_non_determinism /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:550:_callTestMethod /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:592:run /local/pytorch1/torch/testing/_internal/common_utils.py:2248:_run_with_retry /local/pytorch1/torch/testing/_internal/common_utils.py:2319:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/case.py:651:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:122:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/suite.py:84:__call__ /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/runner.py:184:run /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:271:runTests /opt/miniconda3/envs/pytorch1/lib/python3.9/unittest/main.py:101:__init__ /local/pytorch1/torch/testing/_internal/common_utils.py:892:run_tests /local/pytorch1/test/test_autograd.py:11248:<module> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ | 3. Log of operators in the original forward and recomputation | +------------------------------------------------------------------------------+ (Scroll up to correlate stack traces with each operation listed below. This helps identify their source in the code.) IMPORTANT: Differences in "detach" calls between the original forward and the recomputation are expected. They are introduced by the checkpointing mechanism and can be ignored. Operations executed during the original forward: $1: f32[1] = torch._ops.aten.sin.default($0) $2: f32[1] = torch._ops.aten.exp.default($1) Operations executed during recomputation: $1: f32[1] = torch._ops.aten.detach.default($0) $2: f32[1] = torch._ops.aten.detach.default($1) $3: f32[1] = torch._ops.aten.detach.default($0) $4: f32[1] = torch._ops.aten.detach.default($3) $5: f32[1] = torch._ops.aten.sin.default($0) $6: f32[2] = torch._ops.aten.lift_fresh.default($6) $7: f32[2] = torch._ops.aten.detach.default($6) $8: f32[2] = torch._ops.aten.detach.default($7) +------------------------------------------------------------------------------+ ERROR: Detected non-determinism while running activation checkpointing You are seeing this error because you passed `debug=True` to checkpoint and tensors to be saved during the original forward and differ between those saved during recomputation. This can happen if different operators were ran in the original forward and in the recomputation. To identify where the mismatch may be coming from, you can do the following: 1) Compare the operators ran during original forward and recomputation to see where they differ. These operators are printed above in the order they were executed. 2) Review the stack trace for each operator to locate its invocation source. Each operator's stack trace is printed in their execution order. Note that the logs can be quite long. Here's how they are structured: (Tip: you can Ctrl-f for these headers) 1. Stack traces of the operators that ran in the original forward 2. Stack traces of the operators that ran during recomputation 3. Log of operators in the original forward and recomputation 4. Error message <--- You are here -------------------------------------------------------------------------------- ``` </details> [ghstack-poisoned]
soulitzer
added a commit
that referenced
this pull request
Jun 7, 2023
ghstack-source-id: b4595e2473c1993d853d7bfb4fa039f3ba3bc837 Pull Request resolved: #102241
soulitzer
changed the title
[WIP] Improve debuggability of activation checkpointing
Improve debuggability of activation checkpointing
Jun 16, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
This PR makes some improvements for debuggability of checkpointing:
CheckpointError
which subclassesRuntimeError
(onlyCheckpointError
triggers debug message, see below)determinism_check="none"
debug=True
Note:
click to see error message when debug='True' (python stack trace only)
click to see error message when debug='True' (with python and cpp stacktrace)