fix(ckpt): backport attention backend checkpoint inference to r0.5.0#4379
Open
cuichenx wants to merge 1 commit into
Open
fix(ckpt): backport attention backend checkpoint inference to r0.5.0#4379cuichenx wants to merge 1 commit into
cuichenx wants to merge 1 commit into
Conversation
Signed-off-by: Chen Cui <chcui@nvidia.com> (cherry picked from commit f817629)
Contributor
Light Code ReviewClean cherry-pick of #4370 to r0.5.0. The refactoring extracts _build_megatron_checkpoint_overrides and adds the missing attention_backend key to the Megatron checkpoint override dictionary. No logic errors or typos found.__Test coverage__The single test (test_megatron_checkpoint_overrides_preserve_attention_backend) covers the happy path where all optional fields are present. This is adequate for the targeted regression fix, but note that the negative paths are untested in this backport:- attention_backend=None (key should be absent from overrides)- Provider without cache_mla_latents attribute (key should be absent)- inference_moe_token_dispatcher_type=None (key should be absent)- dtype=torch.float16 (should produce bf16=False, fp16=True)These are low-risk since the conditionals are straightforward, and this is a release backport -- not the place to expand coverage.__Suggested test cases__No perf tests impacted. |
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
Conflict resolution
The auto cherry-pick conflicted because tests/unit_tests/scripts/test_text_generation.py does not exist on r0.5.0. I added a narrow release-compatible test file containing the #4370 attention-backend regression coverage, without main-only distributed-env tests.
Testing
Cherry-pick of #4370.