[RFC] [Misc] Convert untyped OmniStageTask dict to TypedDict#1547
[RFC] [Misc] Convert untyped OmniStageTask dict to TypedDict#1547NickCao wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f2d3b0440
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
lishunyang12
left a comment
There was a problem hiding this comment.
Left a couple comments. Main concern is that OmniStageTaskGenerate tries to cover both seed tasks and connector notifications, which have almost entirely different field sets. The most important construction sites (stage-0 seeds in omni.py and async_omni.py) are still raw dicts, which kind of defeats the purpose of the typing effort.
Converted these to OmniStageTaskGenerate, whether to further factor them into a new task type can happen in a followup PR. |
85ca3cb to
3a26869
Compare
|
Seed-site conversions look good. Two things to fix:
|
Already resolved in the latest push? |
…Dict Signed-off-by: Nick Cao <ncao@redhat.com>
…TOP} to TypedDict Signed-off-by: Nick Cao <ncao@redhat.com>
Signed-off-by: Nick Cao <ncao@redhat.com>
…Dict Signed-off-by: Nick Cao <ncao@redhat.com>
Signed-off-by: Nick Cao <ncao@redhat.com>
|
Rebased on current main. |
|
@natureofnature PTAL |
|
fix conflicts |
|
No longer relevant after #1908 |
PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS (AT THE BOTTOM) HAVE BEEN CONSIDERED.
Purpose
Currently the task messages passed between stages are untyped dict, requiring the receiving stage to validate all incoming messages manually. Thus I propose we gradually type them as TypedDict, and eventually as pydantic tagged union to improve the maintainability of these messages.
Test Plan
TypedDicts are just regular dicts at runtime, no additional testing is required, apart from testing if the stages still work.
Test Result
N/A
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model. Please runmkdocs serveto sync the documentation editions to./docs.BEFORE SUBMITTING, PLEASE READ https://github.com/vllm-project/vllm-omni/blob/main/CONTRIBUTING.md (anything written below this line will be removed by GitHub Actions)