Point ExecuTorch and AOTInductor at the real TORCH_CHECK - #21604
Point ExecuTorch and AOTInductor at the real TORCH_CHECK#21604t-ivan-gr wants to merge 1 commit into
Conversation
Summary: ## Why Clears the **multiple ODR violations** carried by any binary that links both ExecuTorch and libtorch. This is the diff that does it; the previous diff in the stack is the prerequisite refactor. ## How With `c10::Error` and `torchCheckFail()` now header-only, nothing needs `STANDALONE_TORCH_HEADER` any more. This removes it at both definers -- the ExecuTorch build config and AOTInductor's `cpp_builder` -- and deletes the second `TORCH_CHECK` expansion it selected. One expansion means one definition of every header-inline c10 function that uses `TORCH_CHECK`. Libtorch-independent consumers do not regress: they now get the real `c10::Error` with the real message, and simply no symbolized C++ stack unless a backtrace fetcher is installed. ## Behaviour change worth noting `TORCH_CHECK` in those builds now throws `c10::Error` instead of `std::runtime_error`. `c10::Error` derives from `std::exception`, *not* from `std::runtime_error`, so any `catch (const std::runtime_error&)` written around a `TORCH_CHECK` in a flag-setting build will stop catching and needs updating. Differential Revision: D114896618
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21604
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New Failures, 1 Cancelled Job, 1 Unrelated FailureAs of commit 3dd8c9a with merge base bfeeb05 ( NEW FAILURES - The following jobs have failed:
CANCELLED JOB - The following job was 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. |
|
@t-ivan-gr has exported this pull request. If you are a Meta employee, you can view the originating Diff in D114896618. |
This PR needs a
|
Summary:
Why
Clears the multiple ODR violations carried by any binary that links both
ExecuTorch and libtorch. This is the diff that does it; the previous diff in the
stack is the prerequisite refactor.
How
With
c10::ErrorandtorchCheckFail()now header-only, nothing needsSTANDALONE_TORCH_HEADERany more. This removes it at both definers -- theExecuTorch build config and AOTInductor's
cpp_builder-- and deletes the secondTORCH_CHECKexpansion it selected. One expansion means one definition of everyheader-inline c10 function that uses
TORCH_CHECK.Libtorch-independent consumers do not regress: they now get the real
c10::Errorwith the real message, and simply no symbolized C++ stack unless abacktrace fetcher is installed.
Behaviour change worth noting
TORCH_CHECKin those builds now throwsc10::Errorinstead ofstd::runtime_error.c10::Errorderives fromstd::exception, not fromstd::runtime_error, so anycatch (const std::runtime_error&)written arounda
TORCH_CHECKin a flag-setting build will stop catching and needs updating.Differential Revision: D114896618