Skip to content

Conversation

@martinlsm
Copy link
Collaborator

@martinlsm martinlsm commented Jul 2, 2025

Refactor the main function of arm_executor_runner.cpp by extracting code that is related to initializing and running a model into two separate helper functions (runner_init and RunnerContext::run). A new struct called RunnerContext is introduced to store data/context required to run the model.

Test plan

The code is tested in the CI. It's a refactoring patch, so no new functionality added/removed.

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218

Refactor the main function of arm_executor_runner.cpp by extracting code
that is related to initializing and running a model into two separate
helper functions (runner_init and RunnerContext::run). A new struct
called RunnerContext is introduced to store data/context required to run
the model.

Change-Id: Iaca06d6f12b84644ce76e23e8881787a7971cdaa
@martinlsm martinlsm requested a review from zingo July 2, 2025 08:53
@martinlsm martinlsm requested a review from digantdesai as a code owner July 2, 2025 08:53
@pytorch-bot
Copy link

pytorch-bot bot commented Jul 2, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure, 5 Cancelled Jobs, 1 Unrelated Failure

As of commit 9c58427 with merge base bed504e (image):

NEW FAILURE - The following job has failed:

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

BROKEN TRUNK - The following job 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.

@facebook-github-bot facebook-github-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 Jul 2, 2025
@martinlsm
Copy link
Collaborator Author

@pytorchbot label ciflow/trunk

@martinlsm
Copy link
Collaborator Author

@pytorchbot label "partner: arm"

@pytorch-bot pytorch-bot bot added the partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm label Jul 2, 2025
@zingo
Copy link
Collaborator

zingo commented Jul 2, 2025

Fails are unrelated and fail on main also

@zingo zingo added the release notes: arm Changes to the ARM backend delegate label Jul 2, 2025
@zingo zingo merged commit 50070f4 into pytorch:main Jul 2, 2025
204 of 214 checks passed
metascroy added a commit that referenced this pull request Jul 2, 2025
metascroy added a commit that referenced this pull request Jul 2, 2025
BujSet pushed a commit to BujSet/executorch that referenced this pull request Jul 2, 2025
Refactor the main function of arm_executor_runner.cpp by extracting code
that is related to initializing and running a model into two separate
helper functions (runner_init and RunnerContext::run). A new struct
called RunnerContext is introduced to store data/context required to run
the model.

### Test plan
The code is tested in the CI. It's a refactoring patch, so no new
functionality added/removed.

Co-authored-by: Martin Lindström <[email protected]>
@zingo
Copy link
Collaborator

zingo commented Jul 3, 2025

What errors/problems did you see @metascroy ?


namespace {

/// Lightweight heapless container that constructs and stores a T in-place.
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use std::optional? this appears roughly equivalent, but I read it quickly and might've missed something

zingo pushed a commit that referenced this pull request Jul 7, 2025
…12197)

The PR #12162 got reverted with #12171. This PR is a resubmission of the
patch.

Refactor the main function of arm_executor_runner.cpp by extracting code
that is related to initializing and running a model into two separate
helper functions (runner_init and RunnerContext::run). A new struct
called RunnerContext is introduced to store data/context required to run
the model.

### Test plan
Arm's CI runs and tests the changed code.

Co-authored-by: Martin Lindström <[email protected]>
Tanish2101 pushed a commit to Tanish2101/executorch that referenced this pull request Jul 9, 2025
Refactor the main function of arm_executor_runner.cpp by extracting code
that is related to initializing and running a model into two separate
helper functions (runner_init and RunnerContext::run). A new struct
called RunnerContext is introduced to store data/context required to run
the model.

### Test plan
The code is tested in the CI. It's a refactoring patch, so no new
functionality added/removed.

Co-authored-by: Martin Lindström <[email protected]>
Tanish2101 pushed a commit to Tanish2101/executorch that referenced this pull request Jul 9, 2025
Tanish2101 pushed a commit to Tanish2101/executorch that referenced this pull request Jul 9, 2025
…ytorch#12197)

The PR pytorch#12162 got reverted with pytorch#12171. This PR is a resubmission of the
patch.

Refactor the main function of arm_executor_runner.cpp by extracting code
that is related to initializing and running a model into two separate
helper functions (runner_init and RunnerContext::run). A new struct
called RunnerContext is introduced to store data/context required to run
the model.

### Test plan
Arm's CI runs and tests the changed code.

Co-authored-by: Martin Lindström <[email protected]>
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: arm Changes to the ARM backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants