Skip to content

Promote pre-set spec.mem_id to AbsolutePlacementConstraint. (#18480)#18480

Open
hsharma35 wants to merge 1 commit intopytorch:mainfrom
hsharma35:export-D95413373
Open

Promote pre-set spec.mem_id to AbsolutePlacementConstraint. (#18480)#18480
hsharma35 wants to merge 1 commit intopytorch:mainfrom
hsharma35:export-D95413373

Conversation

@hsharma35
Copy link
Contributor

@hsharma35 hsharma35 commented Mar 24, 2026

Summary:

In plan_with_constraints(), specs that arrive with a pre-set mem_id (e.g.
planned-temporary alloc nodes whose spec.mem_id is pinned by the AOT pass)
are promoted to AbsolutePlacementConstraint before the solver runs. The
planner then assigns only the offset within that tier, leaving mem_id intact.

Specs that already have an explicit AbsolutePlacementConstraint are not
double-promoted — the existing constraint wins.

Adds test target test_memory_planning_algo with 5 regression tests:

  • unpinned spec placed freely in mem_id=1
  • pinned spec stays in the requested tier
  • two specs pinned to the same tier get non-overlapping offsets
  • unpinned peers of pinned specs are not forced into the pinned tier
  • an externally-set AbsolutePlacementConstraint overrides spec.mem_id

This is Milestone 6 of the planned-temporaries feature.

Differential Revision: D95413373

@pytorch-bot
Copy link

pytorch-bot bot commented Mar 24, 2026

🔗 Helpful Links

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

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

❌ 1 New Failure, 2 Unrelated Failures

As of commit 0deb43e with merge base a951e1b (image):

NEW FAILURE - The following job has failed:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 Mar 24, 2026
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Mar 24, 2026

@hsharma35 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95413373.

hsharma35 added a commit to hsharma35/executorch that referenced this pull request Mar 24, 2026
…18480)

Summary:

In plan_with_constraints(), specs that arrive with a pre-set mem_id (e.g.
planned-temporary alloc nodes whose spec.mem_id is pinned by the AOT pass)
are promoted to AbsolutePlacementConstraint before the solver runs.  The
planner then assigns only the offset within that tier, leaving mem_id intact.

Specs that already have an explicit AbsolutePlacementConstraint are not
double-promoted — the existing constraint wins.

Adds test target test_memory_planning_algo with 5 regression tests:
  - unpinned spec placed freely in mem_id=1
  - pinned spec stays in the requested tier
  - two specs pinned to the same tier get non-overlapping offsets
  - unpinned peers of pinned specs are not forced into the pinned tier
  - an externally-set AbsolutePlacementConstraint overrides spec.mem_id

Differential Revision: D95413373
hsharma35 added a commit to hsharma35/executorch that referenced this pull request Mar 24, 2026
…18480)

Summary:

In plan_with_constraints(), specs that arrive with a pre-set mem_id (e.g.
planned-temporary alloc nodes whose spec.mem_id is pinned by the AOT pass)
are promoted to AbsolutePlacementConstraint before the solver runs.  The
planner then assigns only the offset within that tier, leaving mem_id intact.

Specs that already have an explicit AbsolutePlacementConstraint are not
double-promoted — the existing constraint wins.

Adds test target test_memory_planning_algo with 5 regression tests:
  - unpinned spec placed freely in mem_id=1
  - pinned spec stays in the requested tier
  - two specs pinned to the same tier get non-overlapping offsets
  - unpinned peers of pinned specs are not forced into the pinned tier
  - an externally-set AbsolutePlacementConstraint overrides spec.mem_id

Differential Revision: D95413373
@meta-codesync meta-codesync bot changed the title Promote pre-set spec.mem_id to AbsolutePlacementConstraint. Promote pre-set spec.mem_id to AbsolutePlacementConstraint. (#18480) Mar 25, 2026
hsharma35 added a commit to hsharma35/executorch that referenced this pull request Mar 25, 2026
…18480)

Summary:

In plan_with_constraints(), specs that arrive with a pre-set mem_id (e.g.
planned-temporary alloc nodes whose spec.mem_id is pinned by the AOT pass)
are promoted to AbsolutePlacementConstraint before the solver runs.  The
planner then assigns only the offset within that tier, leaving mem_id intact.

Specs that already have an explicit AbsolutePlacementConstraint are not
double-promoted — the existing constraint wins.

Adds test target test_memory_planning_algo with 5 regression tests:
  - unpinned spec placed freely in mem_id=1
  - pinned spec stays in the requested tier
  - two specs pinned to the same tier get non-overlapping offsets
  - unpinned peers of pinned specs are not forced into the pinned tier
  - an externally-set AbsolutePlacementConstraint overrides spec.mem_id

Differential Revision: D95413373
hsharma35 added a commit to hsharma35/executorch that referenced this pull request Mar 25, 2026
…18480)

Summary:

In plan_with_constraints(), specs that arrive with a pre-set mem_id (e.g.
planned-temporary alloc nodes whose spec.mem_id is pinned by the AOT pass)
are promoted to AbsolutePlacementConstraint before the solver runs.  The
planner then assigns only the offset within that tier, leaving mem_id intact.

Specs that already have an explicit AbsolutePlacementConstraint are not
double-promoted — the existing constraint wins.

Adds test target test_memory_planning_algo with 5 regression tests:
  - unpinned spec placed freely in mem_id=1
  - pinned spec stays in the requested tier
  - two specs pinned to the same tier get non-overlapping offsets
  - unpinned peers of pinned specs are not forced into the pinned tier
  - an externally-set AbsolutePlacementConstraint overrides spec.mem_id

Differential Revision: D95413373
hsharma35 added a commit to hsharma35/executorch that referenced this pull request Mar 25, 2026
…18480)

Summary:

In plan_with_constraints(), specs that arrive with a pre-set mem_id (e.g.
planned-temporary alloc nodes whose spec.mem_id is pinned by the AOT pass)
are promoted to AbsolutePlacementConstraint before the solver runs.  The
planner then assigns only the offset within that tier, leaving mem_id intact.

Specs that already have an explicit AbsolutePlacementConstraint are not
double-promoted — the existing constraint wins.

Adds test target test_memory_planning_algo with 5 regression tests:
  - unpinned spec placed freely in mem_id=1
  - pinned spec stays in the requested tier
  - two specs pinned to the same tier get non-overlapping offsets
  - unpinned peers of pinned specs are not forced into the pinned tier
  - an externally-set AbsolutePlacementConstraint overrides spec.mem_id

Differential Revision: D95413373
@hsharma35 hsharma35 force-pushed the export-D95413373 branch 2 times, most recently from 5a4dec9 to 2ab5e79 Compare March 25, 2026 00:20
hsharma35 added a commit to hsharma35/executorch that referenced this pull request Mar 25, 2026
…18480)

Summary:
Pull Request resolved: pytorch#18480

In plan_with_constraints(), specs that arrive with a pre-set mem_id (e.g.
planned-temporary alloc nodes whose spec.mem_id is pinned by the AOT pass)
are promoted to AbsolutePlacementConstraint before the solver runs.  The
planner then assigns only the offset within that tier, leaving mem_id intact.

Specs that already have an explicit AbsolutePlacementConstraint are not
double-promoted — the existing constraint wins.

Adds test target test_memory_planning_algo with 5 regression tests:
  - unpinned spec placed freely in mem_id=1
  - pinned spec stays in the requested tier
  - two specs pinned to the same tier get non-overlapping offsets
  - unpinned peers of pinned specs are not forced into the pinned tier
  - an externally-set AbsolutePlacementConstraint overrides spec.mem_id

Differential Revision: D95413373
@meta-codesync meta-codesync bot changed the title Promote pre-set spec.mem_id to AbsolutePlacementConstraint. (#18480) Promote pre-set spec.mem_id to AbsolutePlacementConstraint. Mar 25, 2026
@hsharma35 hsharma35 added the release notes: none Do not include this in the release notes label Mar 25, 2026
@hsharma35 hsharma35 requested a review from skrtskrtfb March 25, 2026 19:35
@meta-codesync meta-codesync bot changed the title Promote pre-set spec.mem_id to AbsolutePlacementConstraint. Promote pre-set spec.mem_id to AbsolutePlacementConstraint. (#18480) Mar 25, 2026
hsharma35 added a commit to hsharma35/executorch that referenced this pull request Mar 25, 2026
…18480)

Summary:

In plan_with_constraints(), specs that arrive with a pre-set mem_id (e.g.
planned-temporary alloc nodes whose spec.mem_id is pinned by the AOT pass)
are promoted to AbsolutePlacementConstraint before the solver runs.  The
planner then assigns only the offset within that tier, leaving mem_id intact.

Specs that already have an explicit AbsolutePlacementConstraint are not
double-promoted — the existing constraint wins.

Adds test target test_memory_planning_algo with 5 regression tests:
  - unpinned spec placed freely in mem_id=1
  - pinned spec stays in the requested tier
  - two specs pinned to the same tier get non-overlapping offsets
  - unpinned peers of pinned specs are not forced into the pinned tier
  - an externally-set AbsolutePlacementConstraint overrides spec.mem_id

This is Milestone 6 of the planned-temporaries feature.

Differential Revision: D95413373
hsharma35 added a commit to hsharma35/executorch that referenced this pull request Mar 26, 2026
…18480)

Summary:

In plan_with_constraints(), specs that arrive with a pre-set mem_id (e.g.
planned-temporary alloc nodes whose spec.mem_id is pinned by the AOT pass)
are promoted to AbsolutePlacementConstraint before the solver runs.  The
planner then assigns only the offset within that tier, leaving mem_id intact.

Specs that already have an explicit AbsolutePlacementConstraint are not
double-promoted — the existing constraint wins.

Adds test target test_memory_planning_algo with 5 regression tests:
  - unpinned spec placed freely in mem_id=1
  - pinned spec stays in the requested tier
  - two specs pinned to the same tier get non-overlapping offsets
  - unpinned peers of pinned specs are not forced into the pinned tier
  - an externally-set AbsolutePlacementConstraint overrides spec.mem_id

This is Milestone 6 of the planned-temporaries feature.

Differential Revision: D95413373
…18480)

Summary:
Pull Request resolved: pytorch#18480

In plan_with_constraints(), specs that arrive with a pre-set mem_id (e.g.
planned-temporary alloc nodes whose spec.mem_id is pinned by the AOT pass)
are promoted to AbsolutePlacementConstraint before the solver runs.  The
planner then assigns only the offset within that tier, leaving mem_id intact.

Specs that already have an explicit AbsolutePlacementConstraint are not
double-promoted — the existing constraint wins.

Adds test target test_memory_planning_algo with 5 regression tests:
  - unpinned spec placed freely in mem_id=1
  - pinned spec stays in the requested tier
  - two specs pinned to the same tier get non-overlapping offsets
  - unpinned peers of pinned specs are not forced into the pinned tier
  - an externally-set AbsolutePlacementConstraint overrides spec.mem_id

This is Milestone 6 of the planned-temporaries feature.

Differential Revision: D95413373
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. fb-exported meta-exported 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