Skip to content

Conversation

Pedrexus
Copy link

@Pedrexus Pedrexus commented May 23, 2023

What does this PR do?

This PR fixes issue #15175 by adding a new feature to the ChannelsLast callback. This callback changes the module memory format on setup. This is useful when the user wants to use a different memory format and can lead to a considerable speedup in some cases.

Fixes #15175

This PR does not introduce any breaking changes.

  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

@github-actions github-actions bot added the pl Generic label for PyTorch Lightning package label May 23, 2023
@Pedrexus
Copy link
Author

Pedrexus commented May 23, 2023

Hello, all. I'm having trouble running make docs. I'd be glad if someone could help.

Error:
ModuleNotFoundError: No module named 'pt_lightning_sphinx_theme'

@awaelchli
Copy link
Contributor

@Pedrexus This should get you started:

pip install -r requirements/pytorch/docs.txt
cd docs/source-pytorch
make html 
open ../build/html/index.html

Also, I left a comment here: #15175 (comment)

@awaelchli awaelchli added feature Is an improvement or enhancement callback community This PR is from the community labels May 29, 2023
@stale stale bot added the won't fix This will not be worked on label Jun 18, 2023
@Lightning-AI Lightning-AI deleted a comment from stale bot Jun 18, 2023
@stale stale bot removed the won't fix This will not be worked on label Jun 18, 2023
@Borda Borda self-requested a review as a code owner August 8, 2023 14:43
@mergify mergify bot removed the has conflicts label Aug 8, 2023
@mergify mergify bot added the has conflicts label Sep 5, 2023
@awaelchli awaelchli added this to the 2.1 milestone Sep 20, 2023
Borda
Borda previously approved these changes Mar 12, 2025
@Borda Borda changed the title Add MemoryFormat callback (channels last) Add MemoryFormat callback (channels last) May 28, 2025
from lightning.pytorch.utilities.rank_zero import rank_zero_warn


class MemoryFormat(Callback):
Copy link
Contributor

Choose a reason for hiding this comment

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

@Pedrexus, just thinking if the name is right, since it rather does ReorderImageDimensions

@Borda Borda dismissed their stale review August 8, 2025 22:04

lets re-think the name

@Borda Borda self-requested a review August 8, 2025 22:04
@Borda Borda added the waiting on author Waiting on user action, correction, or update label Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

callback community This PR is from the community feature Is an improvement or enhancement pl Generic label for PyTorch Lightning package waiting on author Waiting on user action, correction, or update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support channels_last with training

3 participants