Skip to content

Support new python 3.14 annotation handling#7831

Merged
tohtana merged 6 commits intodeepspeedai:masterfrom
sdvillal:py3.14-compat
Feb 10, 2026
Merged

Support new python 3.14 annotation handling#7831
tohtana merged 6 commits intodeepspeedai:masterfrom
sdvillal:py3.14-compat

Conversation

@sdvillal
Copy link
Contributor

@sdvillal sdvillal commented Feb 5, 2026

Current metaclasses for layers and parameters access annotations in a way that is incompatible with python 3.14+

See:

This PR uses annotationlib from python 3.14 onwards and keeps backwards compatibility.

closes #7673
should unblock CF builds for py3.14 conda-forge/deepspeed-feedstock#114

A question is, does deepspeed support officially 3.14 yet? Should we test it in CIs?

closes deepspeedai#7673

Signed-off-by: Santi Villalba <sdvillal@gmail.com>
@tohtana
Copy link
Collaborator

tohtana commented Feb 6, 2026

Thank you @sdvillal!
I left some minor comments but don't see any actual issue.
We should definitely support Python 3.14. Let me quickly run the full test workflow with Python 3.14 to validate it works.

@tohtana
Copy link
Collaborator

tohtana commented Feb 7, 2026

Sorry, can you fix the annotations to Dict[str, Any]? It seems Python 3.8 throws an error with dict.

Signed-off-by: Santi Villalba <sdvillal@gmail.com>
this does not force the caller to provide the type, hopefully it is not surprising

Signed-off-by: Santi Villalba <sdvillal@gmail.com>
…f annotationlib.get_annotations

Signed-off-by: Santi Villalba <sdvillal@gmail.com>
Signed-off-by: Santi Villalba <sdvillal@gmail.com>
Copy link
Collaborator

@tohtana tohtana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdvillal Everything looks good, thank you for your contribution!

@tohtana tohtana merged commit 72b9465 into deepspeedai:master Feb 10, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Can not use deepspeed.layer.moe

2 participants