Average qgZ gradients over every rank, not just the nodes (#8729)
With ZeRO++ qgZ across nodes, `all_to_all_quant_reduce` returns 2D
weight gradients scaled by devices per node, while 1D gradients (biases,
norms) take the `reduce_scatter_coalesced` fallback and come back as the
true average.
`quantized_reduction` sums the L local ranks, the final line sums the N
nodes, then divides only by N: `sum_n sum_l g / N = L * mean(g)`. The
fix divides by `global_world_size = L * N`, matching the fallback's
pre-divide.
Test: a new 4-rank case runs the two-stage path as 2 nodes x 2 devices
on gloo with the pure-torch `NPUQuantizer`. Rank r holds `-(r+1)`, so
the average is -2.5. Before the fix the weight returns -5.0 and the bias
-2.5; after, both return -2.5.
---------
Signed-off-by: Vineeth Sai <vineethsai4444@gmail.com>