Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ManagerClient.quorum should return a namedtuple, dataclass or object #52

Open
Jackmin801 opened this issue Dec 20, 2024 · 2 comments
Open

Comments

@Jackmin801
Copy link
Collaborator

class ManagerClient:
    def quorum(
        self, room_id: str, rank: int, step: int, checkpoint_server_addr: str
    ) -> Tuple[int, int, int, str, str, int, Optional[int], int, bool]: ...
            Ok((
                resp.quorum_id,
                resp.replica_rank,
                resp.replica_world_size,
                resp.address,
                resp.store_address,
                resp.max_step,
                resp.max_rank,
                resp.max_world_size,
                resp.heal,
            ))

This can be quite hard to read from the python side. Might be nice to wrap it in an object of sorts so the elements can be referred to by attribute name.

@Jackmin801
Copy link
Collaborator Author

Hrmm I think namedtuple or dataclass requires taking back GIL. Maybe a struct might work

@d4l3k
Copy link
Member

d4l3k commented Dec 20, 2024

Agreed -- should improve this

Right now I'm relying on pyre types to catch any issues

We could also use protobuf or use pyo3 to bind a Rust struct

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

No branches or pull requests

2 participants