uge, so this function compresses it, by computing offsets
    (comp_ids) into the list of unique labels (obs_group_ids).
    r