Skip to content

Memory planning: Remove side effects from greedy algorithm - #21616

Open
Erik-Lundell wants to merge 1 commit into
pytorch:mainfrom
Erik-Lundell:upstream-fix-memory-planning
Open

Memory planning: Remove side effects from greedy algorithm#21616
Erik-Lundell wants to merge 1 commit into
pytorch:mainfrom
Erik-Lundell:upstream-fix-memory-planning

Conversation

@Erik-Lundell

@Erik-Lundell Erik-Lundell commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

The result of a memory planning algorithm should be completely captured by the MemoryAlgoResult
object. The greedy algorithm additionally mutated
the TensorSpecs. This causes inference between
algorithm when running multiple ones, and is
an unclear division of responsibility.

Just apply alignment outside the algorithm.

Don't remove alignment args, to not change API of
algorithms, which is outwards-facing.

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani

The result of a memory planning algorithm should be
completely captured by the MemoryAlgoResult
object. The greedy algorithm additionally mutated
the TensorSpecs. This causes inference between
algorithm when running multiple ones, and is
an unclear division of responsibility.

Just apply alignment outside the algorithm.

Don't remove alignment args, to not change API of
algorithms, which is outwards-facing.

Signed-off-by: Erik Lundell <erik.lundell@arm.com>
Change-Id: I04ce2af0eff200ad0cc6aa2a583bcdd11b97b8ae
@pytorch-bot

pytorch-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 New Failure, 3 Cancelled Jobs, 1 Pending

As of commit ef481bd with merge base 4b4df96 (image):

NEW FAILURE - The following job has failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

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 Aug 6, 2026
@Erik-Lundell Erik-Lundell added ciflow/trunk release notes: none Do not include this in the release notes partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm labels Aug 6, 2026
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.

1 participant