Skip to content

Conversation

@basilwong
Copy link
Contributor

@basilwong basilwong commented Nov 5, 2024

Summary:
Removes print statements and implements logging via the logging library.

Hopefully this will allow more control on the level of logging when running models.

Test Plan:

AOT_PARTITIONER_DEBUG=1 buck2 run @mode/opt //aps_models/ads/icvr:icvr_launcher -- mode=local_fb_fm_v4 launcher.num_workers=2

Resulting output paste: P1674535630

  • Full logs paste: P1674535621
pastry P1674535621 | grep "functorch/partitioners.py" | pastry

Logging results: P1674549514

Differential Revision: D61678215

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 5, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 91b30fe with merge base 3e82b1f (image):
💚 Looks good so far! There are no failures yet. 💚

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

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61678215

)
sorted_sizes = sorted([(_size_of(i), str(i)) for i in saved_values])
logger.debug(
f"Theoretical Per Activation Storage Sizes: {sorted_sizes}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruff will complain about this in a second

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f"Theoretical Per Activation Storage Sizes: {sorted_sizes}"
"Theoretical Per Activation Storage Sizes: %s", {sorted_sizes}

)
print(
logger.debug(
"Count of Ops Rematerialized: ",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Count of Ops Rematerialized: ",
"Count of Ops Rematerialized: %s",

@Skylion007
Copy link
Collaborator

Check the ruff errors in lintrunner, it will complain for you for a lot of this logging.

if node.op == "call_function":
cnt[node.target.__name__] += 1
print(sorted(cnt.items(), key=lambda x: x[1], reverse=True))
logger.info(sorted(cnt.items(), key=lambda x: x[1], reverse=True))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.info(sorted(cnt.items(), key=lambda x: x[1], reverse=True))
logger.info("%s", sorted(cnt.items(), key=lambda x: x[1], reverse=True)))

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61678215

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61678215

@basilwong
Copy link
Contributor Author

Updated the diff based on comments. Testing also confirms the output.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61678215

@basilwong
Copy link
Contributor Author

@pytorchbot label "topic: not user facing"

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Nov 7, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61678215

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61678215

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 7, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: basilwong / name: Basil Wong (91b30fe)

@basilwong
Copy link
Contributor Author

/easycla

@huydhn
Copy link
Contributor

huydhn commented Nov 12, 2024

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Successfully rebased export-D61678215 onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout export-D61678215 && git pull --rebase)

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61678215

basilwong added a commit to basilwong/pytorch that referenced this pull request Nov 12, 2024
Summary:

Removes print statements and implements logging via the logging library.

Hopefully this will allow more control on the level of logging when running models.

Test Plan:
```
AOT_PARTITIONER_DEBUG=1 buck2 run mode/opt //aps_models/ads/icvr:icvr_launcher -- mode=local_fb_fm_v4 launcher.num_workers=2
```

Resulting output paste: P1674535630
* Full logs paste: P1674535621

```
pastry P1674535621 | grep "functorch/partitioners.py" | pastry
```

Logging results: P1674549514

Reviewed By: paryxyt

Differential Revision: D61678215
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61678215

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61678215

Summary:

Removes print statements and implements logging via the logging library.

Hopefully this will allow more control on the level of logging when running models.

Test Plan:
```
AOT_PARTITIONER_DEBUG=1 buck2 run mode/opt //aps_models/ads/icvr:icvr_launcher -- mode=local_fb_fm_v4 launcher.num_workers=2
```

Resulting output paste: P1674535630
* Full logs paste: P1674535621

```
pastry P1674535621 | grep "functorch/partitioners.py" | pastry
```

Logging results: P1674549514

Reviewed By: paryxyt

Differential Revision: D61678215
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61678215

@facebook-github-bot
Copy link
Contributor

@pytorchbot merge

(Initiating merge automatically since Phabricator Diff has merged)

@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

pobin6 pushed a commit to pobin6/pytorch that referenced this pull request Dec 5, 2024
Summary:
Removes print statements and implements logging via the logging library.

Hopefully this will allow more control on the level of logging when running models.

Test Plan:
```
AOT_PARTITIONER_DEBUG=1 buck2 run @mode/opt //aps_models/ads/icvr:icvr_launcher -- mode=local_fb_fm_v4 launcher.num_workers=2
```

Resulting output paste: P1674535630
* Full logs paste: P1674535621

```
pastry P1674535621 | grep "functorch/partitioners.py" | pastry
```

Logging results: P1674549514

Differential Revision: D61678215

Pull Request resolved: pytorch#139782
Approved by: https://github.com/paryxyt, https://github.com/jansel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request fb-exported Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants