Skip to content

Conversation

bdhirsh
Copy link
Contributor

@bdhirsh bdhirsh commented Oct 26, 2022

Added indents to TORCH_SHOW_DISPATCH_TRACE so that you more easily see the call tree from the dispatcher. Definitely slower, but it's all guarded under the DEBUG build. Example output:

I know we have the PyDispatcher now, but I still found this helpful for debugging

 [call] op=[aten::ones], key=[BackendSelect]
  [redispatch] op=[aten::ones], key=[CPU]
   [call] op=[aten::empty.memory_format], key=[BackendSelect]
    [redispatch] op=[aten::empty.memory_format], key=[CPU]
   [call] op=[aten::fill_.Scalar], key=[CPU]
 [call] op=[aten::clone], key=[AutogradCPU]
  [redispatch] op=[aten::clone], key=[CPU]
   [call] op=[aten::empty_strided], key=[BackendSelect]
    [redispatch] op=[aten::empty_strided], key=[CPU]
   [call] op=[aten::copy_], key=[CPU]
 [call] op=[aten::view], key=[PythonTLSSnapshot]
  [redispatchBoxed] op=[aten::view], key=[AutogradCPU]
   [redispatch] op=[aten::view], key=[ADInplaceOrView]
    [redispatch] op=[aten::view], key=[Functionalize]
     [call] op=[aten::view], key=[PythonTLSSnapshot]
      [redispatchBoxed] op=[aten::view], key=[Meta]
     [call] op=[aten::view], key=[PythonTLSSnapshot]
      [redispatchBoxed] op=[aten::view], key=[Python]
       [callBoxed] op=[aten::view], key=[CPU]
 [call] op=[aten::clone], key=[PythonTLSSnapshot]
  [redispatchBoxed] op=[aten::clone], key=[AutogradCPU]
   [redispatch] op=[aten::clone], key=[Functionalize]
    [callBoxed] op=[aten::clone], key=[PythonTLSSnapshot]
     [redispatchBoxed] op=[aten::clone], key=[Python]
      [callBoxed] op=[aten::clone], key=[CPU]
       [call] op=[aten::empty_strided], key=[BackendSelect]
        [redispatch] op=[aten::empty_strided], key=[CPU]
       [call] op=[aten::copy_], key=[CPU]

Stack from ghstack (oldest at bottom):

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 26, 2022

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/87751

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit b29ab2c:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 26, 2022
Added indents to `TORCH_SHOW_DISPATCH_TRACE` so that you more easily see the call tree from the dispatcher. Definitely slower, but it's all guarded under the `DEBUG` build. Example output:

I know we have the PyDispatcher now, but I still found this helpful for debugging

```
 [call] op=[aten::ones], key=[BackendSelect]
  [redispatch] op=[aten::ones], key=[CPU]
   [call] op=[aten::empty.memory_format], key=[BackendSelect]
    [redispatch] op=[aten::empty.memory_format], key=[CPU]
   [call] op=[aten::fill_.Scalar], key=[CPU]
 [call] op=[aten::clone], key=[AutogradCPU]
  [redispatch] op=[aten::clone], key=[CPU]
   [call] op=[aten::empty_strided], key=[BackendSelect]
    [redispatch] op=[aten::empty_strided], key=[CPU]
   [call] op=[aten::copy_], key=[CPU]
 [call] op=[aten::view], key=[PythonTLSSnapshot]
  [redispatchBoxed] op=[aten::view], key=[AutogradCPU]
   [redispatch] op=[aten::view], key=[ADInplaceOrView]
    [redispatch] op=[aten::view], key=[Functionalize]
     [call] op=[aten::view], key=[PythonTLSSnapshot]
      [redispatchBoxed] op=[aten::view], key=[Meta]
     [call] op=[aten::view], key=[PythonTLSSnapshot]
      [redispatchBoxed] op=[aten::view], key=[Python]
       [callBoxed] op=[aten::view], key=[CPU]
 [call] op=[aten::clone], key=[PythonTLSSnapshot]
  [redispatchBoxed] op=[aten::clone], key=[AutogradCPU]
   [redispatch] op=[aten::clone], key=[Functionalize]
    [callBoxed] op=[aten::clone], key=[PythonTLSSnapshot]
     [redispatchBoxed] op=[aten::clone], key=[Python]
      [callBoxed] op=[aten::clone], key=[CPU]
       [call] op=[aten::empty_strided], key=[BackendSelect]
        [redispatch] op=[aten::empty_strided], key=[CPU]
       [call] op=[aten::copy_], key=[CPU]
```




[ghstack-poisoned]
Added indents to `TORCH_SHOW_DISPATCH_TRACE` so that you more easily see the call tree from the dispatcher. Definitely slower, but it's all guarded under the `DEBUG` build. Example output:

I know we have the PyDispatcher now, but I still found this helpful for debugging

```
 [call] op=[aten::ones], key=[BackendSelect]
  [redispatch] op=[aten::ones], key=[CPU]
   [call] op=[aten::empty.memory_format], key=[BackendSelect]
    [redispatch] op=[aten::empty.memory_format], key=[CPU]
   [call] op=[aten::fill_.Scalar], key=[CPU]
 [call] op=[aten::clone], key=[AutogradCPU]
  [redispatch] op=[aten::clone], key=[CPU]
   [call] op=[aten::empty_strided], key=[BackendSelect]
    [redispatch] op=[aten::empty_strided], key=[CPU]
   [call] op=[aten::copy_], key=[CPU]
 [call] op=[aten::view], key=[PythonTLSSnapshot]
  [redispatchBoxed] op=[aten::view], key=[AutogradCPU]
   [redispatch] op=[aten::view], key=[ADInplaceOrView]
    [redispatch] op=[aten::view], key=[Functionalize]
     [call] op=[aten::view], key=[PythonTLSSnapshot]
      [redispatchBoxed] op=[aten::view], key=[Meta]
     [call] op=[aten::view], key=[PythonTLSSnapshot]
      [redispatchBoxed] op=[aten::view], key=[Python]
       [callBoxed] op=[aten::view], key=[CPU]
 [call] op=[aten::clone], key=[PythonTLSSnapshot]
  [redispatchBoxed] op=[aten::clone], key=[AutogradCPU]
   [redispatch] op=[aten::clone], key=[Functionalize]
    [callBoxed] op=[aten::clone], key=[PythonTLSSnapshot]
     [redispatchBoxed] op=[aten::clone], key=[Python]
      [callBoxed] op=[aten::clone], key=[CPU]
       [call] op=[aten::empty_strided], key=[BackendSelect]
        [redispatch] op=[aten::empty_strided], key=[CPU]
       [call] op=[aten::copy_], key=[CPU]
```




[ghstack-poisoned]
@albanD albanD removed their request for review October 26, 2022 17:19
Added indents to `TORCH_SHOW_DISPATCH_TRACE` so that you more easily see the call tree from the dispatcher. Definitely slower, but it's all guarded under the `DEBUG` build. Example output:

I know we have the PyDispatcher now, but I still found this helpful for debugging

```
 [call] op=[aten::ones], key=[BackendSelect]
  [redispatch] op=[aten::ones], key=[CPU]
   [call] op=[aten::empty.memory_format], key=[BackendSelect]
    [redispatch] op=[aten::empty.memory_format], key=[CPU]
   [call] op=[aten::fill_.Scalar], key=[CPU]
 [call] op=[aten::clone], key=[AutogradCPU]
  [redispatch] op=[aten::clone], key=[CPU]
   [call] op=[aten::empty_strided], key=[BackendSelect]
    [redispatch] op=[aten::empty_strided], key=[CPU]
   [call] op=[aten::copy_], key=[CPU]
 [call] op=[aten::view], key=[PythonTLSSnapshot]
  [redispatchBoxed] op=[aten::view], key=[AutogradCPU]
   [redispatch] op=[aten::view], key=[ADInplaceOrView]
    [redispatch] op=[aten::view], key=[Functionalize]
     [call] op=[aten::view], key=[PythonTLSSnapshot]
      [redispatchBoxed] op=[aten::view], key=[Meta]
     [call] op=[aten::view], key=[PythonTLSSnapshot]
      [redispatchBoxed] op=[aten::view], key=[Python]
       [callBoxed] op=[aten::view], key=[CPU]
 [call] op=[aten::clone], key=[PythonTLSSnapshot]
  [redispatchBoxed] op=[aten::clone], key=[AutogradCPU]
   [redispatch] op=[aten::clone], key=[Functionalize]
    [callBoxed] op=[aten::clone], key=[PythonTLSSnapshot]
     [redispatchBoxed] op=[aten::clone], key=[Python]
      [callBoxed] op=[aten::clone], key=[CPU]
       [call] op=[aten::empty_strided], key=[BackendSelect]
        [redispatch] op=[aten::empty_strided], key=[CPU]
       [call] op=[aten::copy_], key=[CPU]
```




[ghstack-poisoned]
@bdhirsh
Copy link
Contributor Author

bdhirsh commented Oct 27, 2022

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

kulinseth pushed a commit to kulinseth/pytorch that referenced this pull request Nov 5, 2022
Added indents to `TORCH_SHOW_DISPATCH_TRACE` so that you more easily see the call tree from the dispatcher. Definitely slower, but it's all guarded under the `DEBUG` build. Example output:

I know we have the PyDispatcher now, but I still found this helpful for debugging

```
 [call] op=[aten::ones], key=[BackendSelect]
  [redispatch] op=[aten::ones], key=[CPU]
   [call] op=[aten::empty.memory_format], key=[BackendSelect]
    [redispatch] op=[aten::empty.memory_format], key=[CPU]
   [call] op=[aten::fill_.Scalar], key=[CPU]
 [call] op=[aten::clone], key=[AutogradCPU]
  [redispatch] op=[aten::clone], key=[CPU]
   [call] op=[aten::empty_strided], key=[BackendSelect]
    [redispatch] op=[aten::empty_strided], key=[CPU]
   [call] op=[aten::copy_], key=[CPU]
 [call] op=[aten::view], key=[PythonTLSSnapshot]
  [redispatchBoxed] op=[aten::view], key=[AutogradCPU]
   [redispatch] op=[aten::view], key=[ADInplaceOrView]
    [redispatch] op=[aten::view], key=[Functionalize]
     [call] op=[aten::view], key=[PythonTLSSnapshot]
      [redispatchBoxed] op=[aten::view], key=[Meta]
     [call] op=[aten::view], key=[PythonTLSSnapshot]
      [redispatchBoxed] op=[aten::view], key=[Python]
       [callBoxed] op=[aten::view], key=[CPU]
 [call] op=[aten::clone], key=[PythonTLSSnapshot]
  [redispatchBoxed] op=[aten::clone], key=[AutogradCPU]
   [redispatch] op=[aten::clone], key=[Functionalize]
    [callBoxed] op=[aten::clone], key=[PythonTLSSnapshot]
     [redispatchBoxed] op=[aten::clone], key=[Python]
      [callBoxed] op=[aten::clone], key=[CPU]
       [call] op=[aten::empty_strided], key=[BackendSelect]
        [redispatch] op=[aten::empty_strided], key=[CPU]
       [call] op=[aten::copy_], key=[CPU]
```

Pull Request resolved: pytorch#87751
Approved by: https://github.com/ezyang, https://github.com/zou3519
kulinseth pushed a commit to kulinseth/pytorch that referenced this pull request Dec 10, 2022
Added indents to `TORCH_SHOW_DISPATCH_TRACE` so that you more easily see the call tree from the dispatcher. Definitely slower, but it's all guarded under the `DEBUG` build. Example output:

I know we have the PyDispatcher now, but I still found this helpful for debugging

```
 [call] op=[aten::ones], key=[BackendSelect]
  [redispatch] op=[aten::ones], key=[CPU]
   [call] op=[aten::empty.memory_format], key=[BackendSelect]
    [redispatch] op=[aten::empty.memory_format], key=[CPU]
   [call] op=[aten::fill_.Scalar], key=[CPU]
 [call] op=[aten::clone], key=[AutogradCPU]
  [redispatch] op=[aten::clone], key=[CPU]
   [call] op=[aten::empty_strided], key=[BackendSelect]
    [redispatch] op=[aten::empty_strided], key=[CPU]
   [call] op=[aten::copy_], key=[CPU]
 [call] op=[aten::view], key=[PythonTLSSnapshot]
  [redispatchBoxed] op=[aten::view], key=[AutogradCPU]
   [redispatch] op=[aten::view], key=[ADInplaceOrView]
    [redispatch] op=[aten::view], key=[Functionalize]
     [call] op=[aten::view], key=[PythonTLSSnapshot]
      [redispatchBoxed] op=[aten::view], key=[Meta]
     [call] op=[aten::view], key=[PythonTLSSnapshot]
      [redispatchBoxed] op=[aten::view], key=[Python]
       [callBoxed] op=[aten::view], key=[CPU]
 [call] op=[aten::clone], key=[PythonTLSSnapshot]
  [redispatchBoxed] op=[aten::clone], key=[AutogradCPU]
   [redispatch] op=[aten::clone], key=[Functionalize]
    [callBoxed] op=[aten::clone], key=[PythonTLSSnapshot]
     [redispatchBoxed] op=[aten::clone], key=[Python]
      [callBoxed] op=[aten::clone], key=[CPU]
       [call] op=[aten::empty_strided], key=[BackendSelect]
        [redispatch] op=[aten::empty_strided], key=[CPU]
       [call] op=[aten::copy_], key=[CPU]
```

Pull Request resolved: pytorch#87751
Approved by: https://github.com/ezyang, https://github.com/zou3519
@facebook-github-bot facebook-github-bot deleted the gh/bdhirsh/335/head branch June 8, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged release notes: composability release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants