Try to run with CUDA_LAUNCH_BLOCKING=1 python 
The error message probably comes from a different line than the one you linked, but it is showing up there because of the asynchronous nature of CUDA. In particular, it looks like you called multinomial with a negative probability somewhere.