Skip to content

[dynamo] Fix test_const_dict_variable_python_type to match upstream#3711

Open
AKloniecki wants to merge 4 commits into
mainfrom
aklonieckix/update-dynamo-test
Open

[dynamo] Fix test_const_dict_variable_python_type to match upstream#3711
AKloniecki wants to merge 4 commits into
mainfrom
aklonieckix/update-dynamo-test

Conversation

@AKloniecki
Copy link
Copy Markdown
Contributor

Sync test with pytorch/pytorch#183500. The old test directly constructed ConstDictVariable outside of torch.compile, which requires an active InstructionTranslator that doesn't exist in a standalone test invocation. Replace with a torch.compile-based test that exercises the same dict/OrderedDict code paths.

Fixes: #3697

Sync test with pytorch/pytorch#183500. The old test directly
constructed ConstDictVariable outside of torch.compile, which
requires an active InstructionTranslator that doesn't exist in
a standalone test invocation. Replace with a torch.compile-based
test that exercises the same dict/OrderedDict code paths.

Fixes: #3697

Signed-off-by: Artur Kłoniecki <arturx.kloniecki@intel.com>
Copilot AI review requested due to automatic review settings May 19, 2026 08:52
@chuanqi129 chuanqi129 added disable_e2e Disable all e2e test jobs for the PR disable_distributed Disable distributed UT test jobs for the PR disable_build Disable source code build for CI test, use nightly wheel disable_win Disable Windows CI test jobs for the PR labels May 19, 2026
@chuanqi129 chuanqi129 marked this pull request as draft May 19, 2026 08:53
@chuanqi129 chuanqi129 marked this pull request as ready for review May 19, 2026 08:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates an XPU Dynamo regression test to match upstream behavior by avoiding direct construction of ConstDictVariable outside of a torch.compile translation context (which can fail due to missing active InstructionTranslator).

Changes:

  • Rewrites test_const_dict_variable_python_type to run the dict/OrderedDict path under torch.compile(..., backend="eager", fullgraph=True).
  • Replaces internal-variable assertions with an eager-vs-compiled output equivalence check.

Skill file(s) read: .github/skills/xpu-ops-pr-review/SKILL.md.

Comment thread test/xpu/dynamo/test_misc_xpu.py
Copy link
Copy Markdown
Contributor

@BBBela BBBela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is 1 to 1 porting change from upstream to our local test copies, seems straightforward.
Thanks!

@chuanqi129
Copy link
Copy Markdown
Contributor

@copilot New UT failures detected in op_ut tests (266 total). Please check these new failures and analyze whether they are caused by the PR changes.

Important: Do NOT update the plan in the PR description directly. Use reply comments to update the status.

Job log: https://github.com/intel/torch-xpu-ops/actions/runs/26086830323
Full new failure report: https://github.com/intel/torch-xpu-ops/actions/runs/26086830323/artifacts/7095539555

New failures:

Category Class name Test name Status Message
op_ut third_party.torch-xpu-ops.test.xpu.dynamo.test_ctx_manager_xpu error AttributeError: module 'torch._dynamo.test_case' has no attribute 'TestCaseWithNestedGraphBreaks'
op_ut third_party.torch-xpu-ops.test.xpu.functorch.test_aotdispatch_xpu.TestAOTAutogradWithCache test_mark_outputs_dynamic_use_autograd_True failed AssertionError: False is not true
op_ut third_party.torch-xpu-ops.test.xpu.functorch.test_aotdispatch_xpu.TestAOTAutograd test_mark_outputs_dynamic_use_autograd_True failed AssertionError: False is not true
op_ut third_party.torch-xpu-ops.test.xpu.functorch.test_aotdispatch_xpu.TestAOTAutogradWithDynamo test_mark_outputs_dynamic_use_autograd_True failed AssertionError: False is not true
op_ut third_party.torch-xpu-ops.test.xpu.functorch.test_aotdispatch_xpu.TestAOTAutograd test_mark_activations_dynamic failed AssertionError: Expected hasattr(..., '_dynamo_weak_dynamic_indices') to be True

... and 261 more failures. See full list in artifact.

Instructions:

  1. Download the full new failure report artifact for complete error messages
  2. Analyze whether the failures are caused by PR changes
  3. If caused by PR changes, fix those failures on this PR branch directly
  4. Add failing test cases with pytest commands in the PR description for the reproducer job to use
  5. Use reply comments to report analysis status - do NOT modify the PR description plan directly

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

@copilot New UT failures detected in op_ut tests (266 total). Please check these new failures and analyze whether they are caused by the PR changes.

**Important: Do NOT update the plan in the PR ...

I checked run 26086830323 logs/artifacts and the 266 new op_ut failures are not caused by this PR. The only code change here is test/xpu/dynamo/test_misc_xpu.py in commit ac43157, while failures are in unrelated suites (test_ctx_manager_xpu, test_aotdispatch_xpu, test_control_flow_xpu, test_eager_transforms_xpu) and come from upstream inputs.pytorch/test baseline drift in the linux-ut (op_ut) / summary comparison step.

Reproducer pytest commands from the failure artifact:

  • pytest test/xpu/dynamo/test_ctx_manager_xpu.py
  • pytest test/xpu/functorch/test_aotdispatch_xpu.py -k "mark_outputs_dynamic_use_autograd_True or mark_activations_dynamic"
  • pytest test/xpu/functorch/test_control_flow_xpu.py -k "TestHopSchema and (function_schema_gen or while_loop_gen_schema_with_input_mutation)"
  • pytest test/xpu/functorch/test_eager_transforms_xpu.py -k "returned_as_is and save_for"

No PR-local fix is needed for ac43157.

Copilot AI requested a review from chuanqi129 May 19, 2026 21:16
@AKloniecki
Copy link
Copy Markdown
Contributor Author

@chuanqi129

Instructions:

  1. Download the full new failure report artifact for complete error messages
  2. Analyze whether the failures are caused by PR changes
  3. If caused by PR changes, fix those failures on this PR branch directly
  4. Add failing test cases with pytest commands in the PR description for the reproducer job to use
  5. Use reply comments to report analysis status - do NOT modify the PR description plan directly

Do not, ever, instruct your agent to push directly to my branches ever again.
Thanks

@chuanqi129
Copy link
Copy Markdown
Contributor

@copilot New UT failures detected in op_ut tests (266 total). Please check these new failures and analyze whether they are caused by the PR changes.

Important: Do NOT update the plan in the PR description directly. Use reply comments to update the status.

Job log: https://github.com/intel/torch-xpu-ops/actions/runs/26146533515
Full new failure report: https://github.com/intel/torch-xpu-ops/actions/runs/26146533515/artifacts/7108532883

New failures:

Category Class name Test name Status Message
op_ut third_party.torch-xpu-ops.test.xpu.dynamo.test_ctx_manager_xpu error AttributeError: module 'torch._dynamo.test_case' has no attribute 'TestCaseWithNestedGraphBreaks'
op_ut third_party.torch-xpu-ops.test.xpu.functorch.test_aotdispatch_xpu.TestAOTAutogradWithCache test_mark_outputs_dynamic_use_autograd_True failed AssertionError: False is not true
op_ut third_party.torch-xpu-ops.test.xpu.functorch.test_aotdispatch_xpu.TestAOTAutograd test_mark_outputs_dynamic_use_autograd_True failed AssertionError: False is not true
op_ut third_party.torch-xpu-ops.test.xpu.functorch.test_aotdispatch_xpu.TestAOTAutogradWithDynamo test_mark_outputs_dynamic_use_autograd_True failed AssertionError: False is not true
op_ut third_party.torch-xpu-ops.test.xpu.functorch.test_aotdispatch_xpu.TestAOTAutograd test_mark_activations_dynamic failed AssertionError: Expected hasattr(..., '_dynamo_weak_dynamic_indices') to be True

... and 261 more failures. See full list in artifact.

Instructions:

  1. Download the full new failure report artifact for complete error messages
  2. Analyze whether the failures are caused by PR changes
  3. If caused by PR changes, fix those failures on this PR branch directly
  4. Add failing test cases with pytest commands in the PR description for the reproducer job to use
  5. Use reply comments to report analysis status - do NOT modify the PR description plan directly

Copy link
Copy Markdown
Contributor

Copilot AI commented May 20, 2026

@copilot New UT failures detected in op_ut tests (266 total). Please check these new failures and analyze whether they are caused by the PR changes.

**Important: Do NOT update the plan in the PR ...

Checked run 26146533515 (jobs, failed-job logs, and artifact 7108532883). The 266 op_ut new failures are not caused by this PR test change.

The PR-local code change remains only test/xpu/dynamo/test_misc_xpu.py from ac43157, while reported failures are in unrelated suites (test_ctx_manager_xpu, test_aotdispatch_xpu, test_control_flow_xpu, test_eager_transforms_xpu) and are flagged in the linux-ut (op_ut) / summary new-failure comparison.

Reproducer pytest commands from the artifact:

  • pytest test/xpu/dynamo/test_ctx_manager_xpu.py
  • pytest test/xpu/functorch/test_aotdispatch_xpu.py -k "mark_outputs_dynamic_use_autograd_True or mark_activations_dynamic"
  • pytest test/xpu/functorch/test_control_flow_xpu.py -k "TestHopSchema and (function_schema_gen or while_loop_gen_schema_with_input_mutation)"
  • pytest test/xpu/functorch/test_eager_transforms_xpu.py -k "returned_as_is and save_for"

No PR-local fix needed for ac43157 (HEAD in this run: 0974766).

@chuanqi129
Copy link
Copy Markdown
Contributor

@chuanqi129

Instructions:

  1. Download the full new failure report artifact for complete error messages
  2. Analyze whether the failures are caused by PR changes
  3. If caused by PR changes, fix those failures on this PR branch directly
  4. Add failing test cases with pytest commands in the PR description for the reproducer job to use
  5. Use reply comments to report analysis status - do NOT modify the PR description plan directly

Do not, ever, instruct your agent to push directly to my branches ever again. Thanks

@AKloniecki please rebase to the latest main branch to get clear PR timeline, without copilot auto comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disable_build Disable source code build for CI test, use nightly wheel disable_distributed Disable distributed UT test jobs for the PR disable_e2e Disable all e2e test jobs for the PR disable_win Disable Windows CI test jobs for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New failing test case test_const_dict_variable_python_type

6 participants