What's the right way to test with CUDA?

My package is written in PyTorch and most of my tutorials use some CUDA acceleration. In the fastai repo, I’ve seen #| cuda used in some cells. I’ve included this in my repo (and added tst_flags = slow|cuda to my settings.ini), but CI on GitHub is incredibly slow.

On my local machine, I can run all tests in <5 min, but on GitHub, a CI run takes around 5.5 hrs.

I haven’t found any instructions for this in the nbdev docs. I’ve found these instructions on CUDA+nbdev from 2020, but they look outdated.

1 Like

Searching for tst_flags in the documentation, I found this page that says that flags in tst_flags are treated as skip_flags at test time.

So this means that any cell I flag with #| cuda should be skipped on GitHub’s CI? If yes, any ideas why the runtime is so high?

1 Like