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: Test failing when using DeepXDE #155

Merged
merged 1 commit into from
Aug 20, 2024
Merged

Conversation

JakobEliasWagner
Copy link
Collaborator

@JakobEliasWagner JakobEliasWagner commented Aug 19, 2024

Bugfix: Test failing when using DeepXDE

Description

As discussed here does DeepXDE internally set the device context when initializing the pytorch backend (https://deepxde.readthedocs.io/en/latest/user/installation.html#pytorch-backend).
This results in errors when running the tests with more than one device. The device context for iterators and instances such as the torch dataloader conflicts.

Which issue does this PR tackle?

  • Not all unit tests running on machines with multiple devices, due to device context initialization of DeepXDE.

How does it solve the problem?

  • Isolates the deepxde import from the rest of the test-code.

How are the changes tested?

  • All unit tests run without new errors.

Checklist for Contributors

  • Scope: This PR tackles exactly one problem.
  • Conventions: The branch follows the feature/title-slug convention.
  • Conventions: The PR title follows the Bugfix: Title convention.
  • Coding style: The code passes all pre-commit hooks.
  • Documentation: All changes are well-documented.
  • Tests: New features are tested and all tests pass successfully.
  • Changelog: Updated CHANGELOG.md for new features or breaking changes.
  • Review: A suitable reviewer has been assigned.

Checklist for Reviewers:

  • The PR solves the issue it claims to solve and only this one.
  • Changes are tested sufficiently and all tests pass.
  • Documentation is complete and well-written.
  • Changelog has been updated, if necessary.

@samuelburbulla samuelburbulla merged commit 8e16597 into main Aug 20, 2024
14 checks passed
@samuelburbulla samuelburbulla deleted the fix/deepxde-device-test branch August 20, 2024 09:42
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.

2 participants