Commit graph

13 commits

Author SHA1 Message Date
Stefan Gränitz
f7e133dfed
[lldb] Add Python cryptography package as new test dependency (#192434)
HTTPS tests for SymbolLocatorSymStore need the Python cryptography package
2026-04-30 12:30:15 +02:00
srcarroll
333f6abe30
Reland Support float8_e3m4 and float8_e4m3 in np_to_memref (#186453) (#186833)
This patch adds support for `float8_e3m4` and `float8_e4m3` in
`np_to_memref.py` by adding the appropriate ctypes structures.
Additionally changes minimum numpy version to 2.1.0 and uses a single
ml_dtypes version of 0.5.0.
2026-03-17 12:11:09 -05:00
Maksim Levental
3d7018c70b
[MLIR][Python] remove pybind11 support (#172581)
This PR removes pybind which has been deprecated for over a year
(https://github.com/llvm/llvm-project/pull/117922).
2025-12-19 09:51:22 -08:00
Aiden Grossman
eae817d26a
Reapply "[CI] Make premerge_advisor_explain write comments" (#167198)
This reverts commit c0e4bced61.

This was causing issues on older python versions. They are fixed in the
reland and have been tested as working.
2025-11-10 11:57:35 -08:00
Aiden Grossman
c0e4bced61 Revert "[CI] Make premerge_advisor_explain write comments"
This reverts commit 1f8d5d46df.

This was causing failures in some cases.

```
  + python /home/gha/actions-runner/_work/llvm-project/llvm-project/.ci/premerge_advisor_explain.py 1f8d5d46df 0 *** 167018 /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test-results.zst9icbo.xml /home/gha/actions-runner/_work/llvm-project/llvm-project/ninja.log
  Traceback (most recent call last):
    File "/home/gha/actions-runner/_work/llvm-project/llvm-project/.ci/premerge_advisor_explain.py", line 146, in <module>
      main(
    File "/home/gha/actions-runner/_work/llvm-project/llvm-project/.ci/premerge_advisor_explain.py", line 78, in main
      comment = get_comment(
                ^^^^^^^^^^^^
  TypeError: get_comment() missing 2 required positional arguments: 'pr_number' and 'body'
  Error: Process completed with exit code 1.
```

```
  Traceback (most recent call last):
    File "C:\_work\llvm-project\llvm-project\.ci\premerge_advisor_explain.py", line 23, in <module>
      def get_comment_id(platform: str, pr: github.PullRequest.PullRequest) -> int | None:
  TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
```
2025-11-07 21:21:21 +00:00
Aiden Grossman
1f8d5d46df
[CI] Make premerge_advisor_explain write comments
This patch makes the premerge advisor write out comments. This allows
for surfacing the findings of the advisor in a user-visible manner
beyond just dumping the output in the logs. Surfacing the information in
a comment also makes it much easier to discover compared to the Github
summary view.

Reviewers: dschuff, gburgessiv, Keenuts, DavidSpickett, lnihlen

Reviewed By: DavidSpickett

Pull Request: https://github.com/llvm/llvm-project/pull/166605
2025-11-07 12:31:37 -08:00
Maksim Levental
93097b2d47
Revert "[MLIR][Python] use FetchContent_Declare for nanobind and remove pybind (#161230)" (#162309)
This reverts commit 84a214856a.

This gives us more time to work out the alternative and also people to
migrate
2025-10-07 16:30:10 +00:00
Maksim Levental
84a214856a
[MLIR][Python] use FetchContent_Declare for nanobind and remove pybind (#161230)
Inspired by this comment
https://github.com/llvm/llvm-project/pull/157930#issuecomment-3346634290
(and long-standing issues related to finding nanobind/pybind in the
right place), this PR moves to using `FetchContent_Declare` to get the
nanobind dependency. This is pretty standard (see e.g.,
[IREE](cf60359b74/CMakeLists.txt (L842-L848))).
This PR also removes pybind which has been deprecated for almost a year
(https://github.com/llvm/llvm-project/pull/117922) and which isn't
compatible (for whatever reason) with `FetchContent_Declare`.

---------

Co-authored-by: Jacques Pienaar <jpienaar@google.com>
2025-10-06 17:17:04 +00:00
Maksim Levental
efd96afedf
[MLIR][Python] reland (narrower) type stub generation (#157930)
This a reland of https://github.com/llvm/llvm-project/pull/155741 which
was reverted at https://github.com/llvm/llvm-project/pull/157831. This
version is narrower in scope - it only turns on automatic stub
generation for `MLIRPythonExtension.Core._mlir` and **does not do
anything automatically**. Specifically, the only CMake code added to
`AddMLIRPython.cmake` is the `mlir_generate_type_stubs` function which
is then used only in a manual way. The API for
`mlir_generate_type_stubs` is:

```
Arguments:
  MODULE_NAME: The fully-qualified name of the extension module (used for importing in python).
  DEPENDS_TARGETS: List of targets these type stubs depend on being built; usually corresponding to the
    specific extension module (e.g., something like StandalonePythonModules.extension._standaloneDialectsNanobind.dso)
    and the core bindings extension module (e.g., something like StandalonePythonModules.extension._mlir.dso).
  OUTPUT_DIR: The root output directory to emit the type stubs into.
  OUTPUTS: List of expected outputs.
  DEPENDS_TARGET_SRC_DEPS: List of cpp sources for extension library (for generating a DEPFILE).
  IMPORT_PATHS: List of paths to add to PYTHONPATH for stubgen.
  PATTERN_FILE: (Optional) Pattern file (see https://nanobind.readthedocs.io/en/latest/typing.html#pattern-files).
Outputs:
  NB_STUBGEN_CUSTOM_TARGET: The target corresponding to generation which other targets can depend on.
```

Downstream users should use `mlir_generate_type_stubs` in coordination
with `declare_mlir_python_sources` to turn on stub generation for their
own downstream dialect extensions and upstream dialect extensions if
they so choose. Standalone example shows an example.

Note, downstream will also need to set
`-DMLIR_PYTHON_PACKAGE_PREFIX=...` correctly for their bindings.
2025-09-20 18:47:32 +00:00
Oleksandr "Alex" Zinenko
0a83e96f66
Revert stubgen-related patches (#157831)
Despite several hotfixes, things remain broken, in particular:

- installation/distribution (`ninja install / install-distribution`);
- downstream projects with bindings exposed.

See
https://github.com/llvm/llvm-project/pull/157583#issuecomment-3274164357
for more details.

Reverts #155741, #157583, #157697. Let's make sure things are fixed and
re-land as a unit.
2025-09-10 12:35:38 +01:00
Maksim Levental
22c2e15408
[MLIR][Python] enable type stub auto-generation (#155741)
This PR turns on automatic type stub generation (rather than relying on
hand-written/updated stubs). It uses nanobind's [stubgen
facility](https://nanobind.readthedocs.io/en/latest/typing.html#stub-generation).
If you would like to enable this functionality you can add
`GENERATE_TYPE_STUBS` to `declare_mlir_python_extension` .
2025-09-05 16:38:00 +00:00
Aiden Grossman
f6e4752e17
[CI] Add a script to cache lit test timing files (#155698)
This patch adds a new script with the ability to upload/download
.lit_test_times.txt files to ensure tests are run in a reasonably
optimal order.

The plan is to integrate this into the workflows in follow-up PRs.
2025-08-27 16:35:44 -07:00
Aiden Grossman
e4feb2d5ca
[CI] Hash pin CI python deps (#137489)
The CI scripts install some python dependencies primarily for testing
this patch moves these over to a single requirements file that also hash
pins everything using pip-compile to conform to best security and
reproducibility practices.
2025-04-27 08:21:20 -07:00