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

Making test code device aware. #515

Closed
mthrok opened this issue Apr 6, 2020 · 4 comments
Closed

Making test code device aware. #515

mthrok opened this issue Apr 6, 2020 · 4 comments

Comments

@mthrok
Copy link
Collaborator

mthrok commented Apr 6, 2020

Currently, test code does not have a standard way to handle device, which led to CUDA tests added disorganized ways, such as 1, 2 and 3.
Also it is worth noting that Travis CI is not running any of CUDA test. See here, search for test_lfilter_cuda.

We should have a standard way to add CUDA test.

FYI: PyTorch has a mechanism to instantiate test class for different devices at runtime.

@mthrok
Copy link
Collaborator Author

mthrok commented Apr 6, 2020

I also noticed that in 1, the test result looks like it passes when it was actually skipped.

Fix -> #516

@vincentqb
Copy link
Contributor

@mthrok
Copy link
Collaborator Author

mthrok commented Apr 7, 2020

The choice of CI is adjacent and we should discuss down the road. (though I have no objection to the migration to CircleCI)

The followings are what I think needs to be sorted out for the next steps.

(here I consider only CPU and CUDA for device option.)

  1. Add CUDA test
    1.1 Define a standard way to add device name to tests (or add CUDA test).

    • The bottom line is that device name (if not on CPU) should be visible in test result. so that we can see which tests PASSED/FAILED/ERROR/SKIPPED on which device.
    • CUDA test will be automatically skipped if CUDA device is not found, but also we should have option to force CUDA test and fail if CUDA is not available so that we can catch misconfiguration on CI.

    1.2 Find an efficient way to actually add device name to tests.

    • We can do this manually, but it can get tedious.
    • PyTorch parameterize device and instantiate test for different devices (CPU, CUDA, XLA ROCm).
  2. Identify which test we should run on CUDA.

    • torchaudio.functional
    • torchaudio.transforms
    • JIT
  3. Run test on CI

@mthrok
Copy link
Collaborator Author

mthrok commented Apr 7, 2020

#520 is my initial attempt to make CPU/GPU distinguish clear and parameterize device for a set of tests.

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

No branches or pull requests

2 participants