The singular values on the diagonal of S (let X = USV) should already be sorted.
From my ML notes:
[...]
All diagonal elements of S are non-negative and in non-increasing order:
s_1 >= s_2 >= ... s_p >= 0
where p = min(n,m)
Moderator: Computer Vision 2
[...]
All diagonal elements of S are non-negative and in non-increasing order:
s_1 >= s_2 >= ... s_p >= 0
where p = min(n,m)