Repository navigation
[ONNX] Use ASCII markers for export progress output - #199522
Mohit-25-tech wants to merge 3 commits into
Conversation
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/199522
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 2fa2e4c with merge base 2a741c2 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
|
@justinchuby Could you please approve the pending CI workflows for this PR when you have a chance? The ci/inductor and ci/torchtitan workflows are currently waiting for maintainer approval. Thanks! |
|
@pytorchbot merge |
|
This PR needs to be approved by an authorized maintainer before merge. |
|
@pytorchbot merge -i |
|
This PR needs to be approved by an authorized maintainer before merge. |
|
I investigated the two failing Inductor/AOTI checks. Both failures occur in generated C++/FileCheck paths that do not invoke the ONNX exporter code changed by this PR. No workflow, build configuration, or shared ONNX utility was changed. I therefore left the PR unchanged. |
The Auto PR Triage ownership step still runs on Sonnet 4.6, while the other Claude triage workflows (claude-issue-triage-run.yml, claude-distributed-triage.yml) already moved to `global.anthropic.claude-sonnet-5`. This switches the auto-pr-triage action to the same model. Motivation: a recent batch of re-triaged open source PRs (#199461, #199497, #199513, #199522, #199537) all ended in `bot-triage-error` because the Sonnet 4.6 ownership run failed. Mostly it quoted diff excerpts that are not verbatim in the patch, which `validate_ownership.py` rejects. Once it returned no `structured_output` for `--json-schema`. Other flags (`--effort low`, `--json-schema`, the turn and budget caps) are supported unchanged on Sonnet 5. Test Plan: The workflow runs on `pull_request_target`, so it executes from the base branch and this change only takes effect after it lands. The Bedrock model ID is the one the issue triage workflows already use in production: ``` git grep -n "global.anthropic.claude-sonnet-5" -- .github ``` After landing, re-label a few of the PRs above (remove `bot-triage-error`, then remove and re-add `open source`) and check the Auto PR Triage runs. This PR was authored with the help of an AI assistant (Claude Code). Pull Request resolved: #199570 Approved by: https://github.com/janeyx99
|
Thanks |
|
@pytorchbot rebase -b main |
|
@pytorchbot started a rebase job onto refs/remotes/origin/main. Check the current status here |
The source-name cache removes definition scopes on DEDENT, which is absent for same-line bodies. Those names therefore leaked into subsequent source lines. Pop a definition after its logical newline when the next significant token is not INDENT, preserving the name on the declaration itself. Add coverage for one-line classes, functions, overloads and async functions, alongside nested scopes and multiline signatures with comments before the body. Fixes pytorch#199314 Test Plan: Used a prebuilt CPU nightly and loaded the modified parser into the installed package with the temporary run_funcname_tests.py bootstrap; no source build. ```powershell $env:TORCHINDUCTOR_WINDOWS_TESTS='1' .venv/Scripts/python.exe -I agent_space/run_funcname_tests.py test_misc.py MiscTests.test_funcname_cache MiscTests.test_funcname_cache_single_line -v .venv/Scripts/python.exe -I agent_space/run_funcname_tests.py test_logging.py -k trace_source -v .venv/Scripts/python.exe -I agent_space/run_funcname_tests.py test_logging.py -k trace_call -v .venv/Scripts/python.exe -I agent_space/check_funcname_scopes.py .venv/Scripts/python.exe -I agent_space/run_funcname_typecheck.py .venv/Scripts/python.exe -I agent_space/run_python_lint.py --fix git diff --check -- torch/_dynamo/funcname_cache.py test/dynamo/test_misc.py ``` The new regression passed and its snapshot failed against the original parser. Ten AST scope checks and the Module._call_impl reproduction passed. Five trace_source tests passed; the simple test hit a fallback because MSVC is absent. The existing funcname test is skipped on Windows; four trace_call tests require Python >=3.11 and were skipped on Python 3.10. Pyrefly reported zero errors. The seven selected Python linters passed via Spin's helper. A temporary wrapper normalized Windows extended paths for the unchanged official formatter. Prepared with assistance from Codex.
Co-authored-by: Copilot <[email protected]>
|
Successfully rebased |
fe4767a to
2fa2e4c
Compare
|
+1 |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: Could not find commit that was pushed before comment 5755903344 Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 0 checks: Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
## Summary Fixes pytorch#199501 The dynamo ONNX exporter uses Unicode check/cross markers (`✅` / `❌`) in fixed verbose progress messages. On terminals using a strict non-UTF-8 encoding such as `cp1252`, these characters cannot be encoded and can raise `UnicodeEncodeError`, causing an otherwise valid ONNX export to fail. This PR replaces the fixed Unicode progress markers with ASCII `[OK]` and `[FAIL]` markers. ## Changes - Replace fixed `✅` progress markers with `[OK]` - Replace fixed `❌` progress markers with `[FAIL]` - Apply the change consistently in: - `torch/onnx/_internal/exporter/_capture_strategies.py` - `torch/onnx/_internal/exporter/_core.py` - Add a regression test covering strict `cp1252` stdout through the public `torch.onnx.export(..., dynamo=True, verbose=True)` API. - Leave Unicode used in generated reports unchanged. ## Behavior The existing: - verbose behavior - progress messages - control flow - exception handling - failure behavior remain unchanged. Only the fixed progress markers are changed to ASCII-safe representations. ## Testing - `py_compile` on the edited files — passed - Strict `cp1252` stdout smoke test — passed - Scoped `git diff --check` — passed - Public ONNX exporter regression tests could not be executed locally because this source checkout lacks the generated PyTorch version/native `_C` build and required ONNX test dependencies. The regression test is designed to reproduce the encoding failure using a strict `cp1252` `TextIOWrapper`. Pull Request resolved: pytorch#199522 Approved by: https://github.com/titaiwangms, https://github.com/justinchuby Co-authored-by: Copilot <[email protected]>
## Summary Fixes pytorch#199501 The dynamo ONNX exporter uses Unicode check/cross markers (`✅` / `❌`) in fixed verbose progress messages. On terminals using a strict non-UTF-8 encoding such as `cp1252`, these characters cannot be encoded and can raise `UnicodeEncodeError`, causing an otherwise valid ONNX export to fail. This PR replaces the fixed Unicode progress markers with ASCII `[OK]` and `[FAIL]` markers. ## Changes - Replace fixed `✅` progress markers with `[OK]` - Replace fixed `❌` progress markers with `[FAIL]` - Apply the change consistently in: - `torch/onnx/_internal/exporter/_capture_strategies.py` - `torch/onnx/_internal/exporter/_core.py` - Add a regression test covering strict `cp1252` stdout through the public `torch.onnx.export(..., dynamo=True, verbose=True)` API. - Leave Unicode used in generated reports unchanged. ## Behavior The existing: - verbose behavior - progress messages - control flow - exception handling - failure behavior remain unchanged. Only the fixed progress markers are changed to ASCII-safe representations. ## Testing - `py_compile` on the edited files — passed - Strict `cp1252` stdout smoke test — passed - Scoped `git diff --check` — passed - Public ONNX exporter regression tests could not be executed locally because this source checkout lacks the generated PyTorch version/native `_C` build and required ONNX test dependencies. The regression test is designed to reproduce the encoding failure using a strict `cp1252` `TextIOWrapper`. Pull Request resolved: pytorch#199522 Approved by: https://github.com/titaiwangms, https://github.com/justinchuby Co-authored-by: Copilot <[email protected]>
Summary
Fixes #199501
The dynamo ONNX exporter uses Unicode check/cross markers (
✅/❌) infixed verbose progress messages.
On terminals using a strict non-UTF-8 encoding such as
cp1252, thesecharacters cannot be encoded and can raise
UnicodeEncodeError, causingan otherwise valid ONNX export to fail.
This PR replaces the fixed Unicode progress markers with ASCII
[OK]and[FAIL]markers.Changes
✅progress markers with[OK]❌progress markers with[FAIL]torch/onnx/_internal/exporter/_capture_strategies.pytorch/onnx/_internal/exporter/_core.pycp1252stdout through thepublic
torch.onnx.export(..., dynamo=True, verbose=True)API.Behavior
The existing:
remain unchanged. Only the fixed progress markers are changed to
ASCII-safe representations.
Testing
py_compileon the edited files — passedcp1252stdout smoke test — passedgit diff --check— passedbecause this source checkout lacks the generated PyTorch version/native
_Cbuild and required ONNX test dependencies.The regression test is designed to reproduce the encoding failure using
a strict
cp1252TextIOWrapper.cc @justinchuby @titaiwangms @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @chauhang @amjames @jataylo @azahed98