Skip to content

Conversation

@per
Copy link
Collaborator

@per per commented Jan 15, 2026

Summary

Add test for creating args of SymInt type to be able to use them in view_copy nodes together with the fix to make the test pass.

Test plan

Tested through CI tests.

cc @freddan80 @zingo @oscarandersson8218 @digantdesai

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 15, 2026

🔗 Helpful Links

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

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

✅ No Failures

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

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 Jan 15, 2026
@per per requested review from SS-JIA, lucylq, ydwu4 and zingo and removed request for JacobSzwejbka and larryliu0820 January 15, 2026 10:09
@per per added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk labels Jan 15, 2026
@zingo zingo added this to the 1.1.0 milestone Jan 15, 2026
Add test for creating args of SymInt type to be able to use them
in view_copy nodes in the Arm TOSA backend together with the
fix to make the pass work.

Signed-off-by: Per Åstrand <per.astrand@arm.com>
Change-Id: Ia947b8426af1b473df415a17e10f3db1582b84fd
@per per force-pushed the symint_handling_for_args branch from 00a24ad to f350cc2 Compare January 19, 2026 08:50
@zingo
Copy link
Collaborator

zingo commented Jan 19, 2026

Hi @SS-JIA / @metascroy this is touching files outside Arm code and need a review if possible

@per per added the release notes: none Do not include this in the release notes label Jan 20, 2026
if not hasattr(a, "constant") or a.constant is None:
raise ExportPassBaseError(f"Cannot add {a} to graph.")
a = a.constant
elif isinstance(a, torch.SymInt):
Copy link
Contributor

Choose a reason for hiding this comment

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

elif isinstance(a, (torch.SymInt, torch.SymFloat, torch.SymBool)):

and add corresponding unit test for symfloat and symbool please

thank you for finding this bug btw @per

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure how to trigger the SymFloat and SymBool paths here, since it comes from the dynamic shape export, which implies SymInts only, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry, the proposed tests doesn't trigger the bug, since the symbool/symfloat aren't part of a list argument (as the shape argument is in view_copy). The tests you linked to are properly handled already (scalars and tensors).
The only alternative I've come up with is to manually construct a symbol with a shape_env, but that feels like a really constructed way to trigger the bug:

        shape_env = ShapeEnv()
        sym_bool = shape_env.create_unbacked_symbool()
        tracer_owner = ExportPass()
        tracer = tracer_owner.tracer
        tracer.create_arg([sym_bool])

I've haven't been able to track down any operator that takes a list of bools or list of floats as argument, so IMHO it makes sense to keep the test as is, since that is what is exercised through the normal export flow. Or am I missing something?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good, thank you for explaining and walking me through the code

@SS-JIA
Copy link
Contributor

SS-JIA commented Jan 20, 2026

Other than Mergen's comment, LGTM 👍

@per per requested a review from mergennachin January 21, 2026 09:14
@per per merged commit 5dbbec3 into pytorch:main Jan 22, 2026
308 checks passed
@zingo
Copy link
Collaborator

zingo commented Jan 22, 2026

@pytorchbot cherry-pick --onto release/1.1 -c fixnewfeature

@pytorchbot
Copy link
Collaborator

Cherry picking #16620

The cherry pick PR is at #16774 and it is recommended to link a fixnewfeature cherry pick PR with an issue.

Details for Dev Infra team Raised by workflow job

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.

5 participants