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

Add schema compatibility test #3130

Closed
wants to merge 1 commit into from
Closed

Conversation

spcyppt
Copy link
Contributor

@spcyppt spcyppt commented Sep 12, 2024

Summary:
To ensure that changes to the ops are forward and backward compatible with the stable release, we add unit tests to test schema compatibility.

Usage:

check_schema_compatibility_from_op_name(
  namespace: Callable, 
  op_name: str
  ref_schema_str: str,
)
check_schema_compatibility(
  op: Callable,
  ref_schema_str: str,
)

e.g.,

check_schema_compatibility_from_op_name(
  torch.ops.fbgemm, 
  "merge_pooled_embeddings", 
  "fbgemm::merge_pooled_embeddings(Tensor[] pooled_embeddings, SymInt uncat_dim_size, Device target_device, SymInt cat_dim=1) -> Tensor"
)
check_schema_compatibility(
  fbgemm_gpu.sparse_ops.merge_pooled_embeddings,
  "merge_pooled_embeddings(Tensor[] pooled_embeddings, int uncat_dim_size, Device target_device, int cat_dim=1) -> Tensor",
)

Differential Revision: D61766648

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61766648

Copy link

netlify bot commented Sep 12, 2024

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
🔨 Latest commit 8beab8d
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/66eb8381f840a200080b67fa
😎 Deploy Preview https://deploy-preview-3130--pytorch-fbgemm-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

spcyppt added a commit to spcyppt/FBGEMM that referenced this pull request Sep 17, 2024
Summary:
X-link: facebookresearch/FBGEMM#217


To ensure that changes to the ops are forward and backward compatible with the stable release, we add unit tests to test schema compatibility. 

**Usage**:
```
check_schema_compatibility_from_op_name(
  namespace: Callable, 
  op_name: str
  ref_schema_str: str,
)
check_schema_compatibility(
  op: Callable,
  ref_schema_str: str,
)
```

e.g.,
```
check_schema_compatibility_from_op_name(
  torch.ops.fbgemm, 
  "merge_pooled_embeddings", 
  "fbgemm::merge_pooled_embeddings(Tensor[] pooled_embeddings, SymInt uncat_dim_size, Device target_device, SymInt cat_dim=1) -> Tensor"
)
check_schema_compatibility(
  fbgemm_gpu.sparse_ops.merge_pooled_embeddings,
  "merge_pooled_embeddings(Tensor[] pooled_embeddings, int uncat_dim_size, Device target_device, int cat_dim=1) -> Tensor",
)
```

Differential Revision: D61766648
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61766648

Summary:
X-link: facebookresearch/FBGEMM#217


To ensure that changes to the ops are forward and backward compatible with the stable release, we add unit tests to test schema compatibility. 

**Usage**:
```
check_schema_compatibility_from_op_name(
  namespace: Callable, 
  op_name: str
  ref_schema_str: str,
)
check_schema_compatibility(
  op: Callable,
  ref_schema_str: str,
)
```

e.g.,
```
check_schema_compatibility_from_op_name(
  torch.ops.fbgemm, 
  "merge_pooled_embeddings", 
  "fbgemm::merge_pooled_embeddings(Tensor[] pooled_embeddings, SymInt uncat_dim_size, Device target_device, SymInt cat_dim=1) -> Tensor"
)
check_schema_compatibility(
  fbgemm_gpu.sparse_ops.merge_pooled_embeddings,
  "merge_pooled_embeddings(Tensor[] pooled_embeddings, int uncat_dim_size, Device target_device, int cat_dim=1) -> Tensor",
)
```

Differential Revision: D61766648
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61766648

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 0377308.

spcyppt added a commit that referenced this pull request Oct 7, 2024
Summary:
X-link: facebookresearch/FBGEMM#217

Pull Request resolved: #3130

To ensure that changes to the ops are forward and backward compatible with the stable release, we add unit tests to test schema compatibility.

**Usage**:
```
check_schema_compatibility_from_op_name(
  namespace: Callable,
  op_name: str
  ref_schema_str: str,
)
check_schema_compatibility(
  op: Callable,
  ref_schema_str: str,
)
```

e.g.,
```
check_schema_compatibility_from_op_name(
  torch.ops.fbgemm,
  "merge_pooled_embeddings",
  "fbgemm::merge_pooled_embeddings(Tensor[] pooled_embeddings, SymInt uncat_dim_size, Device target_device, SymInt cat_dim=1) -> Tensor"
)
check_schema_compatibility(
  fbgemm_gpu.sparse_ops.merge_pooled_embeddings,
  "merge_pooled_embeddings(Tensor[] pooled_embeddings, int uncat_dim_size, Device target_device, int cat_dim=1) -> Tensor",
)
```

Reviewed By: q10

Differential Revision: D61766648

fbshipit-source-id: dac52b88834331a466e7165812def1a3fe4c0804
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants