Skip to content

Commit d4428cc

Browse files
committed
remove intel gpu pipeline
- setting SHARPY_DEVICE implies we are targeting nvidia gpu - IMEXROOT env variable is not used anymore
1 parent eb75cd4 commit d4428cc

File tree

2 files changed

+2
-81
lines changed

2 files changed

+2
-81
lines changed

src/include/sharpy/UtilsAndTypes.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,3 @@ inline bool useGPU() {
7070
auto device = get_text_env("SHARPY_DEVICE");
7171
return !(device.empty() || device == "host" || device == "cpu");
7272
}
73-
74-
inline bool useCUDA() { return get_bool_env("SHARPY_USE_CUDA"); }

src/jit/mlir.cpp

+2-79
Original file line numberDiff line numberDiff line change
@@ -706,75 +706,6 @@ static const std::string cpu_pipeline =
706706
"reconcile-unrealized-casts";
707707

708708
static const std::string gpu_pipeline =
709-
"add-gpu-regions,"
710-
"canonicalize,"
711-
"ndarray-dist,"
712-
"func.func(dist-coalesce),"
713-
"func.func(dist-infer-elementwise-cores),"
714-
"convert-dist-to-standard,"
715-
"canonicalize,"
716-
"overlap-comm-and-compute,"
717-
"add-comm-cache-keys,"
718-
"lower-distruntime-to-idtr,"
719-
"convert-ndarray-to-linalg,"
720-
"canonicalize,"
721-
"func.func(tosa-make-broadcastable),"
722-
"func.func(tosa-to-linalg),"
723-
"func.func(tosa-to-tensor),"
724-
"canonicalize,"
725-
"linalg-fuse-elementwise-ops,"
726-
"arith-expand,"
727-
"memref-expand,"
728-
"arith-bufferize,"
729-
"func-bufferize,"
730-
"func.func(empty-tensor-to-alloc-tensor),"
731-
"func.func(scf-bufferize),"
732-
"func.func(tensor-bufferize),"
733-
"func.func(bufferization-bufferize),"
734-
"func.func(linalg-bufferize),"
735-
"func.func(linalg-detensorize),"
736-
"func.func(tensor-bufferize),"
737-
"region-bufferize,"
738-
"canonicalize,"
739-
"func.func(finalizing-bufferize),"
740-
"imex-remove-temporaries,"
741-
"func.func(convert-linalg-to-parallel-loops),"
742-
"func.func(scf-parallel-loop-fusion),"
743-
// GPU
744-
"func.func(imex-add-outer-parallel-loop),"
745-
"func.func(gpu-map-parallel-loops),"
746-
"func.func(convert-parallel-loops-to-gpu),"
747-
// insert-gpu-allocs pass can have client-api = opencl or vulkan args
748-
"func.func(insert-gpu-allocs{in-regions=1}),"
749-
"drop-regions,"
750-
"canonicalize,"
751-
// "normalize-memrefs,"
752-
// "gpu-decompose-memrefs,"
753-
"func.func(lower-affine),"
754-
"gpu-kernel-outlining,"
755-
"canonicalize,"
756-
"cse,"
757-
// The following set-spirv-* passes can have client-api = opencl or vulkan
758-
// args
759-
"set-spirv-capabilities{client-api=opencl},"
760-
"gpu.module(set-spirv-abi-attrs{client-api=opencl}),"
761-
"canonicalize,"
762-
"fold-memref-alias-ops,"
763-
"imex-convert-gpu-to-spirv{enable-vc-intrinsic=1},"
764-
"spirv.module(spirv-lower-abi-attrs),"
765-
"spirv.module(spirv-update-vce),"
766-
// "func.func(llvm-request-c-wrappers),"
767-
"serialize-spirv,"
768-
"expand-strided-metadata,"
769-
"lower-affine,"
770-
"convert-gpu-to-gpux,"
771-
"convert-func-to-llvm,"
772-
"convert-math-to-llvm,"
773-
"convert-gpux-to-llvm,"
774-
"finalize-memref-to-llvm,"
775-
"reconcile-unrealized-casts";
776-
777-
static const std::string cuda_pipeline =
778709
"add-gpu-regions,"
779710
"canonicalize,"
780711
"ndarray-dist,"
@@ -835,9 +766,7 @@ static const std::string cuda_pipeline =
835766

836767
const std::string _passes(get_text_env("SHARPY_PASSES"));
837768
static const std::string &pass_pipeline =
838-
_passes != "" ? _passes
839-
: (useGPU() ? (useCUDA() ? cuda_pipeline : gpu_pipeline)
840-
: cpu_pipeline);
769+
_passes != "" ? _passes : (useGPU() ? gpu_pipeline : cpu_pipeline);
841770

842771
JIT::JIT(const std::string &libidtr)
843772
: _context(::mlir::MLIRContext::Threading::DISABLED), _pm(&_context),
@@ -900,13 +829,7 @@ JIT::JIT(const std::string &libidtr)
900829
if (!gpuxlibstr.empty()) {
901830
_gpulib = std::string(gpuxlibstr);
902831
} else {
903-
if (useCUDA()) {
904-
_gpulib = mlirRoot + "/lib/libmlir_cuda_runtime.so";
905-
} else {
906-
auto imexRoot = get_text_env("IMEXROOT");
907-
imexRoot = !imexRoot.empty() ? imexRoot : std::string(CMAKE_IMEX_ROOT);
908-
_gpulib = imexRoot + "/lib/liblevel-zero-runtime.so";
909-
}
832+
_gpulib = mlirRoot + "/lib/libmlir_cuda_runtime.so";
910833
if (!std::ifstream(_gpulib)) {
911834
throw std::runtime_error("Cannot find lib: " + _gpulib);
912835
}

0 commit comments

Comments
 (0)