There are many algorithms to do random sampling of integer partitions.
See this answer for a quick start: https://stackoverflow.com/a/19829615/2329304 .
See also Improvements to exact Boltzmann sampling using probabilistic divide-and-conquer and the recursive method, DeSalvo 2017