Turns out that generating the random lengths on the host and then transferring it to the device is much faster than using rng.discard().