fragment: Support sample grouping within fragments.