Skip to content

feat: make ParameterMeta JSON serializable#9

Merged
weixiao-huang merged 2 commits into
mainfrom
feat/meta-json-serializable
Sep 16, 2025
Merged

feat: make ParameterMeta JSON serializable#9
weixiao-huang merged 2 commits into
mainfrom
feat/meta-json-serializable

Conversation

@weixiao-huang

Copy link
Copy Markdown
Collaborator

Resolves #8

@weixiao-huang weixiao-huang force-pushed the feat/meta-json-serializable branch 2 times, most recently from 00c6716 to 00ec478 Compare September 16, 2025 01:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR makes the ParameterMeta class JSON serializable by adding proper Pydantic validators and serializers for PyTorch types. The changes enable serialization of torch.dtype and torch.Size objects that were previously incompatible with JSON serialization.

Key changes:

  • Updated Pydantic dependency to version 2.0.0+ to support new validation features
  • Created custom type annotations _TorchDtype and _TorchSize with validators and serializers
  • Replaced the arbitrary types configuration with proper type handling

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
pyproject.toml Updated pydantic version requirement and added requests dependency
checkpoint_engine/ps.py Added custom type validators/serializers and updated ParameterMeta fields

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread checkpoint_engine/ps.py
Comment thread checkpoint_engine/ps.py Outdated
Comment thread checkpoint_engine/ps.py Outdated
Comment thread checkpoint_engine/ps.py Outdated
@weixiao-huang weixiao-huang force-pushed the feat/meta-json-serializable branch from 8bf9513 to e82869c Compare September 16, 2025 07:18
@SongXiaoXi

Copy link
Copy Markdown
Collaborator

Others, LGTM

@weixiao-huang weixiao-huang merged commit efb8907 into main Sep 16, 2025
1 check passed
@weixiao-huang weixiao-huang deleted the feat/meta-json-serializable branch September 16, 2025 09:32
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.

Make ParameterMeta JSON Serializable

3 participants