Repository navigation
Commit 939015a
authored
Add unit tests to consolidate selective build APIs (pytorch#23176)
### 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 pytorch#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.
```bash
# 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-all1 parent fc9a1c6 commit 939015a
1 file changed
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
258 | 294 | | |
259 | 295 | | |
260 | 296 | | |
| |||
0 commit comments