Repository navigation
Protect files that ET depends on to be pinned to c++17 - #168204
JacobSzwejbka wants to merge 652 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/168204
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Cancelled Job, 83 PendingAs of commit 771fd25 with merge base e81262f ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
||
| #include <torch/headeronly/macros/Export.h> | ||
|
|
||
| #pragma clang diagnostic pop |
There was a problem hiding this comment.
how come you still need this when the files in headeronly already have the same directives surrounding them?
There was a problem hiding this comment.
I probably dont, but just being super careful in case someone comes along and changes the old header contents for some reason.
|
@JacobSzwejbka - Could you please change your diff title to say "C++17"? C17 is a C standard. |
|
@JacobSzwejbka - it may not be feasible, but using machinery from and then gating files with that way your code becomes self-documenting. If setting up the headers to make this happen is too much of a bother, the existing system will be fine. |
malfet
left a comment
There was a problem hiding this comment.
This feels like a wrong way to do it:
- One should use
C10_DIAGNOSTIC_XXXmacros - Headers can change, so a more reliable solution imo is to have a test that just compiles portions of the code with C++17
- We probably want to document somewhere what is allowed and what is not
Do you have an idea of a good spot? |
|
@r-barnes Happy to do EXECUTORCH_COMPATIBILITY_PUSH and update the deps. Does it matter where I define it? Can I just throw it in headeronl/macros/Macros.h or do you want me to make a new one? |
I have a few ideas, at the very least we can add it to some sort of a readme that talks about |
|
The most portable way is to use |
fwiw I dont want to restrict all of c10 to c++17. Only the parts ET needs. |
|
Ok talked with @malfet some and switched to just protecting them with CI and lints instead of pragmas in the files |
|
@JacobSzwejbka has imported this pull request. If you are a Meta employee, you can view this in D88078350. |
We shouldn't need this anymore as we have a registration for the op to have no effect Differential Revision: [D87680134](https://our.internmc.facebook.com/intern/diff/D87680134) Pull Request resolved: #168389 Approved by: https://github.com/zou3519 ghstack dependencies: #167364
PR removes the `msg` argument in `raise_observed_exception` and replace all users of it by the existing `args` one Pull Request resolved: #169343 Approved by: https://github.com/Lucaskabela
…ack.cpp (#169207)" This reverts commit bb30341. Reverted #169207 on behalf of https://github.com/huydhn due to Sorry to keep reverting this, but the issue is still there ([comment](#169207 (comment)))
This PR fixes torch.fx handling of the newer `|` type. Otherwise, they could be errors like
```
"/torch/package/importer.py", line 95, in get_name
name = obj.__name__
AttributeError: 'types.UnionType' object has no attribute '__name__'. Did you mean: '__ne__'?
```
Pull Request resolved: #169453
Approved by: https://github.com/albanD, https://github.com/malfet
This reverts commit bc39b2b. Reverted #169343 on behalf of https://github.com/huydhn due to It looks like there is a land race here failing lint ([comment](#169343 (comment)))
…#169043) # Motivation This PR aims to introduce `torch.xpu.memory.XPUPluggableAllocator` and focus on the frontend part. Meanwhile, we introduce an API `torch.xpu.memory.change_current_allocator` that used to change the current `XPUAllocator`. Both APIs has the CUDA counterpart. # Additional Context This API would be used in popular repos such as https://github.com/search?q=repo%3Avllm-project%2Fvllm%20cudapluggableallocator&type=code Pull Request resolved: #169043 Approved by: https://github.com/EikanWang, https://github.com/gujinghui, https://github.com/eellison ghstack dependencies: #168966
Summary: To fix failures like this on CI, ``` 2025-12-03T19:04:16.4264214Z ##[endgroup] 2025-12-03T19:04:16.8364369Z Traceback (most recent call last): 2025-12-03T19:04:16.8365336Z File "/usr/lib64/python3.9/runpy.py", line 197, in _run_module_as_main 2025-12-03T19:04:16.8366153Z return _run_code(code, main_globals, None, 2025-12-03T19:04:16.8366898Z File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code 2025-12-03T19:04:16.8368113Z exec(code, run_globals) 2025-12-03T19:04:16.8368891Z File "/home/ec2-user/actions-runner/_work/pytorch/pytorch/tools/stats/upload_utilization_stats/upload_utilization_stats.py", line 17, in <module> 2025-12-03T19:04:16.8369619Z from tools.stats.utilization_stats_lib import ( 2025-12-03T19:04:16.8370231Z File "/home/ec2-user/actions-runner/_work/pytorch/pytorch/tools/stats/utilization_stats_lib.py", line 13, in <module> 2025-12-03T19:04:16.8370807Z class UtilizationStats: 2025-12-03T19:04:16.8371390Z File "/home/ec2-user/actions-runner/_work/pytorch/pytorch/tools/stats/utilization_stats_lib.py", line 14, in UtilizationStats 2025-12-03T19:04:16.8371999Z avg: float | None = None 2025-12-03T19:04:16.8372353Z TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' ``` e.g. https://productionresultssa17.blob.core.windows.net/actions-results/e3792057-a4cd-4eaa-b759-317aa47a149b/workflow-job-run-9ddd4c2f-8892-5cca-89c2-e6d976902e9d/logs/job/job-logs.txt?rsct=text%2Fplain&se=2025-12-03T21%3A15%3A42Z&sig=gvBdBvL2Z6KRploHfvLZF07GZvwLvR7SvN%2FxM1Vo2Fw%3D&ske=2025-12-04T06%3A43%3A09Z&skoid=ca7593d4-ee42-46cd-af88-8b886a2f84eb&sks=b&skt=2025-12-03T18%3A43%3A09Z&sktid=398a6654-997b-47e9-b12b-9515b896b4de&skv=2025-11-05&sp=r&spr=https&sr=b&st=2025-12-03T21%3A05%3A37Z&sv=2025-11-05 Pull Request resolved: #169501 Approved by: https://github.com/malfet
This reverts commit a15066c. Reverted #169453 on behalf of https://github.com/pytorch-auto-revert due to Reverted automatically by pytorch's autorevert, to avoid this behaviour add the tag autorevert: disable ([comment](#169453 (comment)))
Summary: Fix #169118. A small named buffer can be optimized as inlined constant, but if that named buffer is mutated later on, AOTI can generate wrong code if not respecting the mutation information. This PR fixes the issue by recording mutated_named_buffers when unlifting the input graph and pass to Inductor graph lowering. Pull Request resolved: #169347 Approved by: https://github.com/yushangdi
|
Sorry everyone. pushed a bad commit which triggered a bunch of auto tagging |
Needed for #167822
ET is still pinned to c++17 and will remain that way for the forseeable future. We take a dep on these headers and pytorch/pytorch wants to bump to c++20. This is a pretty minimal way to avoid the issue recommended by @r-barnes
Added a unittest with the version restricted and then added a new linter that I manually tested by modifying the files to use a c++20 feature and verified it died.