Numba vs jit vs compile

Hi,
If I need to write some code that runs on GPU and has for loops, should I be using numba or jit or torch compile in 2023?

When I search for info on this everything I find is outdated (pre pytorch 2.0).

Could you please share the code?

I want to optimize code like this: Forced Alignment with Wav2Vec2 — Torchaudio 2.1.0.dev20230622 documentation

If using while makes things a lot more difficult just assume I will find a way to use for instead

1 Like