Skip to content

[SYCL-MLIR] KernelFusion unable to perform internalization with KernelDisjointSpecialization #9188

Open
@whitneywhtsang

Description

@whitneywhtsang

In #9187, a number of KernelFusion test cases below are moved to xfail.

KernelFusion/abort_internalization.cpp
KernelFusion/barrier_local_internalization.cpp
KernelFusion/buffer_internalization.cpp
KernelFusion/diamond_shape.cpp
KernelFusion/internalize_array_wrapper.cpp
KernelFusion/internalize_deep.cpp
KernelFusion/internalize_multi_ptr.cpp
KernelFusion/internalize_vec.cpp
KernelFusion/internalize_vfunc.cpp
KernelFusion/jit_caching.cpp
KernelFusion/local_internalization.cpp
KernelFusion/private_internalization.cpp
KernelFusion/ranged_offset_accessor.cpp
KernelFusion/three_dimensional.cpp
KernelFusion/two_dimensional.cpp

When KernelDisjointSpecialization is added in the pipeline, it cause a number of KernelFusion test cases to fail.
For abort_internalization.cpp, it gives the error Failed to promote argument 0 of function fused_0: It is not safe to promote values appearing in a ptrtoint operation

In order for KernelFusion to be able to promote something from global memory to local or private memory, it must be sure that it is ok to do so for all uses of the global pointer. As ptrtoint followed by inttoptr would allow the pointer to "escape", i.e., it might not be able to find all its uses, it conservatively abort internalization (but not fusion) in that case. 

The relevant check is here: https://github.com/intel/llvm/blob/sycl/sycl-fusion/passes/internalization/Internalization.cpp#L256

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsycl-mlirPull requests or issues for sycl-mlir branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions