Fallback for unsupported Hybrid Engine policies - #8265
Open
LiRunGuo wants to merge 1 commit into
Open
Conversation
Signed-off-by: LiRunGuo <li19107254665@gmail.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
delock
reviewed
Aug 21, 2026
|
|
||
| has_transformer_policy = any(module.__class__ in self.inference_policies for module in self.module.modules()) | ||
| if not has_transformer_policy: | ||
| self.inference_policies = {} |
Collaborator
There was a problem hiding this comment.
Can you add a logger.warning here for not matching inference_policies? This would give user proper expectations.
delock
requested changes
Aug 21, 2026
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
generate()fallbackFixes #8263.
Why
The generic wrappers are auxiliary pieces of a complete transformer injection policy. Registering them when no transformer layer matches creates a partial inference path. With a ZeRO-3-partitioned Qwen model, container construction can then reach
_mark_uc_metadata()with a one-dimensional normalization weight and fail onweight.shape[1].The change first builds the complete-policy map and checks it against the model's module classes. If no complete policy matches, the map remains empty, no partial containers are created, and Hybrid Engine leaves the model's native generation method intact. Supported model behavior is unchanged.
Validation
pytest -q tests/unit/hybrid_engine/test_he_policy.py(2 passed)pre-commit run --files deepspeed/runtime/hybrid_engine.py tests/unit/hybrid_engine/test_he_policy.py