Skip to content

Add Python bindings for PaRSEC (py-parsec) - #765

Draft
AddiThurston wants to merge 1 commit into
ICLDisco:masterfrom
AddiThurston:python-bindings
Draft

Add Python bindings for PaRSEC (py-parsec)#765
AddiThurston wants to merge 1 commit into
ICLDisco:masterfrom
AddiThurston:python-bindings

Conversation

@AddiThurston

Copy link
Copy Markdown

Cython-based Python bindings exposing PaRSEC's Dynamic Task Discovery (DTD) and tiled matrix APIs to Python. Includes:

  • py_parsec package: core, dtd, matrix, runtime, and tasks modules with both .pyx (Cython) and .py (ctypes) implementations
  • Build system: setuptools-based build with pyproject.toml, integrated into CMakeLists.txt via optional PARSEC_PYTHON_BINDINGS flag
  • Examples: stencil_1D, DTD GEMM, merge sort, redistribute (DTD & PTG)
  • Tests: installation verification, DGEMM DTD accuracy, stencil 1D accuracy with pytest fixtures and MPI support
  • Stencil test utilities: result printing and element access helpers in the C stencil test for cross-validation with Python implementation

Made-with: Cursor
Signed-off-by Addison Thurston on behalf of SLU's Omni Computing Lab

Cython-based Python bindings exposing PaRSEC's Dynamic Task Discovery
(DTD) and tiled matrix APIs to Python. Includes:

- py_parsec package: core, dtd, matrix, runtime, and tasks modules
  with both .pyx (Cython) and .py (ctypes) implementations
- Build system: setuptools-based build with pyproject.toml, integrated
  into CMakeLists.txt via optional PARSEC_PYTHON_BINDINGS flag
- Examples: stencil_1D, DTD GEMM, merge sort, redistribute (DTD & PTG)
- Tests: installation verification, DGEMM DTD accuracy, stencil 1D
  accuracy with pytest fixtures and MPI support
- Stencil test utilities: result printing and element access helpers
  in the C stencil test for cross-validation with Python implementation

Made-with: Cursor

@bosilca bosilca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A quick review that was pending for a long time. I will take another stab at this later today.

# --- Matrix module (what you actually have today) ---
from .matrix import ParsecMatrixBlockCyclic

# 给你一个“名字兼容”,先别再导出 None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

english please.

PARSEC_MATRIX_TILE = 0


class ParsecDTDContext:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder why we need a specialized class for the DTDcontext ? I know we have a type for the dtd_taskpool, but I don't think it is in use anywhere. I would like to keep the clean design where all supported DSL work in the same context and taskpool space.

@@ -0,0 +1,69 @@
# Core PaRSEC functionality - Python wrapper

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All these do nothing. If the goal was to have them as fallback in case the Cython stubs are not build/loaded then they should include a guarded import.



# Utility functions
def parsec_dtd_unpack_args(task, *args):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These capabilities do not have equivalent in the cython file.

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