Skip to content

Conversation

@Gasoonjia
Copy link
Contributor

Summary: This diff introduces sanity check on data alignment when creating buffer_data_sink. Also, for better control the raised error, we changed to use static function instead of constructor for constuction.

Differential Revision: D70190912

@Gasoonjia Gasoonjia requested a review from tarun292 as a code owner February 25, 2025 23:26
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 25, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit ee32958 with merge base f9dc6ef (image):
💚 Looks good so far! There are no failures yet. 💚

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

@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 Feb 25, 2025
@facebook-github-bot
Copy link
Contributor

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

Copy link
Contributor

@swolchok swolchok left a comment

Choose a reason for hiding this comment

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

seems reasonable

@Gasoonjia
Copy link
Contributor Author

@pytorchbot label "topic: not user facing"

Copy link
Contributor

@dbort dbort left a comment

Choose a reason for hiding this comment

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

This is a great change; a static factory is a much better way to handle creation in our exception-free system.

TEST_F(BufferDataSinkTest, StorageSizeCheck) {
Result<size_t> ret = data_sink_->get_storage_size();
Result<BufferDataSink> buffer_data_sink = BufferDataSink::create(buffer_);
ASSERT_EQ(buffer_data_sink.error(), Error::Ok);
Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be good to put this same ASSERT after all create calls in this file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! Making buffer_data_sink as a private variable in BufferDataSinkTest class, and putting ASSERT after creations, for better structure.

Gasoonjia added a commit to Gasoonjia/executorch-1 that referenced this pull request Feb 26, 2025
Summary:

This diff introduces sanity check on data alignment when creating buffer_data_sink. Also, for better control the raised error, we changed to use static function instead of constructor for constuction.

Reviewed By: swolchok

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

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

Gasoonjia added a commit to Gasoonjia/executorch-1 that referenced this pull request Feb 26, 2025
Summary:

This diff introduces sanity check on data alignment when creating buffer_data_sink. Also, for better control the raised error, we changed to use static function instead of constructor for constuction.

Reviewed By: swolchok

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

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

Summary:

This diff introduces sanity check on data alignment when creating buffer_data_sink. Also, for better control the raised error, we changed to use static function instead of constructor for constuction.

Reviewed By: swolchok

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

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

@facebook-github-bot facebook-github-bot merged commit 65432b1 into pytorch:main Feb 26, 2025
50 checks passed
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 topic: not user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants