Skip to content

Commit 61248c9

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 8914edd commit 61248c9

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
@@ -708,75 +708,6 @@ static const std::string cpu_pipeline =
708708
"reconcile-unrealized-casts";
709709

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

838769
const std::string _passes(get_text_env("SHARPY_PASSES"));
839770
static const std::string &pass_pipeline =
840-
_passes != "" ? _passes
841-
: (useGPU() ? (useCUDA() ? cuda_pipeline : gpu_pipeline)
842-
: cpu_pipeline);
771+
_passes != "" ? _passes : (useGPU() ? gpu_pipeline : cpu_pipeline);
843772

844773
JIT::JIT(const std::string &libidtr)
845774
: _context(::mlir::MLIRContext::Threading::DISABLED), _pm(&_context),
@@ -902,13 +831,7 @@ JIT::JIT(const std::string &libidtr)
902831
if (!gpuxlibstr.empty()) {
903832
_gpulib = std::string(gpuxlibstr);
904833
} else {
905-
if (useCUDA()) {
906-
_gpulib = mlirRoot + "/lib/libmlir_cuda_runtime.so";
907-
} else {
908-
auto imexRoot = get_text_env("IMEXROOT");
909-
imexRoot = !imexRoot.empty() ? imexRoot : std::string(CMAKE_IMEX_ROOT);
910-
_gpulib = imexRoot + "/lib/liblevel-zero-runtime.so";
911-
}
834+
_gpulib = mlirRoot + "/lib/libmlir_cuda_runtime.so";
912835
if (!std::ifstream(_gpulib)) {
913836
throw std::runtime_error("Cannot find lib: " + _gpulib);
914837
}

0 commit comments

Comments
 (0)