Skip to content

Fix the Top-K KD loss running out of memory at long sequences with large vocabularies - #3080

Merged
kevalmorabia97 merged 3 commits into
mainfrom
kmorabia/topk-kd-loss-memory
Oct 28, 2026
Merged

kevalmorabia97 merged 3 commits into
mainfrom
kmorabia/topk-kd-loss-memory

Conversation

@kevalmorabia97

@kevalmorabia97 kevalmorabia97 commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Type of change: Bug fix

Since #2459, TopLogitsKLLoss (--logit_kl_top_k / logit_kl_topk) normalizes the student and teacher over the full vocabulary. It computes those normalizers on float32 copies of the logits, so about five float32 tensors of shape [sequence, vocab] are alive at the backward peak. With large vocabularies this runs out of memory: for Qwen3.6-35B-A3B (248K vocab), each copy is 30 GiB at a 32K sequence and 61 GiB at 64K, so QAD at the tutorial's settings no longer fit on a 276 GiB GB300.

The normalizers now run over row chunks of the logits (1 GiB of float32 per chunk), relative to each row's max:

  • The teacher's normalizer and local Top-K come from one chunked pass with no autograd.
  • For the student, a custom autograd function returns the normalizer and the Top-K entries. It saves only the logits and writes their gradient chunk by chunk, so backward allocates one gradient in the logits' dtype.

The loss is unchanged. The tensor-parallel collectives are the same (max and sum all-reduces in forward), plus an all-reduce of the [sequence, 1] normalizer gradient in backward, which replaces the autograd all-reduce's.

Usage

No API change.

Testing

  • Forward and backward on [4096, 1, 248320] bf16 logits with K = 4096 on an RTX 6000 Ada:

    Before After
    Extra peak memory over the inputs 18.95 GiB 4.08 GiB
    Time 198 ms 201 ms

    Loss within 8e-7 relative of before; 99.99% of gradient elements bitwise identical, the rest differ by one bf16 ulp.

  • New test_topk_logits_kl_loss_memory: forward and backward stay under 1.5x the size of the logits (before this fix, about 10x).

  • test_topk_logits_kl_loss_numerics_ghost_token_reference (TP=2, against a full-vocab reference, with Top-P, reverse KL and temperature) now runs with 2-row chunks, so it covers the chunk loop and the tensor-parallel backward.

  • New test_topk_logits_kl_loss_offset_invariant: adding 2**20 to the logits changes neither the loss nor the gradient. Working relative to the row max makes this exact; on main, the rounded log-normalizer moves the loss by 3% and the gradient by 0.035 at that offset.

  • tests/gpu_megatron/torch/distill/plugins/test_distill_megatron.py: 27 passed on 2 GPUs in nemo:26.08.

  • Qwen3.6-35B-A3B NVFP4 QAD at a 64K sequence (32 nodes × 4 GB300, TP1 EP8, GBS 256, top-4096 KD, full recomputation, with Add a fake-quantized weight cache for QAT and QAD #3034's weight cache): runs at 20.3 s/iteration with a peak of 197.7 GiB allocated, where it ran out of memory before.

Before your PR is "Ready for review"

  • Is this change backward compatible?: ✅
  • If you copied code from any other sources or added a new PIP dependency, did you follow guidance in CONTRIBUTING.md: N/A
  • Did you write any new necessary tests?: ✅
  • Did you update Changelog?: ✅
  • Did you get Claude approval on this PR?: ❌ (pending)

Additional Information

Fixes the memory regression from #2459. LogitsKLLoss (full-vocab KL, no logit_kl_topk) is unchanged.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Reduced peak GPU memory use during Megatron Top-K/Top-P distillation, especially for long sequences and large vocabularies. Full-vocabulary normalization now processes logits in chunks and avoids retaining multiple full-precision copies. Loss and gradient results remain accurate, including when logits share a large common offset. Empty batches and sequences also produce empty losses and gradients as expected.

…s of the logits

TopLogitsKLLoss kept about five float32 copies of the student logits alive at
the backward peak, which runs out of memory at long sequences with large
vocabularies. The normalizers now run over row chunks, and a custom autograd
function saves only the logits and writes their gradient chunk by chunk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
@kevalmorabia97
kevalmorabia97 requested review from a team as code owners October 28, 2026 07:41
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between c6d9e53 and 685afb4.

Files selected for processing: 3
  • CHANGELOG.rst
  • modelopt/torch/distill/plugins/megatron.py
  • tests/gpu_megatron/torch/distill/plugins/test_distill_megatron.py
Files skipped from review as they are similar to previous changes: 1
  • CHANGELOG.rst

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

Walkthrough

Megatron Top-K/Top-P distillation now computes full-vocabulary normalizers in chunks. A custom autograd operation computes student gradients in chunks during backward. Tests cover reference gradients, peak memory, shared-offset invariance, and empty inputs.

Changes: Megatron distillation memory

Layer / File(s) Summary
Chunked normalization and autograd
modelopt/torch/distill/plugins/megatron.py
New operations compute full-vocabulary log-sum-exp and local Top-K values in fp32 chunks. The custom autograd operation computes student normalization and selected logits, then computes gradients in chunks during backward, including tensor-parallel gradient reduction.
Loss integration and validation
modelopt/torch/distill/plugins/megatron.py, tests/gpu_megatron/torch/distill/plugins/test_distill_megatron.py, CHANGELOG.rst
TopLogitsKLLoss uses the chunked operations. Tests cover reference gradients, peak memory, shared-offset invariance, and empty inputs. The changelog records the memory change and accuracy with a large common logit offset.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant TopLogitsKLLoss
  participant ScaledLogSumExp
  participant ChunkedAutograd
  participant TensorParallelGroup
  TopLogitsKLLoss->>ScaledLogSumExp: Compute teacher normalizer
  TopLogitsKLLoss->>ChunkedAutograd: Compute student normalizer and selected logits
  ChunkedAutograd->>TensorParallelGroup: Reduce gradients when tensor parallelism is active
  ChunkedAutograd->>ChunkedAutograd: Compute student gradients in chunks during backward
Loading

Possibly related PRs

Merge Risk: Minimal · up to 685af

Chunked normalization reduces memory use while preserving the loss definition. No merge-blocking issue was identified.

Pre-merge checks: Passed 5 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 5 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the Top-K KD loss in TopLogitsKLLoss ran out of memory at long sequences with large vocabularies, and the change computes normalizers in row chunks to cut peak memory.…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Security Anti-Patterns Passed PASS. The pull request changes only CHANGELOG.rst, modelopt/torch/distill/plugins/megatron.py, and a test file. The added Python code contains no torch.load(..., weights_only=False), `numpy.load…
Full details: Title check

Explanation

The title names the main change: the Top-K KD loss in TopLogitsKLLoss ran out of memory at long sequences with large vocabularies, and the change computes normalizers in row chunks to cut peak memory. The raw summary and objectives both describe this chunked computation as the primary change, and the title is short, specific, and free of file lists or vague wording.

Full details: Security Anti-Patterns

Explanation

PASS. The pull request changes only CHANGELOG.rst, modelopt/torch/distill/plugins/megatron.py, and a test file. The added Python code contains no torch.load(..., weights_only=False), numpy.load(..., allow_pickle=True), hardcoded trust_remote_code=True, external-input eval()/exec(), or # nosec. No dependency manifest changed. The only eval() match is the unchanged self._teacher_model.eval() call.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 6 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-28 18:37 UTC

@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.11111% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.12%. Comparing base (580ffff) to head (685afb4).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
modelopt/torch/distill/plugins/megatron.py 91.11% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3080      +/-   ##
==========================================
+ Coverage   73.57%   79.12%   +5.54%     
==========================================
  Files         661      662       +1     
  Lines       75682    77569    +1887     
==========================================
+ Hits        55685    61377    +5692     
+ Misses      19997    16192    -3805     
Flag Coverage Δ
examples-diffusers 19.89% <0.00%> (-0.01%) ⬇️
examples-gpt-oss 13.43% <0.00%> (-0.01%) ⬇️
examples-hf_ptq 23.44% <0.00%> (-0.05%) ⬇️
examples-llm_distill 13.50% <0.00%> (-0.01%) ⬇️
examples-llm_eval 17.19% <0.00%> (-0.01%) ⬇️
examples-llm_qat 17.35% <0.00%> (-0.05%) ⬇️
examples-llm_sparsity 16.72% <0.00%> (-0.01%) ⬇️
examples-megatron_bridge 26.43% <91.11%> (-0.30%) ⬇️
examples-specdec_bench 13.21% <0.00%> (-0.01%) ⬇️
examples-speculative_decoding 17.44% <0.00%> (-0.07%) ⬇️
examples-torch_onnx 21.19% <0.00%> (-0.03%) ⬇️
examples-torch_trt 15.17% <0.00%> (-0.01%) ⬇️
examples-vllm_serve 17.39% <0.00%> (-0.01%) ⬇️
gpu 59.07% <91.11%> (+24.27%) ⬆️
regression 15.00% <0.00%> (-0.02%) ⬇️
unit 61.81% <0.00%> (+0.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChenhanYu ChenhanYu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pensieve comment review using chenhany's profile (revision 7).

Changes requested: the custom normalizer backward loses numerical stability for logits with large common offsets.

Needs action:

  • Fix _ScaledLogSumExpAndGather.backward using centered normalization statistics, and add an offset-invariance gradient regression; see the inline finding.
  • Confirm repository utility reuse and current-head GPU/TP test results; repository navigation and test execution were unavailable.

No action needed:

  • Existing reference-test edits preserve assertions and move backward inside the chunk-size patch, appropriately exercising chunked backward.
  • The 78 added core-logic lines are under budget; no licensing changes are visible.
  • No duplicate issue appeared in supplied discussion; bounded history cannot establish that older discussions contain none.

Review context was incomplete.

[warning] modelopt/torch/distill/plugins/megatron.py:468 — Reconstructing softmax as exp(x/T - lse) loses normalization information when the rounded fp32 log-sum-exp absorbs its small correction. For example, with two equal logits of 224 and T=1, lse rounds to 224, so this computes [1, 1] instead of [0.5, 0.5]. The previous centered exp/sum computation differentiates to [0.5, 0.5]. Thus the new backward can change gradients substantially under a common logit offset. Save the per-row maximum and centered exponential sum, then recompute exp(x/T - max)/sum in backward. Add a regression comparing gradients against the previous centered reference with large shared offsets.

Review run: 81450d9861de4623af804fd5c2cc7810

@meenchen meenchen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bot review (gpt-6.1-sol) — DM the bot to share feedback.

LGTM; no correctness issues found, and the justified existing-test edit strengthens chunked tensor-parallel gradient coverage but requires human sign-off.

Needs action:

  • Sign off on the numerical-reference test edit in tests/gpu_megatron/torch/distill/plugins/test_distill_megatron.py: backward now runs inside the chunk-size patch, preserving assertions while exercising multiple chunks.

Work relative to the row max: the normalizer and the Top-K values are both
shifted by it, so it cancels out of the log-probs, and backward rebuilds the
softmax from the shifted logits instead of exp(x - lse) with a rounded lse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
@kevalmorabia97

Copy link
Copy Markdown
Collaborator Author

@ChenhanYu thanks, the offset finding was real. It is fixed in c6d9e53. main had the same flaw at TP=1, where torch.logsumexp's backward is also exp(x - lse): at an offset of 2**20 its loss moved by 3% and its gradient by 0.035.

  • _scaled_logsumexp now returns the row max m and logsumexp(x - m), and the Top-K values as x - m. m cancels out of the log-probs, so it gets no gradient, as the old TP path's detached max did.
  • The backward recomputes the softmax as exp(x - m - logsumexp(x - m)) from the saved logits. No reconstruction from a rounded lse is left.
  • New test_topk_logits_kl_loss_offset_invariant adds 2**20 to exactly representable logits and checks that the loss and gradient are unchanged. The previous commit fails it (loss off by up to 10%), and it now passes bit for bit.

On your second item, I ran this at the current head:

  • tests/gpu_megatron/torch/distill/plugins/test_distill_megatron.py: 27 passed on 2 GPUs (nemo:26.08). This includes the TP=2 ghost-token reference test with 2-row chunks, so the chunk loop and the TP backward all-reduce are covered.
  • Memory on [4096, 1, 248320] bf16 logits with K=4096 is unchanged by this fix: 18.95 GiB extra on main, 4.08 GiB here.

On utility reuse: nothing in the repo computes a chunked log-sum-exp with a custom backward. LogitsKLLoss._tp_logsumexp (the dense loss) stays as it is.

@ChenhanYu ChenhanYu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pensieve nudge review using chenhany's profile (revision 7).

Nudge: the previous numerical-stability issue is resolved, but full-file integration remains unverified from the bounded snapshot.

Needs action:

  • Confirm the unchanged TopLogitsKLLoss integration preserves tensor-parallel gradient scaling with the new backward collective; surrounding implementation was unavailable for review.

No action needed:

  • ✔️ Review 5679420659's offset concern is resolved: forward and backward use centered statistics, with a new loss-and-gradient offset regression.
  • Reply 6464613891 addresses utility reuse and reports 27 current-head tests passing on two GPUs.
  • The existing reference-test edit preserves assertions and moves backward inside the chunk-size patch, appropriately exercising chunked backward.
  • Duplicate checking used supplied history only; omitted discussions, repository navigation, and independent test execution were unavailable.

Review context was incomplete.

Review run: 0603102d69864116b994635b11504a88

@kevalmorabia97

Copy link
Copy Markdown
Collaborator Author

@ChenhanYu Confirmed: TP gradient scaling is the same as on main, and the TP test checks it.

  • Same collective as main: main all-reduced the student normalizer with dist_nn.functional.all_reduce, whose backward all-reduces (sums) the incoming gradient across TP ranks. _ScaledLogSumExpAndGather.backward does that same sum on grad_lse before computing the shard gradient. The rest of TopLogitsKLLoss.forward is unchanged, including the all_gather of the Top-K values and its backward.
  • Covered by a test: test_topk_logits_kl_loss_numerics_ghost_token_reference runs the loss at TP=2 and checks each rank's shard gradient against the matching slice of a single-GPU, full-vocab reference gradient (rtol=1e-5).
  • The test catches a wrong scale: I ran its 3 cases on 2 GPUs at c6d9e53 and they pass. Then I broke the backward two ways:
    • Without the backward all-reduce, every gradient element mismatches, up to 101x relative error.
    • With the reduced gradient doubled, every gradient element also mismatches, up to 202x.

@kevalmorabia97 kevalmorabia97 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pensieve approve review using kmorabia's profile (revision 2).

Approve: the chunked Top-K normalizers fix the OOM with unchanged loss and gradients. The earlier offset-stability and TP-gradient concerns are both resolved.

No action needed:

  • ✔️ Resolved since the last review: the offset instability (centered forward and backward statistics, plus test_topk_logits_kl_loss_offset_invariant) and the TP gradient scaling question.
  • The backward all-reduce of grad_lse in _ScaledLogSumExpAndGather matches the backward of the autograd all-reduce it replaces. Author reply 6466281874 shows the TP=2 reference test fails if that all-reduce is dropped or the gradient doubled. I read the code to confirm the collective; I did not run the tests.
  • The gradient softmax * grad_lse + grad_vals, divided by T, is correct, and the scatter indices are unique Top-K entries.
  • The existing reference-test edit keeps its assertions and moves backward inside the chunk-size patch, so the chunk loop and TP backward are exercised.
  • 81 added core lines, under budget. modelopt/torch/ is not a setup-owned path, and there are no licensing changes.
  • Prior reviews at this head used bounded history, so duplicate checking is limited to what was supplied.

Review run: e0bdcec9383a41e9876cb20fdbb76ee4

@ChenhanYu ChenhanYu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pensieve nudge review using chenhany's profile (revision 7).

Nudge: prior correctness concerns are resolved, but repository-wide verification remains unavailable in this bounded review.

Needs action:

  • Confirm repository review requirements and surrounding integration at c6d9e53, and sign off on the justified reference-test edit in tests/gpu_megatron/torch/distill/plugins/test_distill_megatron.py.

No action needed:

  • ✔️ Resolved: review 5679420659's offset instability through centered statistics and a regression test; review 5680900716's TP-gradient question through reply 6466281874's collective explanation and reported mutation tests.
  • The existing reference-test assertions remain intact; moving backward inside the chunk-size patch exercises chunked backward.
  • No new concrete defect found. Reply 6464613891 addresses utility reuse and reports 27 passing current-head tests.
  • Repository navigation and independent execution were unavailable. Duplicate checking was limited to supplied history, which may omit older discussions.

Review context was incomplete.

Review run: 390bacf139ac4b888f467a3251c8a428

@ChenhanYu ChenhanYu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pensieve nudge review using chenhany's profile (revision 7).

Nudge: prior correctness concerns are resolved, but the bounded snapshot leaves repository requirements and surrounding integration unverified.

Needs action:

  • Confirm repository requirements and full-file integration at c6d9e53, continuing review 5686210730; include human sign-off on the justified reference-test edit.

No action needed:

  • ✔️ Resolved: review 5679420659’s offset instability through centered statistics and regression coverage; review 5680900716’s TP-gradient concern through the matching backward collective and reply 6466281874.
  • Existing reference assertions remain intact; moving backward inside the chunk-size patch exercises chunked backward.
  • Reply 6464613891 addresses utility reuse and reports 27 passing current-head GPU tests. Independent execution and repository navigation were unavailable.
  • No new concrete defect found. Duplicate checking was limited to supplied history, which may omit older discussions.

Review context was incomplete.

Review run: cc920c2c15174d9d8cff540c6f84f663

@ChenhanYu
ChenhanYu self-requested a review October 28, 2026 16:37

@meenchen meenchen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bot review (gpt-6.1-sol) — DM the bot to share feedback.

Changes requested: _scaled_logsumexp now rejects empty batch or sequence inputs that the previous loss implementation accepted.

Needs action:

  • Fix empty-row shape restoration in modelopt/torch/distill/plugins/megatron.py and add forward/backward coverage; see the inline finding.
  • Correct the “identical loss and gradients” claim in CHANGELOG.rst; the offset-stability fix intentionally changes inaccurate results.
  • Sign off on the justified TP-reference-test edit in tests/gpu_megatron/torch/distill/plugins/test_distill_megatron.py.

No action needed:

  • ✔️ Resolved since the previous reviews: offset instability, TP-gradient scaling, and the full-file integration question.
  • The reference-test assertions remain intact; moving backward inside the chunk-size patch strengthens coverage.

Comment thread CHANGELOG.rst Resolved
Reshape the normalizer results with explicit widths, since -1 cannot be
inferred for zero-element tensors, and add forward/backward coverage.
Reword the changelog entry: results now differ from before for logits
with a large common offset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>

@meenchen meenchen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bot review (gpt-6.1-sol) — DM the bot to share feedback.

LGTM; prior correctness concerns are resolved, with human sign-off required only for the justified TP-reference-test edit.

Needs action:

  • Sign off on the TP-reference-test edit in tests/gpu_megatron/torch/distill/plugins/test_distill_megatron.py: assertions are unchanged, and backward now runs inside the chunk-size patch.

No action needed:

  • ✔️ Resolved since the last review: empty-input forward/backward handling and the inaccurate changelog claim.

@kevalmorabia97
kevalmorabia97 enabled auto-merge (squash) October 28, 2026 17:05

@ChenhanYu ChenhanYu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pensieve nudge review using chenhany's profile (revision 7).

Nudge: the supplied snapshot includes a later commit than the requested head, preventing an exact-commit review.

Needs action:

  • Supply the diff from 580ffff1cddb9b20a38b7434e6290654ebf96a8f to requested head c6d9e538d9c8f7d6dc9cd3f6308d07bceaacf420; the supplied snapshot instead targets 685afb47df7acbbf4c70e667ec1b8f4f60d337f4.
  • Confirm repository requirements and integration, continuing review 5686249770; obtain human sign-off on the justified TP-reference-test edit, which preserves assertions while exercising chunked backward.

No action needed:

  • ✔️ The supplied later snapshot visibly addresses empty-input comment 4403422324 and changelog comment 4403422338. These fixes cannot establish resolution at the requested earlier head.
  • Independent inspection found centered normalization and the matching backward gradient collective consistent with the intended calculation; no new concrete defect was identified in the supplied patch.
  • Reviewer: Codex (GPT-6). Only the supplied snapshot and bounded discussion were inspected. Repository navigation, independent tests, and exact-target verification were unavailable; duplicate checking is limited to supplied history.

Review context was incomplete.

Review run: ff78be1906f64fea9edb0b2233a15377

@kevalmorabia97
kevalmorabia97 merged commit 0bc6f50 into main Oct 28, 2026
62 of 64 checks passed
@kevalmorabia97
kevalmorabia97 deleted the kmorabia/topk-kd-loss-memory branch October 28, 2026 18:37
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.

3 participants