Skip to content

[tensilelite] Skip Python C extensions in devel shared library load test - #5756

Merged
ScottTodd merged 2 commits into
mainfrom
users/aramalin/fix-rocisa-devel-test
Jun 15, 2026
Merged

ScottTodd merged 2 commits into
mainfrom
users/aramalin/fix-rocisa-devel-test

Conversation

@archana-ramalingam

Copy link
Copy Markdown
Contributor

Summary

Skip Python C extensions (.abi3.so, .cpython-*.so) in the devel_test.py shared library load test.

Technical details

Python C extensions use symbols resolved at import time by the interpreter, not via dlopen. ctypes.CDLL fails when the extension uses APIs unavailable in the test interpreter version — e.g. _rocisa.abi3.so uses nanobind's PyType_FromMetaclass which requires Python 3.12+, causing OSError: undefined symbol on Python 3.11.

This is a general fix: any .abi3.so or .cpython-*.so file should be tested via import, not ctypes.CDLL.

Fixes the regression introduced by #5529 (tensilelite test artifact install with ROCISA_USE_STABLE_ABI=ON).

Test plan

  • test_rocm_wheels.yml passes with rocm[devel] on Python 3.11

AIHPBLAS-3508

@ScottTodd ScottTodd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

@ScottTodd

Copy link
Copy Markdown
Member

I cherry-picked this commit onto #5731 for testing on CI

@ScottTodd

Copy link
Copy Markdown
Member

Looks like after a few build flakes, the relevant Linux tests are passing on https://github.com/ROCm/TheRock/actions/runs/27296784528/job/80687409265?pr=5731 now.

Python C extensions (.abi3.so, .cpython-*.so) use symbols resolved at
import time by the interpreter, not via dlopen. ctypes.CDLL fails when
the extension uses APIs unavailable in the test interpreter version
(e.g. nanobind's PyType_FromMetaclass requires Python 3.12+).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@archana-ramalingam
archana-ramalingam force-pushed the users/aramalin/fix-rocisa-devel-test branch from f9eb945 to 9f3ae19 Compare June 11, 2026 10:39
@ScottTodd

Copy link
Copy Markdown
Member

CI results look good enough on this PR. Shall we merge? I'd like to proceed with #5731 expanding our CI test coverage to Python 3.11 (and 3.10 actually, for another issue)

@archana-ramalingam

archana-ramalingam commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor Author

The hipcub test failure was fixed recently, so pulled in those changes to get the tests to pass.
All other failures are pre-existing.

@ScottTodd
ScottTodd merged commit 45d2d6b into main Jun 15, 2026
117 of 124 checks passed
@github-project-automation github-project-automation Bot moved this from TODO to Done in TheRock Triage Jun 15, 2026
@ScottTodd
ScottTodd deleted the users/aramalin/fix-rocisa-devel-test branch June 15, 2026 16:49

@marbre marbre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CI results look good enough on this PR. Shall we merge? I'd like to proceed with #5731 expanding our CI test coverage to Python 3.11 (and 3.10 actually, for another issue)

Since we landed the same to library_test.py ~2 weeks ago it should be fine to go ahead and merge.

if so_path.name.endswith(".abi3.so") or ".cpython-" in so_path.name:
# Python C extensions use symbols resolved at import time,
# not via dlopen — ctypes.CDLL fails across interpreter
# versions (e.g. .abi3.so using PyType_FromMetaclass on <3.12).
continue

@ScottTodd

Copy link
Copy Markdown
Member

Oh, merged right when you both commented 😅

@marbre

marbre commented Jun 15, 2026

Copy link
Copy Markdown
Member

Oh, merged right when you both commented 😅

I think that is fine 😉

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants