ASME B107.17 is used for gages and mandrels for wrench openings. The tolerance across the flats are .0002.
ASME B18.3 is used for socket cap, shoulder and set screws. the tolerance across the flats are .0001 or .0002.