Set prefer_deferred_runtime_asserts_over_guards to True#165820
Set prefer_deferred_runtime_asserts_over_guards to True#165820justinchuby wants to merge 1 commit intopytorch:mainfrom
Conversation
Signed-off-by: Justin Chu <justinchu@microsoft.com>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/165820
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit a4361c1 with merge base 9095a9d ( FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| PREFER_DEFERRED_RUNTIME_ASSERTS_OVER_GUARDS: bool = _load_boolean_flag( | ||
| "TORCH_ONNX_PREFER_DEFERRED_RUNTIME_ASSERTS_OVER_GUARDS", | ||
| this_will="set prefer_deferred_runtime_asserts_over_guards when calling torch.export", | ||
| default=True, |
There was a problem hiding this comment.
I mean default by torch, it's False? I am wondering if we change the default, would it cause regression?
There was a problem hiding this comment.
True, the default in torch is False. If the arg does what it claims to do though it is just going to not enforce the guards during export but instead make them runtime asserts (which we ignore). I think that’s a reasonable thing to do. I propose that we at least try it and run the benchmarks.
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 2 checks: pull / linux-jammy-py3.13-clang12 / test (crossref, 1, 2, linux.2xlarge), pull / linux-jammy-py3.13-clang12 / test (dynamo_wrapped, 3, 3, linux.2xlarge) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Set prefer_deferred_runtime_asserts_over_guards to True and allow a flag to control the behavior, just in case.
This option has enable the gemma3 model export with transformers==4.57. I am not sure how best to test it though.
cc @titaiwangms