Skip to content

fix(megatron): reduce reranker evaluation metrics across DP ranks - #10088

Open
Excelius-Wang wants to merge 1 commit into
modelscope:mainfrom
Excelius-Wang:fix/megatron-global-eval-metrics
Open

fix(megatron): reduce reranker evaluation metrics across DP ranks#10088
Excelius-Wang wants to merge 1 commit into
modelscope:mainfrom
Excelius-Wang:fix/megatron-global-eval-metrics

Conversation

@Excelius-Wang

Copy link
Copy Markdown
Contributor

Megatron reranker validation computes MRR/NDCG from each data-parallel rank's local shard, so checkpoint selection can use a shard-dependent metric. Average the existing per-query scores across the DP group with the existing MeanMetric sum/count reduction. Weight only valid queries, including when some ranks have no valid queries.

Keep local/HF metric behavior and query-ranking calculations unchanged. Communicate two scalars per metric at evaluation completion; do not gather predictions or alter embedding/InfoNCE evaluation.

Validation: CPU unit tests and four-process Gloo tests covering unequal query counts, independent subgroups, empty/invalid shards, repeated compute/reset, DP=1 and the local/HF path. 300 comparisons match the upstream local implementation exactly, including tied logits and singleton queries. Pre-commit checks pass. Full Megatron/NCCL training was not run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant