Skip to content

fix(training): correct parameter norm reporting with GTP - #6133

Merged
yaoyu-33 merged 2 commits into
mainfrom
fix/gtp-param-norm-reporting
Sep 17, 2026
Merged

yaoyu-33 merged 2 commits into
mainfrom
fix/gtp-param-norm-reporting

Conversation

@yashaswikarnati

@yashaswikarnati yashaswikarnati commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do ?

Correct parameter-norm reporting when generalized tensor parallelism (GTP) is enabled.

Changelog

  • Count replicated dense and expert parameters once across their respective GTP axes.
  • Keep every GTP weight shard while bypassing the tensor-parallel duplicate filter.
  • Reduce the complete expert contribution across expt_gtp_remat, including replicated expert biases.
  • Add focused dense-GTP and expert-GTP parameter-norm regressions, including replica filtering on a nonzero expert-GTP rank.

GitHub Actions CI

Local validation:

  • TestCalcParamsL2Norm: 28 passed on each of two local processes.
  • Expert-GTP rank-0/rank-1 replica-filter regression: 2 passed on each of two local processes.
  • uv run pre-commit run --all-files: passed.

Before your PR is "Ready for review"

Pre checks:

  • Read and followed the contributor guidelines.
  • Added the necessary tests.
  • Documentation is not required because this does not change user-facing configuration or APIs.
  • This change does not affect optional components.

Additional Information

The implementation follows the pinned Megatron-LM GTP duplicate-filtering semantics while reducing the full expert norm across EGTP so replicated expert parameters are reported consistently on every rank.

Signed-off-by: ykarnati <ykarnati@nvidia.com>
@yashaswikarnati yashaswikarnati added bug Something isn't working area:training Training loop, callbacks, and runtime integration labels Sep 17, 2026
@copy-pr-bot

copy-pr-bot Bot commented Sep 17, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

Signed-off-by: ykarnati <ykarnati@nvidia.com>
@yashaswikarnati
yashaswikarnati marked this pull request as ready for review September 17, 2026 04:28
@claude

claude Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Light review: GTP-aware param L2 norm

The change to calc_params_l2_norm looks correct and is well covered by the two new unit tests. The dense path relies on pg_collection.mp already including the GTP axis; the expert path adds an explicit all_reduce over expt_gtp_remat because tp_ep_pp excludes expert GTP. The GTP-vs-replica filtering (skip TP dedup for GTP params; drop non-GTP replicas on GTP rank != 0) is symmetric and reads cleanly.

One thing to confirm: the pre-existing tests now hit the new get_pg_rank calls unpatched. The autouse _PG fixture sets gtp_remat to object() and expt_gtp_remat to None, but test_single_model_fp32, test_list_of_models, and the bf16 tests do NOT monkeypatch get_pg_rank. They only pass if real get_pg_rank(object()) and get_pg_rank(None) both return 0. Please confirm these CUDA-gated tests still pass end-to-end; if get_pg_rank calls .rank() on the fake object() they would raise or silently zero the norm. Patching get_pg_rank in those tests too (as the new tests do) would make this robust.

Suggested test cases:

  • test_gtp_param_norm_filters_replicas_and_keeps_shards
  • test_expert_gtp_param_norm_reduces_over_expert_gtp rank-zero-keeps-replica
  • test_expert_gtp_param_norm_reduces_over_expert_gtp nonzero-rank-drops-replica
  • test_single_model_fp32 (regression path, now exercises unpatched get_pg_rank)
  • test_list_of_models (regression path)
  • test_bf16_mode_without_main_param (regression path)
  • test_bf16_mode_with_main_param (regression path)

No perf tests impacted.

@yaoyu-33 yaoyu-33 added needs-more-tests Requires additional L0 and L1 test coverage before merge needs-review PR is ready for code review and waiting on a reviewer labels Sep 17, 2026
@yaoyu-33
yaoyu-33 merged commit 34d8d4b into main Sep 17, 2026
79 checks passed
@yaoyu-33
yaoyu-33 deleted the fix/gtp-param-norm-reporting branch September 17, 2026 18:22

This branch was successfully deployed

1 active deployment
test — 9adc9c6c Deployed Sep 17, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #21925
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:training Training loop, callbacks, and runtime integration bug Something isn't working needs-more-tests Requires additional L0 and L1 test coverage before merge needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants