question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add pytest marker for GPU tests

See original GitHub issue

It came up in the monthly community meeting that we should add a gpu pytest marker to certain test modules / individual tests which run on GPUs. This will allow us to select only GPU-related tests when running the test suite on machines with GPUs in CI (xref https://github.com/dask/distributed/pull/5011)

cc @charlesbluca @quasiben @aktech

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
jrbourbeaucommented, Jul 1, 2021

Great! If I were doing this I would probably do something like:

  1. Add a description for a new gpu marker here

https://github.com/dask/distributed/blob/8b79bd95d0c5a681f6d0543eb20d645dc1182ec1/setup.cfg#L49-L52

this will inform pytest about the new marker

  1. Mark all of the test modules here (except for test_nanny.py) with a module-level pytest.mark.gpu marker
  2. Go into test_nanny.py and decorate individual tests that run on GPUs with @pytest.mark.gpu
1reaction
quasibencommented, Jul 6, 2021

We added test_nanny because of a UCX issue. Here is the PR for the work https://github.com/dask/distributed/pull/3747 – I think if it’s not too much overhead testing the entire file would be good

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing — transformers 3.4.0 documentation - Hugging Face
pytest -sugar is a plugin that improves the look-n-feel, adds a progressbar, and show tests that fail and the assert instantly.
Read more >
How to mark test functions with attributes - Pytest
By using the pytest.mark helper you can easily set metadata on your test functions. You can find the full list of builtin markers...
Read more >
Enable multiprocessing when testing with GPU and support ...
To do that we'll use pytest markers: @pytest.mark..... By default, if no marker is found, the test will run on CPU: with device(" ......
Read more >
pytest-manual-marker - PyPI
Pytest marker for marking manual tests. Adds options for collecting manual, automated (default) or both. Adds a different test outcome for manaual tests....
Read more >
run dependant tests with pytest - Stack Overflow
If you filter by markers, this is not possible, AFAIK. Can you elaborate on why you can't add the marker to test_a ?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found