Skip to content
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

Fix Pickling Issue with SWA and AdvancedProfiler #6552

Closed
wants to merge 1 commit into from

Conversation

justusschock
Copy link
Member

What does this PR do?

Fixes #6522

Before submitting

  • Was this discussed/approved 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 update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

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

  • 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

Did you have fun?

Make sure you had fun coding 🙃

I am not sure, why the AdvancedProfiler cannot be pickled. There seems to be an issue with a local function. But I was not able to find any. So this doesn't fix that but bypasses it!

@pep8speaks
Copy link

Hello @justusschock! Thanks for opening this PR.

Line 140:1: W293 blank line contains whitespace

Do see the Hitchhiker's guide to code style

@kaushikb11
Copy link
Contributor

@justusschock Could we add a test for this, of Pickling not having an Issue?

@justusschock
Copy link
Member Author

@kaushikb11 I'll try to come up with one, but not sure, how good it will be since this is something non-trivial to test

@tchaton
Copy link
Contributor

tchaton commented Mar 22, 2021

Hey @justusschock,

I would say the bug should be resolved on the profiler side, not the callback side.

Best,
T.C

@carmocca carmocca mentioned this pull request Mar 22, 2021
11 tasks
@carmocca
Copy link
Contributor

carmocca commented Mar 22, 2021

The issue will be partly resolved by #6621

However, we still have the problem of not being able to pickle cProfiler.Profile

Can reproduce it with this test in test_profilers.py

def test_advanced_profiler_cprofile_deepcopy(tmpdir):
    """Checks for pickle issue reported in #6522"""
    model = BoringModel()
    trainer = Trainer(
        default_root_dir=tmpdir,
        fast_dev_run=True,
        profiler="advanced",
        stochastic_weight_avg=True,
    )
    trainer.fit(model)

edit: Closing in favor of fixes included in #6621

@carmocca carmocca closed this Mar 22, 2021
@carmocca carmocca deleted the justusschock-patch-advanced_loader_swa branch March 22, 2021 23:35
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.

"Advanced" profiler not working
5 participants