Skip to content

fix: add return_ce_loss attribute to _DummySeq test stub#4683

Closed
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-unit-test-failure
Closed

fix: add return_ce_loss attribute to _DummySeq test stub#4683
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-unit-test-failure

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Motivation

The get_ppl feature added a __need_ce_loss helper in inputs_maker.py that reads seq.return_ce_loss on every sequence in the running list. The _DummySeq stub used in tests/pytorch/engine/test_inputs_maker.py was never updated to include this attribute, causing 3 tests to fail with AttributeError.

Modification

  • Added self.return_ce_loss = False to _DummySeq.__init__ alongside the existing return_logits and return_routed_experts stub attributes.

BC-breaking (Optional)

N/A — test-only change.

Use cases (Optional)

N/A

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
  3. If the modification has a dependency on downstream projects of a newer version, this PR should be tested with all supported versions of downstream projects.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

The `inputs_maker.py` `__need_ce_loss` function accesses `seq.return_ce_loss`
but the `_DummySeq` stub in the test file was missing this attribute, causing
3 test failures:
- test_single_forward_multimodal_long_context_stays_normal_prefill_for_spec_decoding
- test_spec_decoding_text_turn_ignores_previous_multimodal_chunk_limit
- test_long_context_final_chunk_preserves_multimodal_flag_for_spec_decoding
Copilot AI changed the title [WIP] Fix failing GitHub Actions job unit_test fix: add return_ce_loss to _DummySeq test stub Jun 16, 2026
Copilot AI requested a review from irexyc June 16, 2026 11:57
Copilot AI changed the title fix: add return_ce_loss to _DummySeq test stub Fix unit_test regression in test_inputs_maker dummy sequence Jun 16, 2026
Copilot AI changed the title Fix unit_test regression in test_inputs_maker dummy sequence fix: add return_ce_loss attribute to _DummySeq test stub Jun 16, 2026
@irexyc irexyc closed this Jun 16, 2026
@lvhan028 lvhan028 deleted the copilot/fix-unit-test-failure branch June 24, 2026 04:35
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.

2 participants