test(mtp): drop monkeypatch of removed _get_generation_stream#1445
Merged
Conversation
jundot#1304 (``fix(engine): per-engine threads to eliminate cross-engine stream contamination``) refactored the patched ``BatchGenerator`` to inherit its execution stream from the enclosing engine context, and removed the module-level ``_get_generation_stream`` helper as part of that. ``TestBatchGeneratorDispatch._make_reconcile_batch`` still tried to monkeypatch that name and failed at collection of every test that depends on the fixture with ``AttributeError: module ... has no attribute '_get_generation_stream'`` — taking down 4 reconcile-path tests on every CI run. The override is no longer needed: the surrounding fixture replaces ``_rebuild_singleton_cache`` and ``_call_backbone`` with fakes that do all of their work via ``np.array`` / ``mx.array`` directly, so neither MLX dispatch nor stream selection is reached. Tests (tests/test_mlx_lm_mtp_patch.py::TestBatchGeneratorDispatch): - test_reconcile_uses_queue_front_as_next_token - test_reconcile_empty_queue_samples_from_logits - test_reconcile_returns_false_on_empty_tokens - test_reconcile_fallback_on_rebuild_failure 11/11 TestBatchGeneratorDispatch tests pass.
Owner
|
Thanks for catching this — the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#1304 (
fix(engine): per-engine threads to eliminate cross-engine stream contamination) refactored the patchedBatchGeneratorto inherit its execution stream from the enclosing engine context, and removed the module-level_get_generation_streamhelper as part of that.TestBatchGeneratorDispatch._make_reconcile_batchstill tried to monkeypatch that name and failed at every test that used the fixture with:— taking down 4 reconcile-path tests on every CI run.
The override is no longer needed: the surrounding fixture replaces
_rebuild_singleton_cacheand_call_backbonewith fakes that do their work vianp.array/mx.arraydirectly, so neither MLX dispatch nor stream selection is reached.Test plan
pytest tests/test_mlx_lm_mtp_patch.py::TestBatchGeneratorDispatch— 11/11 pass (was 7/11 with these 4 failing onmain):test_reconcile_uses_queue_front_as_next_tokentest_reconcile_empty_queue_samples_from_logitstest_reconcile_returns_false_on_empty_tokenstest_reconcile_fallback_on_rebuild_failure