[BREAKING] refactor: rename GpuPlatformInfo.gpus to .devices#33
Merged
Conversation
`gpu.gpus` reads awkwardly at call sites; the field is the list of GPU devices, so `.devices` reads naturally as `gpu.devices`. Signed-off-by: Noppanat Wadlom <noppanat.wad@gmail.com>
151cbc5 to
e67b291
Compare
15 tasks
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.
Purpose
GpuPlatformInfo.gpusreads awkwardly at every call site (gpu.gpus). Rename todevicesso the access reads naturally asgpu.devices. Hard rename — no compat shim, the wire format breaks; coordinate with a full server+worker restart and flush any cached worker registry entries in Redis on deploy.Changes
src/shared/tasks/worker_message.py,src/server/schemas/node.py,sdk/src/flowmesh/models/workers.py— renameGpuPlatformInfo.gpusfield todevices.src/worker/hw.py— rename localgpusaccumulator andGpuPlatformInfo(...)kwarg.src/server/dispatcher/worker_selector.py,src/server/registries/worker.py,src/server/services/metrics.py— update all.gpusreads to.devices; rename matching local vars where the read flows straight in.tests/worker/test_hw.py,tests/server/dispatcher/test_worker_selector.py,tests/server/registries/test_worker_registry.py,tests/sdk/test_models.py— update attribute reads and constructor kwargs.Design
The model is mirrored across three packages (
shared,server.schemas,flowmesh-sdk) andtests/sdk/test_schema_compat.pyasserts the server↔SDK schemas stay in sync, so all three renames ship together. Local variables namedgpusthat hold alist[GpuInfo]are renamed todevicesonly where the read site or write site benefits from the consistency; standalonelist[GpuInfo]locals that are not field-sourced were left as-is.Wire-format compatibility is intentionally not preserved — the repo is pre-release and adding a Pydantic alias would leave the misleading field name in API docs.
Test Plan
Test Result
Not run locally — relying on CI. Refactor is mechanical and was verified by grep: no
\.gpusorgpus=references to the renamed field remain (other*gpushits are unrelated names likeavailable_gpus,n_gpus).Pre-submission Checklist
pre-commit run --all-filesand fixed any issues.uv run pytest tests/passes locally.uv sync --all-packages --group ci --frozen).[BREAKING]and described migration steps above.