Skip to content

Add unit tests to consolidate selective build APIs - #23176

Open
TejasweeSulekh wants to merge 1 commit into
pytorch:mainfrom
TejasweeSulekh:fix-issue-11921
Open

TejasweeSulekh wants to merge 1 commit into
pytorch:mainfrom
TejasweeSulekh:fix-issue-11921

Conversation

@TejasweeSulekh

@TejasweeSulekh TejasweeSulekh commented Sep 27, 2026 •

Copy link
Copy Markdown

Summary

This PR officially resolves the selective build API consolidation requested in the original issue.

The CMake and Python logic (gen_oplist.py) already support parsing --root_ops and --model_file_path simultaneously, naturally merging the resulting operator sets. However, this behavior was previously untested, leaving it vulnerable to regression. This PR adds the missing unit test test_gen_op_list_with_model_and_root_ops to officially lock in and prove this behavior.

Fixes #11921

Testing Plan

Manually verified that the new unit test correctly mocks the operator lists and asserts the merged set without throwing a mutual exclusivity error.

# Activated virtual environment
source .venv/bin/activate

# Ran the codegen test suite to verify the new test passes
pytest codegen/tools/test/test_gen_oplist.py

cc @larryliu0820 @GregoryComer @nil-is-all

@pytorch-bot

pytorch-bot Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⏳ 1 Pending, 1 Unrelated Failure

As of commit 7ba7fd5 with merge base 96c621d (image):

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.

@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 Sep 27, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@metascroy

Copy link
Copy Markdown
Contributor

cc @JacobSzwejbka for core runtime

@executorch-triage executorch-triage Bot added the community: contribution PRs coming from community (excluding hardware partners) label Sep 28, 2026
@TejasweeSulekh

Copy link
Copy Markdown
Author

Hey team,

It looks like the CI is failing across the board during the initial environment setup phase.

Specifically, install_requirements.py is failing to fetch torchao==0.18.0.dev20260729 (No matching distribution found).

My unit tests haven't been executed yet. Let me know once the dependencies are fixed on main and I will gladly rebase this branch

@nil-is-all

Copy link
Copy Markdown
Contributor

Hey team,

It looks like the CI is failing across the board during the initial environment setup phase.

Specifically, install_requirements.py is failing to fetch torchao==0.18.0.dev20260729 (No matching distribution found).

My unit tests haven't been executed yet. Let me know once the dependencies are fixed on main and I will gladly rebase this branch

Hi @TejasweeSulekh, we've just fixed the dependency issue. Please do rebase and give me a ping. I'll trigger CI tests again

@nil-is-all nil-is-all added the module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch label Sep 28, 2026
@TejasweeSulekh
TejasweeSulekh marked this pull request as draft September 29, 2026 18:09
@TejasweeSulekh
TejasweeSulekh marked this pull request as ready for review September 29, 2026 18:46
@TejasweeSulekh

Copy link
Copy Markdown
Author

Hey @nil-is-all, I rebased the repo with the latest commit. From my end the following are working well:

## Basically the test being added here
pytest codegen/tools/test/test_gen_oplist.py 

## Testing the cxx side
bash ./test/run_oss_cpp_tests.sh

But this test is failing for some reason and I can't really be sure that this is because of the changes made in this PR.

## Testing EXIR side of the library
pytest exir/tests/ 

Where the error indicates:

RuntimeError: Missing out variants: {'quantized_decomposed::dequantize_per_tensor', 'quantized_decomposed::add'...}

Should I wait for this error to be fixed or is the current state of the PR acceptable?

@nil-is-all

Copy link
Copy Markdown
Contributor

Hey @nil-is-all, I rebased the repo with the latest commit. From my end the following are working well:

## Basically the test being added here
pytest codegen/tools/test/test_gen_oplist.py 

## Testing the cxx side
bash ./test/run_oss_cpp_tests.sh

But this test is failing for some reason and I can't really be sure that this is because of the changes made in this PR.

## Testing EXIR side of the library
pytest exir/tests/ 

Where the error indicates:

RuntimeError: Missing out variants: {'quantized_decomposed::dequantize_per_tensor', 'quantized_decomposed::add'...}

Should I wait for this error to be fixed or is the current state of the PR acceptable?

Thanks for the ping. I'll run the tests on my end and keep you posted on the error.

@TejasweeSulekh

Copy link
Copy Markdown
Author

Hey @nil-is-all, sorry, but there was lintrunner formatting issue. I fixed it and updated the PR. Whenever convenient can you please start the CI tests?

This branch has not been deployed

No deployments
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. community: contribution PRs coming from community (excluding hardware partners) module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidation of Selective Build APIs for OSS

3 participants