-
Notifications
You must be signed in to change notification settings - Fork 769
[ESIMD] Enable esimd emulator build by default #5058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ESIMD] Enable esimd emulator build by default #5058
Conversation
- To be replaced at CM_EMU update
- Reducing overhead on command creation in specific case from PR#4841 - Same kernel launching flow for ESIMD_EMULATOR is in ExecCGCommand::enqueueImp() in commands.cpp
@@ -1324,6 +1360,7 @@ pi_result piEnqueueMemBufferReadRect(pi_queue, pi_mem, pi_bool, | |||
pi_result piEnqueueMemBufferWrite(pi_queue, pi_mem, pi_bool, size_t, size_t, | |||
const void *, pi_uint32, const pi_event *, | |||
pi_event *) { | |||
// TODO : intel/llvm_test_suite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this mean - "// TODO add a test to github.com/intel/llvm-test-suite"?
Please update if so. Even though I don't see much sense in such TODO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
@@ -1623,7 +1674,8 @@ pi_result piextDeviceSelectBinary(pi_device, pi_device_binary *, | |||
pi_result piextUSMEnqueuePrefetch(pi_queue, const void *, size_t, | |||
pi_usm_migration_flags, pi_uint32, | |||
const pi_event *, pi_event *) { | |||
DIE_NO_IMPLEMENTATION; | |||
// NOP for prefetch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain in the comment why NOP for prefetch is safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll replace it with TODO like above ones.
@@ -528,7 +538,7 @@ pi_result piDeviceGetInfo(pi_device Device, pi_device_info ParamName, | |||
case PI_DEVICE_INFO_VERSION: | |||
// CM_EMU release version from | |||
// https://github.com/intel/cm-cpu-emulation/releases | |||
return ReturnValue("1.0.7-CM_EMU"); | |||
return ReturnValue("1.0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should rather be a query into libcm. at least TODO should be added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll check if the version number can be retrieved from CM and apply it if possible.
And, please note that the device info version format should be 'X.Y'. It is required from one of tests in intel/llvm-test-suite.
@@ -2157,10 +2157,12 @@ cl_int ExecCGCommand::enqueueImp() { | |||
} else { | |||
assert(MQueue->getPlugin().getBackend() == | |||
backend::ext_intel_esimd_emulator); | |||
// Dims==0 for 'single_task() - void(void) type' | |||
uint32_t Dims = (Args.size() > 0) ? NDRDesc.Dims : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT, single_task is not supported. Should this cause DIE_NO_IMPLEMENTATION?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'single_task()' is widely used in intel/llvm-test-suite. ESIMD/SYCL/printf.cpp
uses 'single_task()'. I would like to make sure if it is going to be supported or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But your code implies it is not supported yet. So DIE_NO_IMPLEMENTATION should happen on attempt to use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DIE_NO_IMPLEMENTATION
is defined in sycl/plugins/esimd_emulator/pi_esimd_emulator.cpp
. Maybe execution attempts for single_task()
return PI_INVALID_WORK_DIMENSION
or PI_INVALID_KERNEL
(or some other error code ) here until it is supported?
Are we going to support single_task()
or not ESIMD?
Note on running SYCL kernels: |
If we convert BTW.
I believe we have avoided adding new invocations interface, could you please share a link to the line where it's defined if we have it? |
I'm not sure if #4937 will work for emulator, as device code does not go through SPIRV or even device compiler.
Looks like my IIRC is wrong. I see we use piEnqueueKernelLaunch. |
- As esimd_emulator is only for ESIMD kernels, PI_APIs causing failures for non-ESIMD kernels are not going to be implemented. 'TODO' comments are removed for such PI_APIs - CMakeLists change : installtion path fix for headers imported from CM
With this properties we could convert all attributes to properties, so they are known to the SYCL RT without compiler assistance. |
To get properties we need device binary. Device binary is not used with the ESIMD emulator, I believe. Should we at all require presence of device binary when running on host device (ESIMD emulator shares a lot with it) ? |
I'm referring to |
- Using version info fetched from calling 'CreateCmDevice'
How these would be propagated to SYCL runtime? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildbot/configure.py looks okay, but I have one question though: should we have a switch to disable ESIMD emulator build? I suppose it might be useful for developers not involved in ESIMD development.
And, - Argument sanity check failure revised for piDevicesGet - DeviceType condition check fix
- This PR is for clearing failures observed while merging intel/llvm PR enabling esimd_emulator support by default (intel/llvm#5058) - Another PR should be created for actively loading and testing 'esimd_emulator' backend
- This PR is for clearing failures observed while merging intel/llvm PR enabling esimd_emulator support by default (intel/llvm#5058) - Another PR should be created for actively loading and testing 'esimd_emulator' backend
@dongkyunahn-intel, @kbobrovs, what do you think about flipping the switch instead of removing it? |
Do other backend types have disabling option like you suggested? If not, I don't want to have it only for ESIMD emulator. |
HIP and CUDA backend builds are controlled by dedicated options. |
- Log-in suppression - 'cpu' to 'emu' (PR intel#4728)
Makes sense to me too. |
I am trying to build esimd_emulator locally and got the following error:
Does this build brings new dependency: libva-dev package to be installed on ? The problem was resolved locally after installing the package:
|
AFAIK, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildbot/configure.py changes look good to me.
We need someone from @intel/llvm-reviewers-runtime to approve.
It looks like required dependencies are not installed for "shared lib" build configuration - https://github.com/intel/llvm/runs/4872502344?check_suite_focus=true. |
@bader working on it |
- This PR is for clearing failures observed while merging intel/llvm PR enabling esimd_emulator support by default (intel#5058) - Another PR should be created for actively loading and testing 'esimd_emulator' backend
- This PR is for clearing failures observed while merging intel/llvm PR enabling esimd_emulator support by default (intel#5058) - Another PR should be created for actively loading and testing 'esimd_emulator' backend
This PR is to enable ESIMD_EMULATOR build by default.