Skip to content

Llvm22 update#4334

Draft
atgeller wants to merge 176 commits intomainfrom
llvm22_update
Draft

Llvm22 update#4334
atgeller wants to merge 176 commits intomainfrom
llvm22_update

Conversation

@atgeller
Copy link
Copy Markdown
Collaborator

Just pushing this draft to have the new devdeps container generated

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Apr 15, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@atgeller
Copy link
Copy Markdown
Collaborator Author

atgeller commented Apr 15, 2026

/ok to test 04d0dbc

Command Bot: Processing...

boschmitt and others added 8 commits April 16, 2026 21:16
Comprehensive migration of the CUDA-Q C++ codebase from LLVM/MLIR 16
to LLVM/MLIR 22. Includes the LLVM submodule bump so this commit builds.

Key changes:
- Op creation: builder.create<Op>() -> Op::create(builder, ...)
- Opaque pointer migration: typed LLVM pointers -> !llvm.ptr
- Pass infrastructure: GEN_PASS_CLASSES -> per-pass GEN_PASS_DEF_*
- API renames: StringRef methods, dyn_cast_or_null, modifyOpInPlace
- CallByRefOp LLVM 22 interface requirements
- CUDAQ_ENABLE_REST=OFF build fixes
- All C++ test suites updated

See LLVM_MIGRATION_CHANGELOG.md for detailed documentation.

Co-authored-by: Alex McCaskey <amccaskey@nvidia.com>
Co-authored-by: boschmitt <7152025+boschmitt@users.noreply.github.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: boschmitt <7152025+boschmitt@users.noreply.github.com>
Migrate all CUDA-Q Python bindings to nanobind (required by MLIR 22)
and resolve cross-DSO LLVM Registry visibility issues.

Key changes:
- pybind11 -> nanobind across all py_*.cpp binding sources
- Cross-DSO registry bridge functions for QPU, ServerHelper, Executor
- nanobind-specific fixes: rv_policy, arg().none(), stl type casters
- Python-side MLIR 22 adjustments: PassManager.run(module.operation)
- Updated LLVM_MIGRATION_CHANGELOG.md sections 12.9-12.13

Co-authored-by: Alex McCaskey <amccaskey@nvidia.com>
Co-authored-by: boschmitt <7152025+boschmitt@users.noreply.github.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: boschmitt <7152025+boschmitt@users.noreply.github.com>
This breaks the compiler's dependency to the runtime library.

Signed-off-by: boschmitt <7152025+boschmitt@users.noreply.github.com>
Used nanobind 2.9.2 per mlir/python/requirements.txt.
Needed some explicit `py::arg("kwarg")` though most changes are from
clang-format.

Signed-off-by: Renaud Kauffmann <rkauffmann@nvidia.com>
Fixing build errors from llvm22 migration and formatting.

---------

Signed-off-by: Sachin Pisal <spisal@nvidia.com>
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
…VM 22.1)

Signed-off-by: Sachin Pisal <spisal@nvidia.com>
schweitzpgi and others added 7 commits April 17, 2026 01:09
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
behavior. Setting it to false through a reference changes that behavior
and has potential side-effects beyond the current node being traversed.
Back out these changes pending further investigation.

Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Signed-off-by: Sachin Pisal <spisal@nvidia.com>
Signed-off-by: Sachin Pisal <spisal@nvidia.com>
@sacpis
Copy link
Copy Markdown
Collaborator

sacpis commented Apr 17, 2026

/ok to test 29d712c

Command Bot: Processing...

atgeller and others added 10 commits April 17, 2026 11:31
Signed-off-by: Adam Geller <adgeller@nvidia.com>
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
@sacpis
Copy link
Copy Markdown
Collaborator

sacpis commented Apr 28, 2026

/ok to test fe904f2

Command Bot: Processing...

schweitzpgi and others added 5 commits April 28, 2026 14:38
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Signed-off-by: Sachin Pisal <spisal@nvidia.com>
Signed-off-by: Sachin Pisal <spisal@nvidia.com>
@sacpis
Copy link
Copy Markdown
Collaborator

sacpis commented Apr 28, 2026

/ok to test 4e5fa4e

Command Bot: Processing...

@sacpis
Copy link
Copy Markdown
Collaborator

sacpis commented Apr 28, 2026

/ok to test 0d95577

Command Bot: Processing...

sacpis added 2 commits April 28, 2026 23:23
Signed-off-by: Sachin Pisal <spisal@nvidia.com>
Signed-off-by: Sachin Pisal <spisal@nvidia.com>
@sacpis
Copy link
Copy Markdown
Collaborator

sacpis commented Apr 28, 2026

/ok to test 15e624e

Command Bot: Processing...

Signed-off-by: Sachin Pisal <spisal@nvidia.com>
@sacpis
Copy link
Copy Markdown
Collaborator

sacpis commented Apr 28, 2026

/ok to test cdd91b0

Command Bot: Processing...

Signed-off-by: Sachin Pisal <spisal@nvidia.com>
@sacpis
Copy link
Copy Markdown
Collaborator

sacpis commented Apr 29, 2026

/ok to test 16933f3

Command Bot: Processing...

Signed-off-by: Sachin Pisal <spisal@nvidia.com>
@sacpis
Copy link
Copy Markdown
Collaborator

sacpis commented Apr 29, 2026

/ok to test a7d3e0c

Command Bot: Processing...

sacpis added 2 commits April 29, 2026 03:23
Signed-off-by: Sachin Pisal <spisal@nvidia.com>
Signed-off-by: Sachin Pisal <spisal@nvidia.com>
@sacpis
Copy link
Copy Markdown
Collaborator

sacpis commented Apr 29, 2026

/ok to test 2ef336d

Command Bot: Processing...

Signed-off-by: Sachin Pisal <spisal@nvidia.com>
@sacpis
Copy link
Copy Markdown
Collaborator

sacpis commented Apr 29, 2026

/ok to test febe12c

Command Bot: Processing...

Signed-off-by: Sachin Pisal <spisal@nvidia.com>
@sacpis
Copy link
Copy Markdown
Collaborator

sacpis commented Apr 29, 2026

/ok to test 2253b7c

Command Bot: Processing...

Signed-off-by: Sachin Pisal <spisal@nvidia.com>
@sacpis
Copy link
Copy Markdown
Collaborator

sacpis commented Apr 29, 2026

/ok to test 789a3b5

Command Bot: Processing...

LLVM ERROR: can't create Attribute 'mlir::StringAttr' because storage
uniquer isn't initialized: the dialect was likely not loaded.

- Root cause
- `libcudaq-mlir-runtime.so` had its own TypeID copies on Linux.The
Apple-only CAPI-prepend block was never extended to Linux.
- Appended `$ORIGIN/../cudaq/mlir/_mlir_libs` (wheel/install layout) and
`$ORIGIN/../python/cudaq/mlir/_mlir_libs` (build tree) to the global
Linux `CMAKE_INSTALL_RPATH`
- Wheel build used BFD ld, not LLD, on Linux. `build_cudaq.sh` passes
`-DLLVM_USE_LINKER=lld` but scikit-build-core didn't. Under BFD, the
CAPI-prepend trick fails for `_quakeDialects.so`. Added a Linux-only
override in `pyproject.toml`, `pyproject.toml.cu12`,
`pyproject.toml.cu13`.

---------

Signed-off-by: Sachin Pisal <spisal@nvidia.com>
@sacpis
Copy link
Copy Markdown
Collaborator

sacpis commented Apr 29, 2026

/ok to test fbb5a2e

Command Bot: Processing...

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.

5 participants