Skip to content

Fix CPU tests for python 3.12 #9443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix CPU tests for python 3.12 #9443

wants to merge 3 commits into from

Conversation

bhavya01
Copy link
Collaborator

@bhavya01 bhavya01 commented Jul 2, 2025

  • Remove py::bytes out of NoGil section as it is undefined behavior and causes segfault
  • Skip the torch test TestTensorDeviceOpsXLA as it doesn't run any tests and causes the whole test suite to fail

@bhavya01 bhavya01 changed the title Test CI Fix CPU tests for python 3.12 Jul 7, 2025
@bhavya01 bhavya01 marked this pull request as ready for review July 7, 2025 19:12
@bhavya01 bhavya01 requested review from zhanyong-wan and pgmoka July 7, 2025 19:12
Copy link
Collaborator

@zhanyong-wan zhanyong-wan left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -68,7 +68,6 @@
platform_machine = platform.machine()

base_dir = os.path.dirname(os.path.abspath(__file__))

Copy link
Collaborator

Choose a reason for hiding this comment

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

Revert?

@@ -123,7 +123,7 @@ function run_torch_op_tests {
run_test_without_functionalization "$_TEST_DIR/../../test/test_view_ops.py" "$@" -v TestViewOpsXLA
run_test "$_TEST_DIR/../../test/test_torch.py" "$@" -v TestTorchDeviceTypeXLA
run_dynamic "$_TEST_DIR/../../test/test_torch.py" "$@" -v TestDevicePrecisionXLA
run_test "$_TEST_DIR/../../test/test_torch.py" "$@" -v TestTensorDeviceOpsXLA
# run_test "$_TEST_DIR/../../test/test_torch.py" "$@" -v TestTensorDeviceOpsXLA
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why's this commented out?

XLAGraphExecutor::Get()->GetLiveTensors(&backend_device);
} else {
xtensors = GetXlaTensors(tensors, /*want_all=*/false);
bool emit_bytecode) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand why we should remove the py::bytes return type. The PR description says it's undefined behavior - how?

}
return py::bytes(
XLAGraphExecutor::Get()->DumpHloComputation(xtensors, mode));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the old behavior a bug? How was the bug introduced without being noticed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants