Skip to content

Move graph_builder and program_builder to executorch.backends.test (#18483)#18483

Open
hsharma35 wants to merge 2 commits intopytorch:mainfrom
hsharma35:export-D97995878
Open

Move graph_builder and program_builder to executorch.backends.test (#18483)#18483
hsharma35 wants to merge 2 commits intopytorch:mainfrom
hsharma35:export-D97995878

Conversation

@hsharma35
Copy link
Contributor

@hsharma35 hsharma35 commented Mar 24, 2026

Summary:

Move GraphBuilder and ProgramBuilder from executorch.backends.cadence.aot
to executorch.backends.test since they are general-purpose test utilities not
specific to the Cadence backend.

  • Created new canonical modules at executorch/backends/test/
  • Old modules now re-export from the new location for backward compatibility
  • Updated all 12 downstream consumers to import from the new path
  • Updated BUCK targets: new targets in backends/test/targets.bzl, old targets
    now depend on new ones

Differential Revision: D97995878

@hsharma35 hsharma35 requested a review from cccclai as a code owner March 24, 2026 23:53
@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/18483

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

✅ You can merge normally! (4 Unrelated Failures)

As of commit 851825d with merge base b9a6b84 (image):

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

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 D97995878.

@hsharma35 hsharma35 added the release notes: none Do not include this in the release notes label Mar 24, 2026
@meta-codesync meta-codesync bot changed the title Move graph_builder and program_builder to executorch.backends.test Move graph_builder and program_builder to executorch.backends.test (#18483) Mar 24, 2026
hsharma35 added a commit to hsharma35/executorch that referenced this pull request Mar 24, 2026
…ytorch#18483)

Summary:

Move `GraphBuilder` and `ProgramBuilder` from `executorch.backends.cadence.aot`
to `executorch.backends.test` since they are general-purpose test utilities not
specific to the Cadence backend.

- Created new canonical modules at `executorch/backends/test/`
- Old modules now re-export from the new location for backward compatibility
- Updated all 12 downstream consumers to import from the new path
- Updated BUCK targets: new targets in `backends/test/targets.bzl`, old targets
  now depend on new ones

Differential Revision: D97995878
hsharma35 added a commit to hsharma35/executorch that referenced this pull request Mar 25, 2026
…ytorch#18483)

Summary:
Pull Request resolved: pytorch#18483

Move `GraphBuilder` and `ProgramBuilder` from `executorch.backends.cadence.aot`
to `executorch.backends.test` since they are general-purpose test utilities not
specific to the Cadence backend.

- Created new canonical modules at `executorch/backends/test/`
- Old modules now re-export from the new location for backward compatibility
- Updated all 12 downstream consumers to import from the new path
- Updated BUCK targets: new targets in `backends/test/targets.bzl`, old targets
  now depend on new ones

Differential Revision: D97995878
…nt (M6)

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 25, 2026
…ytorch#18483)

Summary:

Move `GraphBuilder` and `ProgramBuilder` from `executorch.backends.cadence.aot`
to `executorch.backends.test` since they are general-purpose test utilities not
specific to the Cadence backend.

- Created new canonical modules at `executorch/backends/test/`
- Old modules now re-export from the new location for backward compatibility
- Updated all 12 downstream consumers to import from the new path
- Updated BUCK targets: new targets in `backends/test/targets.bzl`, old targets
  now depend on new ones

Differential Revision: D97995878
…ytorch#18483)

Summary:
Pull Request resolved: pytorch#18483

Move `GraphBuilder` and `ProgramBuilder` from `executorch.backends.cadence.aot`
to `executorch.backends.test` since they are general-purpose test utilities not
specific to the Cadence backend.

- Created new canonical modules at `executorch/backends/test/`
- Old modules now re-export from the new location for backward compatibility
- Updated all 12 downstream consumers to import from the new path
- Updated BUCK targets: new targets in `backends/test/targets.bzl`, old targets
  now depend on new ones

Differential Revision: D97995878
Copy link
Collaborator

@oscarandersson8218 oscarandersson8218 left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

2 participants