Skip to content

Introduce data schema to store raw tensors #6540

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

Merged
merged 9 commits into from
Nov 16, 2024

Conversation

lucylq
Copy link
Contributor

@lucylq lucylq commented Oct 28, 2024

Stack from ghstack (oldest at bottom):

Differential Revision: D65156641

Copy link

pytorch-bot bot commented Oct 28, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/6540

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ You can merge normally! (1 Unrelated Failure)

As of commit 70c9f7f with merge base 3813f42 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

lucylq added a commit that referenced this pull request Oct 28, 2024
ghstack-source-id: da15b0f
Pull Request resolved: #6540
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 28, 2024
@lucylq lucylq requested review from JacobSzwejbka and dbort October 28, 2024 22:39
@lucylq
Copy link
Contributor Author

lucylq commented Oct 28, 2024

See: #6492

lucylq added a commit that referenced this pull request Oct 28, 2024
ghstack-source-id: 99f32da
Pull Request resolved: #6540
schema/data.fbs Outdated
// Offset in scalar_type elements (e.g., multiples of 4 bytes for an int
// scalar type) from the beginning of the tensor buffer to the beginning of
// the actual data. Currently, the runtime only supports a value of zero.
storage_offset:int;

This comment was marked as resolved.

schema/data.fbs Outdated
scalar_type:ScalarType;

// Size of each dimension.
dim_sizes:[int];
Copy link
Contributor Author

@lucylq lucylq Oct 28, 2024

Choose a reason for hiding this comment

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

equivalent of sizes in program.fbs, using dim_sizes to differentiate from size of the tensor below.

@lucylq lucylq requested a review from iseeyuan October 28, 2024 23:14
@lucylq
Copy link
Contributor Author

lucylq commented Oct 29, 2024

@lucylq has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

lucylq added a commit that referenced this pull request Oct 29, 2024
ghstack-source-id: 14770e7
Pull Request resolved: #6540
lucylq added a commit that referenced this pull request Oct 30, 2024
ghstack-source-id: 5f83f21
Pull Request resolved: #6540
@lucylq
Copy link
Contributor Author

lucylq commented Oct 30, 2024

@lucylq has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

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

lucylq added a commit that referenced this pull request Oct 30, 2024
Pull Request resolved: #6540




@imported-using-ghimport

Differential Revision: [D65156641](https://our.internmc.facebook.com/intern/diff/D65156641/)
ghstack-source-id: 251037652
Copy link
Contributor

@JacobSzwejbka JacobSzwejbka left a comment

Choose a reason for hiding this comment

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

I was thinking maybe we should try to reuse more fields from the core schema but I guess the goal of this is different enough that we dont have to. Are we 100% sure we even need sizes and dim order. I think the set of fully qualified names provides a good enough compatibility guarantee (seems unlikely 2 models would have the exact same key set but different values)

class TensorMetadata:
fully_qualified_name: str
scalar_type: ScalarType
dim_sizes: List[int]
Copy link
Contributor

@JacobSzwejbka JacobSzwejbka Nov 5, 2024

Choose a reason for hiding this comment

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

nit: just sizes not dim_sizes

lucylq added a commit that referenced this pull request Nov 12, 2024
Pull Request resolved: #6540




@imported-using-ghimport

Differential Revision: [D65156641](https://our.internmc.facebook.com/intern/diff/D65156641/)
ghstack-source-id: 253116779
@facebook-github-bot
Copy link
Contributor

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

lucylq added a commit that referenced this pull request Nov 12, 2024
Pull Request resolved: #6540




@imported-using-ghimport

Differential Revision: [D65156641](https://our.internmc.facebook.com/intern/diff/D65156641/)
ghstack-source-id: 253187679
@facebook-github-bot
Copy link
Contributor

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

lucylq added a commit that referenced this pull request Nov 12, 2024
Pull Request resolved: #6540




@imported-using-ghimport

Differential Revision: [D65156641](https://our.internmc.facebook.com/intern/diff/D65156641/)
ghstack-source-id: 253188153
@facebook-github-bot
Copy link
Contributor

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

lucylq added a commit that referenced this pull request Nov 16, 2024
Pull Request resolved: #6540




@imported-using-ghimport

Differential Revision: [D65156641](https://our.internmc.facebook.com/intern/diff/D65156641/)
ghstack-source-id: 253910001
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot facebook-github-bot merged commit 2548aeb into gh/lucylq/12/base Nov 16, 2024
41 checks passed
@facebook-github-bot facebook-github-bot deleted the gh/lucylq/12/head branch November 16, 2024 04:40
lucylq added a commit that referenced this pull request Nov 18, 2024
[executorch][serialization] Introduce data schema to store raw tensors

Pull Request resolved: #6540




@imported-using-ghimport

Differential Revision: [D65156641](https://our.internmc.facebook.com/intern/diff/D65156641/)
ghstack-source-id: 253910001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants