Does equality before the law rule out group-specific provision?

Some UK law deliberately treats people differently by group: sentencing uplifts for hostility towards a protected characteristic, and the positive action provisions of the Equality Act 2010.

Is all group-specific provision incompatible with equality before the law, none of it, or some? If some, what makes the acceptable cases different?

Any position may be argued here, including that the question is framed wrongly.