Skip to content

Conversation

@lucylq
Copy link
Contributor

@lucylq lucylq commented Nov 20, 2025

Summary

Currently scales are only saved to PTE segments (not PTD file). Allow them to be added to PTD as well.

Test plan

Test with linear module quantized with torchao quantize_

@meta-cla meta-cla 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 Nov 20, 2025
ctypes.POINTER(ctypes.c_char * num_bytes),
).contents
scale_name = hashlib.sha256(bytes(scale_array)).hexdigest()
scale_name = "scale_" + scale_name
Copy link
Contributor Author

Choose a reason for hiding this comment

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

add this for debugging purposes

@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

)
sha256_hash = hashlib.sha256(bytes(array))
named_key = sha256_hash.hexdigest()
named_key = tensor.name + "_" + sha256_hash.hexdigest()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

also debugging here

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you plan on landing this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@metascroy yeah - adding the tensor name to the hash for general debuggability until we can use names instead of hash

@lucylq lucylq requested a review from GregoryComer November 20, 2025 19:33
@lucylq lucylq marked this pull request as ready for review November 20, 2025 19:44
@lucylq lucylq requested a review from digantdesai as a code owner November 20, 2025 19:44
@pytorch-bot
Copy link

pytorch-bot bot commented Nov 20, 2025

🔗 Helpful Links

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

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

❌ 2 New Failures

As of commit b56f3cf with merge base 92bf722 (image):

NEW FAILURES - The following jobs have failed:

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

@lucylq lucylq requested a review from metascroy November 20, 2025 21:33
@meta-codesync
Copy link

meta-codesync bot commented Nov 20, 2025

@lucylq has imported this pull request. If you are a Meta employee, you can view this in D87579688.

@meta-codesync meta-codesync bot merged commit e570942 into main Nov 21, 2025
172 of 175 checks passed
@meta-codesync meta-codesync bot deleted the lfq.tag-scales branch November 21, 2025 18:56
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants