You could use a Subset or SubsetRandomSampler using a smaller set of sample indices.
Since you would like to have all classes you would need to create those indices first using the original target attribute of the dataset.