Pydantic v2 migration#5167
Merged
Merged
Conversation
mrwyattii
requested review from
arashb,
awan-10,
loadams and
tjruwase
as code owners
February 21, 2024 00:52
loadams
reviewed
Feb 21, 2024
Collaborator
|
Do you want to do what we did on the previous pydantic update of updating the nv-mii test to use your branch rather than |
loadams
reviewed
Feb 27, 2024
Contributor
Author
|
CI with deepspeedai/DeepSpeed-MII#423 for nv-a6000 and nv-mii |
loadams
reviewed
Mar 4, 2024
Collaborator
Collaborator
|
Tested in #6382. |
Collaborator
weiji14
added a commit
to regro-cf-autotick-bot/deepspeed-feedstock
that referenced
this pull request
Aug 23, 2024
Since deepspeedai/DeepSpeed#5167 is merged already.
weiji14
added a commit
to conda-forge/deepspeed-feedstock
that referenced
this pull request
Aug 29, 2024
* updated v0.15.0 * MNT: Re-rendered with conda-build 24.7.1, conda-smithy 3.38.0, and conda-forge-pinning 2024.08.23.00.41.48 * Remove ninja as runtime dependency Xref #1 * Remove note about pydantic<2.0.0 pin Since deepspeedai/DeepSpeed#5167 is merged already. --------- Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
mauryaavinash95
pushed a commit
to DataStates/DeepSpeed
that referenced
this pull request
Mar 20, 2025
Pydantic v2 has been out for some time now. We have been relying on using the v1 API available in v2 until now. This is a refresh of deepspeedai#3902 to bring proper v2 support to DeepSpeed. Corresponding DeepSpeed-MII PR [here](deepspeedai/DeepSpeed-MII#423). @loadams --------- Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com> Co-authored-by: Logan Adams <loadams@microsoft.com> Co-authored-by: Olatunji Ruwase <olruwase@microsoft.com> Co-authored-by: Abhishek Kulkarni <11399+adk9@users.noreply.github.com> Co-authored-by: Abhishek Kulkarni <abkulkarni@microsoft.com> Co-authored-by: Lev Kurilenko <113481193+lekurile@users.noreply.github.com>
banxingmjj
pushed a commit
to openanolis/DeepSpeed
that referenced
this pull request
Jul 17, 2026
…eepspeedai#8145) `DeepSpeedInferenceConfig.moe` is typed `Union[bool, DeepSpeedMoEConfig]`, and the `moe_backward_compat` validator explicitly handles the bool form (the old `init_inference(..., moe=<bool>)` interface). But it builds `DeepSpeedMoEConfig(moe=field_value)` — and `DeepSpeedMoEConfig` has no `moe` field (it has `enabled`). Since `DeepSpeedConfigModel` sets `extra="forbid"`, every bool `moe` raises a `ValidationError` instead of building the config: ```python >>> from deepspeed.inference.config import DeepSpeedInferenceConfig >>> DeepSpeedInferenceConfig(moe=True) pydantic_core._pydantic_core.ValidationError: 1 validation error for DeepSpeedMoEConfig moe Extra inputs are not permitted [type=extra_forbidden, ...] ``` Both `moe=True` and `moe=False` crash, so the documented backward-compat path is unusable. The fix passes `enabled=field_value` (the actual field) so the bool is turned into a `DeepSpeedMoEConfig` as intended. The line dates back to deepspeedai#2516 and survived the pydantic-v2 migration (deepspeedai#5167) unchanged. Added a regression test (`test_moe_backward_compat_bool`) asserting the bool form builds a `DeepSpeedMoEConfig` with the matching `enabled`. `yapf` and `flake8` clean. Signed-off-by: winklemad <winklemad@outlook.com>
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.
Pydantic v2 has been out for some time now. We have been relying on using the v1 API available in v2 until now. This is a refresh of #3902 to bring proper v2 support to DeepSpeed.
Corresponding DeepSpeed-MII PR here.
@loadams