Add THD-format per-rank batch fetch with padding mask for sequence packing (#6625)