Fallback for unsupported Hybrid Engine policies - #8265
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
|
||
| has_transformer_policy = any(module.__class__ in self.inference_policies for module in self.module.modules()) | ||
| if not has_transformer_policy: | ||
| self.inference_policies = {} |
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.
b52d85e to
9797ae4
Compare
Signed-off-by: LiRunGuo <li19107254665@gmail.com>
Signed-off-by: LiRunGuo <li19107254665@gmail.com>
9797ae4 to
85e3a2f
Compare
|
Hi @delock, I have addressed the requested warning in the latest update. When no compatible transformer inference policy matches, Hybrid Engine now emits a |
|
Hi @LiRunGuo there is a UT failure in CI, can you take a look? Thanks! |
Signed-off-by: LiRunGuo <li19107254665@gmail.com>
|
Hi @delock, thanks for pointing this out. I investigated the failed CPU UT. The warning itself was emitted correctly (it appeared under |
|
Hi @delock, the latest Modal CI failed with exit code 137 after progressing through roughly 55% of the tests, without any assertion failure. This appears to be a transient sandbox resource/OOM termination. Could you please rerun the failed CI check and add the PR back to the merge queue if it passes? Thanks! |
a36f78e
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