this is an ambiguous case. In this case, both results are correct.
The CPU and GPU will return correct results but might not be consistent with each other when breaking ties).
Similar to max, you will see similar behavior when breaking ties in min, sort, topk, etc.
The reason it is hard to make CPU and GPU consistent is that if we need consistency then we will have to take a huge hit in GPU performance.