SIGN IN SIGN UP

Don't absorb constant data unless explicitly tagged (#2424)

Summary:
Pull Request resolved: https://github.com/pytorch/executorch/pull/2424

As long as constant data is used as input to a partitioned graph, it will be absorbed by the partitioned edge program. Meaning all constant data would be moved from the owning program to the partitioned program.

Delegates owning data is not always a desired affect. Delegates should instead be able to choose whether or not they want to take ownership of the data by explicitly tagging the constant data nodes. If they are tagged, then transfer ownership to the delegate, if they are not tagged, then constant data will be owned by overarching edge_program and fed in as inputs to the delegate.

This changes enables this functionality. Note that delegates owning data now must be explicitly tagged. Delegates with partitioners which previously did not tag data will now have to do so in order to preserve their functionality.

Reviewed By: cccclai

Differential Revision: D54874255

fbshipit-source-id: bb14089333b5a77a0070087fe4b3770c646b9e8a
M
Max Ren committed
1255c4712a5af87673155cbca166c22877b944fb
Parent: df254ce
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 3/18/2024, 8:25:28 PM