Skip to content

rocm-sdk: import-test shipped Python extensions + resolve abi3 vs Python <3.12 support #5701

@davidd-amd

Description

@davidd-amd

Decision (recorded)

We will not contort the product to accommodate a test-only dependency like rocisa. It remains a known sharp edge.

  • rocisa (_rocisa.abi3.so, nanobind STABLE_ABI → CPython 3.12+ only) ships in rocm-sdk-libraries but is test/codegen-only; it is not a supported runtime import for SDK consumers.
  • Python 3.10/3.11 are a hard requirement for the product, and abi3 cannot cover them. Rather than per-version builds or packaging changes for a test-only dep, we accept that rocisa is not importable on 3.10/3.11 and leave it as-is.
  • The [tensilelite] Re-apply test component config and fix PyTorch SDK test failure #5529 change — testSharedLibrariesLoad skipping .abi3.so / .cpython-* extensions — is the accepted accommodation. It stays.

Why this is acceptable here (and the boundary)

The skip + sharp-edge is tolerable only because rocisa is test-only. The leniency must NOT be read as license to ship unimportable extensions generally:

  • A runtime-required Python extension shipped to SDK consumers must be importable on all supported Pythons (3.10–3.14). For nanobind that means per-version builds (abi3 alone is 3.12+).
  • A test/build-only extension may either remain a documented sharp edge (rocisa) or be excluded from the version-agnostic runtime wheel (the pattern origami uses).

Remaining (small) work

  1. Document the sharp edge: note that rocisa is test/codegen-only and not importable on Python < 3.12; consumers must not depend on importing it at runtime on 3.10/3.11.
  2. Record the policy above (runtime extensions → per-version / import-testable on all supported Pythons; test-only → sharp edge or excluded) somewhere durable (packaging docs).
  3. The ctypes.CDLL skip in libraries_test.py stands; do not convert it into an importlib import for rocisa (that would force the declined product changes).

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    TODO

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions