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_cuda in test_trainer.py::TestTrainer #572

Merged
merged 5 commits into from
Feb 21, 2024

Conversation

gcroci2
Copy link
Collaborator

@gcroci2 gcroci2 commented Feb 21, 2024

In tests/test_trainer.py::TestTrainer::test_cuda, we were not setting cuda correctly - not using the use_cuda parameter in the test.
We were also asserting that data tensors are cuda tensors, but this is never true since the data are transferred to the GPU device only during the training when iterating over the Dataloader instances (see line 705 of trainer.py).

dependabot bot and others added 5 commits February 8, 2024 09:26
Bumps [readthedocs-sphinx-search](https://github.com/readthedocs/readthedocs-sphinx-search) from 0.1.1 to 0.3.2.
- [Changelog](https://github.com/readthedocs/readthedocs-sphinx-search/blob/main/CHANGELOG.rst)
- [Commits](readthedocs/readthedocs-sphinx-search@0.1.1...0.3.2)

---
updated-dependencies:
- dependency-name: readthedocs-sphinx-search
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
…-sphinx-search-0.3.2

Bump readthedocs-sphinx-search from 0.1.1 to 0.3.2 in /docs
@gcroci2 gcroci2 changed the title fix: test_cuda in test_trainer.py::TestTrainer fix: test_cuda in test_trainer.py::TestTrainer Feb 21, 2024
@gcroci2 gcroci2 linked an issue Feb 21, 2024 that may be closed by this pull request
@coveralls
Copy link

Coverage Status

coverage: 83.613%. remained the same
when pulling 8229270 on 518_fix_cuda_test_gcroci2
into c45f828 on main.

@gcroci2 gcroci2 changed the base branch from main to dev February 21, 2024 10:51
Copy link
Collaborator

@DaniBodor DaniBodor left a comment

Choose a reason for hiding this comment

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

nice catch

@gcroci2 gcroci2 merged commit a32a074 into dev Feb 21, 2024
4 checks passed
@gcroci2 gcroci2 deleted the 518_fix_cuda_test_gcroci2 branch February 21, 2024 10:53
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.

Bug: Pytest failure "{parameter} is not cuda" in TestTrainer.test_cuda
3 participants