Repository navigation
Conversation
| option(GC_ENABLE_OPT "Build gc-opt" ${GC_ENABLE_TOOLS}) | ||
| option(GC_ENABLE_ZE "Build Level Zero GPU runtime" ON) | ||
| option(GC_ENABLE_ZE "Build Level Zero GPU runtime" ${GC_ENABLE_IGC_DEFAULT}) | ||
| option(GC_ENABLE_OCL "Build OpenCL source GPU runtime" ON) |
There was a problem hiding this comment.
Should be OFF by default.
| @@ -0,0 +1,42 @@ | |||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |||
There was a problem hiding this comment.
I'd suggest a different design:
- Implement a new OclRuntime, that creates/launches kernels, built from source/spirv/binary.
- Use GpuCompiler.compile() for the module compilation. It compiles and links with the symbols from your runtime.
There was a problem hiding this comment.
Thanks for the feedback!
- Replaced OclSourceModule with OclRuntime, which creates and launches kernels from OpenCL source, SPIR-V or native binaries
- Module compilation now goes through GpuCompiler.compile(), which links the generated code against the runtime symbols
| MLIRUBDialect | ||
| MLIRVectorDialect | ||
| MLIRVectorTransforms | ||
| MLIRSPIRVDialect |
There was a problem hiding this comment.
SPIR-V code generation also in fact works with GC_ENABLE_OCL=OFF, so these dependencies should remain unconditional
There was a problem hiding this comment.
This adds new libs unconditionally, which increases the binary size. Have you checked the binary size with GC_ENABLE_OCL=OFF ? It should remain the same as before this PR. We have tight requirements for the bin size.
d43caa1 to
aafa515
Compare
|
@AndreyPavlenko could you please take a look? |
|
ping |
| MLIRUBDialect | ||
| MLIRVectorDialect | ||
| MLIRVectorTransforms | ||
| MLIRSPIRVDialect |
There was a problem hiding this comment.
This adds new libs unconditionally, which increases the binary size. Have you checked the binary size with GC_ENABLE_OCL=OFF ? It should remain the same as before this PR. We have tight requirements for the bin size.
| else if (name == "arith.remsi") binary("%"); | ||
| else if (name == "arith.divui" || name == "arith.remui") { | ||
| auto type = unsignedTypeName(op.getOperand(0).getType()); | ||
| expression = "(((" + type + ")" + operands[0] + |
There was a problem hiding this comment.
A closing parenthesis seems missing here.
| check(clEnqueueReadBuffer(impl->queue, source, CL_FALSE, 0, size, dst, | ||
| nDeps, deps, &event)); | ||
| else { | ||
| if (nDeps) check(clWaitForEvents(nDeps, deps)); |
There was a problem hiding this comment.
It holds the mutex and locks other threads.
|
|
||
| const DeviceInfo &OclRuntime::getDeviceInfo() const { return impl->info; } | ||
|
|
||
| OclRuntime::Memory *OclRuntime::importBuffer(cl_mem buffer) { |
There was a problem hiding this comment.
It looks like a memory leak. Do you really need it?
|
|
||
| class OclRuntime final : public GpuRuntime<OclKernel, _cl_event, _cl_mem> { |
There was a problem hiding this comment.
| class OclRuntime final : public GpuRuntime<OclKernel, _cl_event, _cl_mem> { | |
| struct OclMemory | |
| class OclRuntime final : public GpuRuntime<OclKernel, _cl_event, OclMemory> { |
If the runtime operates on OclMemory instead of _cl_mem, then you can save whatever you need in OclMemory and get rid of importBuffer().
|
@aobolensk thank you for your interest in our project, I have a few high-level questions and would appreciate some context on the work you're doing:
TLDR: I'm okay with the spirv-path in general (maybe we should name it somehow differently? technically our xegpu path also produces spirv), let's just try to separate it as much as possible from the existing pipeline if there are no plans to reuse parts from the existing one (e.g. avoid if-defs in the common code, try to place the new code into new libraries when possible, to avoid conditional dependencies in the existing targets), but I'm not really sure about the ocl-path |
| bool spirv{false}; | ||
| bool source{false}; |
There was a problem hiding this comment.
maybe a single 'enum target' field?
Support execution on other (non-Intel) GPUs
This is a prerequisite for support of non-Intel GPUs in OpenVINO GPU plugin via MLIR