Skip to content

Conversation

@SaoirseARM
Copy link
Collaborator

@SaoirseARM SaoirseARM commented Oct 14, 2025

Summary

Adds support for sigmoid and tanh to arm backend for int16x8 support
Removes unnecessary test_sigmoid_16bit as these are now covered by test_sigmoid

cc @freddan80 @per @zingo @oscarandersson8218 @digantdesai

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 14, 2025

🔗 Helpful Links

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

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

❌ 3 New Failures

As of commit 007678f with merge base 1f114f1 (image):

NEW FAILURES - The following jobs have failed:

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

@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 Oct 14, 2025
@SaoirseARM
Copy link
Collaborator Author

@pytorchbot label ciflow/trunk

@SaoirseARM
Copy link
Collaborator Author

@pytorchbot label 'partner: arm'

@pytorch-bot pytorch-bot bot added the partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm label Oct 14, 2025
@SaoirseARM
Copy link
Collaborator Author

@pytorchbot label "release notes: none"

@pytorch-bot pytorch-bot bot added the release notes: none Do not include this in the release notes label Oct 14, 2025
@SaoirseARM SaoirseARM requested a review from zingo October 14, 2025 10:05
@Ninja91 Ninja91 self-requested a review October 14, 2025 16:23
Copy link
Contributor

@Ninja91 Ninja91 left a comment

Choose a reason for hiding this comment

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

Thanks for adding this support! Hopefully we will have full support in next few days.

quantizer.set_global(
get_symmetric_a16w8_quantization_config(is_per_channel=per_channel_quantization)
get_symmetric_a16w8_quantization_config(
is_per_channel=per_channel_quantization, epsilon=2**-16
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this change impact other ops?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for review!
There could be other Table operators that may need this change I will update those as I go through all operators. But, this change will not impact others as its stands because its only set in the unit tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's set in unit tests so that the sig/tanh can be partitioned to U55/U85, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As mentioned below, this is just to ensure we get the correct values on the output.
Thanks for review!

@common.XfailIfNoCorstone300
@pytest.mark.xfail(
reason="Vela compilation fails with 'Invalid arguments' for int16 sigmoid operations"
reason="MLETORCH-707: AssertionError: Output 0 does not match reference output."
Copy link
Contributor

Choose a reason for hiding this comment

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

This indicates we don't yet have full support for U55. Can you comment on what's remaining? cc: @3l1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is more so a limitation in terms of U55 support and not a int16x8 specific issue.
Thanks for review!

quantizer.set_global(
get_symmetric_a16w8_quantization_config(is_per_channel=per_channel_quantization)
get_symmetric_a16w8_quantization_config(
is_per_channel=per_channel_quantization, epsilon=2**-16
Copy link
Contributor

Choose a reason for hiding this comment

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

It's set in unit tests so that the sig/tanh can be partitioned to U55/U85, right?

is_dynamic: bool = False,
weight_qmin: int = -127,
weight_qmax: int = 127,
epsilon: float = 2**-12,
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok so in order for sig/tanh to be able to partition, we need to set this to 2**-16 right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It can be partitioned without it, this is more so for numerical behavior. If the set epsilon is too high, the quantization arguments can be inflated resulting in an incorrect output.
Thank you for review!

@mansnils mansnils merged commit a33e91f into pytorch:main Oct 17, 2025
287 of 290 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants