Skip to content

Conversation

jainapurva
Copy link
Contributor

@jainapurva jainapurva commented Oct 2, 2025

Update python to 3.10, as minimum supported version for pytorch2.9 onwards is python3.10

The following tests were failing and has been fixed as part of this PR:

  • test/quantization/pt2e/test_numeric_debugger.py::TestNumericDebuggerInfra::test_added_node_gets_unique_id
  • test/quantization/pt2e/test_numeric_debugger.py::TestNumericDebuggerInfra::test_copy_preserve_handle
  • test/quantization/pt2e/test_numeric_debugger.py::TestNumericDebuggerInfra::test_deepcopy_preserve_handle
  • test/quantization/pt2e/test_numeric_debugger.py::TestNumericDebuggerInfra::test_re_export_preserve_handle
  • test/quantization/pt2e/test_numeric_debugger.py::TestNumericDebuggerInfra::test_run_decompositions_map_handle_to_new_nodes
  • test/quantization/pt2e/test_numeric_debugger.py::TestNumericDebuggerInfra::test_run_decompositions_same_handle_id
  • test/quantization/pt2e/test_numeric_debugger.py::TestNumericDebuggerInfra::test_simple
  • test/quantization/pt2e/test_quantize_pt2e_qat.py::TestQuantizeMixQATAndPTQ::test_mixing_qat_ptq
  • test/quantization/pt2e/test_x86inductor_fusion.py::TestDynamicPatternMatcher::test_qconv2d_maxpool2d_linear_dynamic_cpu

Copy link

pytorch-bot bot commented Oct 2, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/3119

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 9 Pending

As of commit f95868a with merge base f64daac (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@jainapurva jainapurva requested a review from janeyx99 October 2, 2025 20:26
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 2, 2025
@jainapurva jainapurva requested a review from jerryzh168 October 2, 2025 20:26
@jainapurva jainapurva added the topic: for developers Use this tag if this PR is mainly developer facing label Oct 2, 2025
@jagadish-amd
Copy link

jagadish-amd commented Oct 3, 2025

Thanks for the PR.
This should fix [build / build-manywheel-py3_9-rocm7_0] --> should be py3_10
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch


@unittest.skip("Skipping due to AssertionError: Guard failed: x.size()[0] == 1")
def test_mixing_qat_ptq(self):
example_inputs = (torch.randn(2, 3, 4, 4),)
Copy link
Contributor

Choose a reason for hiding this comment

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

seems easy to resolve, here it uses 1 for batch size:

example_input = (torch.rand((1, in_channels)),)
, just need to align with it I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jerryzh168 I''m skipping it for now, as the fix is not stable, and this PR is important to test release. We can re-evaluate the fix in another PR.

return node_source

def _is_node_in_original_graph(node: Node) -> bool:
# Handle guard nodes that don't have from_node metadata in newer PyTorch versions
Copy link
Contributor

Choose a reason for hiding this comment

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

@tugsbayasgalan is this change expected? should we using non-strict mode or strict mode?

ep = torch.export.export(m, example_inputs, strict=True)

Choose a reason for hiding this comment

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

Yeah we made guard checking code as actual node in the graph so it makes sense this node doesn't have FROM_NODE. cc: @avikchaudhuri

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@avikchaudhuri What's the best way to update this check?

Copy link
Contributor

Choose a reason for hiding this comment

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

seems like the current update is OK

in_channels = child.linear1.weight.size(1)

example_input = (torch.rand((1, in_channels)),)
example_input = (torch.rand((2, 2, 2, in_channels)),)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jerryzh168 Updating shapes here works, and doesn't give the guard dim mismatch error

Copy link
Contributor

Choose a reason for hiding this comment

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

why does it change for 2d to 4d?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The input is 4d, hence converting it to 4d works

example_inputs = (torch.randn(2, 3, 4, 4),)

Copy link
Contributor

Choose a reason for hiding this comment

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

OK so the previous example_input is wrong, wondering why it works before

@jainapurva jainapurva merged commit fd62d0e into main Oct 9, 2025
18 of 26 checks passed
jainapurva added a commit that referenced this pull request Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: for developers Use this tag if this PR is mainly developer facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants