History log of /llvm-project/mlir/lib/Dialect/GPU/Transforms/ModuleToBinary.cpp (Results 1 – 16 of 16)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6
# 72e8b9ae 17-Dec-2024 Mehdi Amini <joker.eph@gmail.com>

[MLIR] Add a BlobAttr interface for attribute to wrap arbitrary content and use it as linkLibs for ModuleToObject (#120116)

This change allows to expose through an interface attributes wrapping
cont

[MLIR] Add a BlobAttr interface for attribute to wrap arbitrary content and use it as linkLibs for ModuleToObject (#120116)

This change allows to expose through an interface attributes wrapping
content as external resources, and the usage inside the ModuleToObject
show how we will be able to provide runtime libraries without relying on
the filesystem.

show more ...


# 9919295c 16-Dec-2024 Renaud Kauffmann <rkauffmann@nvidia.com>

[mlir][gpu] Adding ELF section option to the gpu-module-to-binary pass (#119440)

This is a follow-up of #117246.

I thought then it would be easy to edit a DictionaryAttr but it turns
out that th

[mlir][gpu] Adding ELF section option to the gpu-module-to-binary pass (#119440)

This is a follow-up of #117246.

I thought then it would be easy to edit a DictionaryAttr but it turns
out that these attributes are immutable and need to be passed during the
construction of the gpu.binary Op.

The first commit was using the NVVMTargetAttr to pass the information.
After feedback from @fabianmcg, this PR now passes the information
through a new option of the gpu-module-to-binary pass.

Please add reviewers, as you see fit.

show more ...


Revision tags: llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4
# fd36a7b9 27-Aug-2024 Fabian Mora <fmora.dev@gmail.com>

[mlir][gpu] Pass GPU module to `TargetAttrInterface::createObject`. (#94910)

This patch adds an argument to `gpu::TargetAttrInterface::createObject`
to pass the GPU module. This is useful as `gpu::

[mlir][gpu] Pass GPU module to `TargetAttrInterface::createObject`. (#94910)

This patch adds an argument to `gpu::TargetAttrInterface::createObject`
to pass the GPU module. This is useful as `gpu::ObjectAttr` contains a
property dict for metadata, hence the module can be used for extracting
things like the symbol table and adding it to the property dict.

---------

Co-authored-by: Oleksandr "Alex" Zinenko <ftynse@gmail.com>

show more ...


Revision tags: llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# d7da0ae4 02-Jul-2024 Mehdi Amini <joker.eph@gmail.com>

[MLIR][NVVM] Reduce the scope of the LLVM_HAS_NVPTX_TARGET guard (#97349)

Most of the code here does not depend on the NVPTX target. In particular
the simple offload can just emit LLVM IR and we ca

[MLIR][NVVM] Reduce the scope of the LLVM_HAS_NVPTX_TARGET guard (#97349)

Most of the code here does not depend on the NVPTX target. In particular
the simple offload can just emit LLVM IR and we can use this without the
NVVM backend being built, which can be useful for a frontend that just
need to serialize the IR and leave it up to the runtime to JIT further.

show more ...


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7
# 8178a3ad 24-May-2024 tyb0807 <sontuan.vu119@gmail.com>

[mlir] Replace MLIR_ENABLE_CUDA_CONVERSIONS with LLVM_HAS_NVPTX_TARGET (#93008)

LLVM_HAS_NVPTX_TARGET is automatically set depending on whether NVPTX
was enabled when building LLVM. Use this instea

[mlir] Replace MLIR_ENABLE_CUDA_CONVERSIONS with LLVM_HAS_NVPTX_TARGET (#93008)

LLVM_HAS_NVPTX_TARGET is automatically set depending on whether NVPTX
was enabled when building LLVM. Use this instead of manually defining
MLIR_ENABLE_CUDA_CONVERSIONS (whose name is a bit misleading btw).

show more ...


Revision tags: llvmorg-18.1.6, llvmorg-18.1.5
# dc6ce608 28-Apr-2024 Fabian Mora <fmora.dev@gmail.com>

[mlir][gpu] Remove `offloadingHandler` from `ModuleToBinary` (#90368)

This patch removes the `offloadingHandler` option from the
`ModuleToBinary` pass. The option is removed as it cannot be parsed

[mlir][gpu] Remove `offloadingHandler` from `ModuleToBinary` (#90368)

This patch removes the `offloadingHandler` option from the
`ModuleToBinary` pass. The option is removed as it cannot be parsed from
textual form.

This fixes issue #90344.

show more ...


Revision tags: llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1
# f3be8427 05-Mar-2024 Ingo Müller <ingomueller@google.com>

[mlir] Expose MLIR_ROCM_CONVERSIONS_ENABLED in mlir-config.h. (#83977)

This is a follow up of #83004, which made the same change for
`MLIR_CUDA_CONVERSIONS_ENABLED`. As the previous PR, this PR com

[mlir] Expose MLIR_ROCM_CONVERSIONS_ENABLED in mlir-config.h. (#83977)

This is a follow up of #83004, which made the same change for
`MLIR_CUDA_CONVERSIONS_ENABLED`. As the previous PR, this PR commit
exposes mentioned CMake variable through `mlir-config.h` and uses the
macro that is introduced with the same name. This replaces the macro
`MLIR_ROCM_CONVERSIONS_ENABLED`, which the CMake files previously
defined manually.

show more ...


# 5f2097db 28-Feb-2024 Ingo Müller <ingomueller@google.com>

[mlir] Expose MLIR_CUDA_CONVERSIONS_ENABLED in mlir-config.h. (#83004)

That macro was not defined in some cases and thus yielded warnings if
compiled with `-Wundef`. In particular, they were not de

[mlir] Expose MLIR_CUDA_CONVERSIONS_ENABLED in mlir-config.h. (#83004)

That macro was not defined in some cases and thus yielded warnings if
compiled with `-Wundef`. In particular, they were not defined in the
BUILD files, so the GPU targets were broken when built with Bazel. This
commit exposes mentioned CMake variable through mlir-config.h and uses
the macro that is introduced with the same name. This replaces the macro
MLIR_CUDA_CONVERSIONS_ENABLED, which the CMake files previously defined
manually.

show more ...


Revision tags: llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init
# 5b4f2b90 15-Jan-2024 Fabian Mora <fmora.dev@gmail.com>

[mlir][gpu] Add an offloading handler attribute to `gpu.module` (#78047)

This patch adds an optional offloading handler attribute to
the`gpu.module` op. This attribute will be used during
`gpu-mod

[mlir][gpu] Add an offloading handler attribute to `gpu.module` (#78047)

This patch adds an optional offloading handler attribute to
the`gpu.module` op. This attribute will be used during
`gpu-module-to-binary` pass to override the offloading handler used in
the `gpu.binary` op.

show more ...


# 419c45a3 14-Dec-2023 Fabian Mora <fmora.dev@gmail.com>

[mlir][gpu] Fix crash in `gpu-module-to-binary` (#75477)

This patch fixes the error in issue #75434. The crash was being caused
by not checking for a lack of target attributes in a GPU module. It's

[mlir][gpu] Fix crash in `gpu-module-to-binary` (#75477)

This patch fixes the error in issue #75434. The crash was being caused
by not checking for a lack of target attributes in a GPU module. It's
now considered an error to invoke the pass with a GPU module with no
target attributes.

show more ...


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5
# 2dace045 05-Nov-2023 Sang Ik Lee <sang.ik.lee@intel.com>

[mlir][spirv] Implement gpu::TargetAttrInterface (#69949)

This commit implements gpu::TargetAttrInterface for SPIR-V target
attribute. The plan is to use this to enable GPU compilation pipeline
fo

[mlir][spirv] Implement gpu::TargetAttrInterface (#69949)

This commit implements gpu::TargetAttrInterface for SPIR-V target
attribute. The plan is to use this to enable GPU compilation pipeline
for OpenCL kernels later.

The changes do not impact Vulkan shaders using milr-vulkan-runner.
New GPU Dialect transform pass spirv-attach-target is implemented for
attaching attribute from CLI.

gpu-module-to-binary pass now works with GPU module that has SPIR-V
module with OpenCL kernel functions inside.

show more ...


Revision tags: llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0
# 5093413a 14-Sep-2023 Fabian Mora <fmora.dev@gmail.com>

[mlir][gpu][NVPTX] Enable NVIDIA GPU JIT compilation path (#66220)

This patch adds an NVPTX compilation path that enables JIT compilation
on NVIDIA targets. The following modifications were perform

[mlir][gpu][NVPTX] Enable NVIDIA GPU JIT compilation path (#66220)

This patch adds an NVPTX compilation path that enables JIT compilation
on NVIDIA targets. The following modifications were performed:
1. Adding a format field to the GPU object attribute, allowing the
translation attribute to use the correct runtime function to load the
module. Likewise, a dictionary attribute was added to add any possible
extra options.

2. Adding the `createObject` method to `GPUTargetAttrInterface`; this
method returns a GPU object from a binary string.

3. Adding the function `mgpuModuleLoadJIT`, which is only available for
NVIDIA GPUs, as there is no equivalent for AMD.

4. Adding the CMake flag `MLIR_GPU_COMPILATION_TEST_FORMAT` to specify
the format to use during testing.

show more ...


# 444abb39 09-Sep-2023 Fabian Mora <fmora.dev@gmail.com>

[mlir][gpu] Add a symbol table field to TargetOptions and adjust GpuModuleToBinary (#65797)

This patch adds the option of building an optional symbol table for the
top operation in the `gpu-module-

[mlir][gpu] Add a symbol table field to TargetOptions and adjust GpuModuleToBinary (#65797)

This patch adds the option of building an optional symbol table for the
top operation in the `gpu-module-to-binary` pass. The table is not
created by default as most targets don't need it; instead, it is lazily
built. The table is passed through a callback in `TargetOptions`.

This patch is required to integrate #65539 .

show more ...


# c16adb0d 07-Sep-2023 Fabian Mora <fmora.dev@gmail.com>

[mlir][Target][NVPTX] Add fatbin support to NVPTX compilation. (#65398)

Currently, the NVPTX tool compilation path only calls `ptxas`; thus, the
GPU running the binary must be an exact match of the

[mlir][Target][NVPTX] Add fatbin support to NVPTX compilation. (#65398)

Currently, the NVPTX tool compilation path only calls `ptxas`; thus, the
GPU running the binary must be an exact match of the arch of the target,
or else the runtime throws an error due to the arch mismatch.

This patch adds a call to `fatbinary`, creating a fat binary with the
cubin object and the PTX code, allowing the driver to JIT the PTX at
runtime if there's an arch mismatch.

show more ...


Revision tags: llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3
# 7c4e8c6a 22-Aug-2023 Nicolas Vasilache <nicolasvasilache@users.noreply.github.com>

[mlir] Disentangle dialect and extension registrations.

This revision avoids the registration of dialect extensions in Pass::getDependentDialects.

Such registration of extensions can be dangerous b

[mlir] Disentangle dialect and extension registrations.

This revision avoids the registration of dialect extensions in Pass::getDependentDialects.

Such registration of extensions can be dangerous because `DialectRegistry::isSubsetOf` is
always guaranteed to return false for extensions (i.e. there is no mechanism to track
whether a lambda is already in the list of already registered extensions).
When the context is already in a multi-threaded mode, this is guaranteed to assert.

Arguably a more structured registration mechanism for extensions with a unique ExtensionID
could be envisioned in the future.

In the process of cleaning this up, multiple usage inconsistencies surfaced around the
registration of translation extensions that this revision also cleans up.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D157703

show more ...


# 43752a2a 12-Aug-2023 Fabian Mora <fmora.dev@gmail.com>

[mlir][gpu] Add the `gpu-module-to-binary` pass.

**For an explanation of these patches see D154153.**

Commit message:
This pass converts GPU modules into GPU binaries, serializing all targets prese

[mlir][gpu] Add the `gpu-module-to-binary` pass.

**For an explanation of these patches see D154153.**

Commit message:
This pass converts GPU modules into GPU binaries, serializing all targets present
in a GPU module by invoking the `serializeToObject` target attribute method.

Depends on D154147

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D154149

show more ...