Skip to content
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

Illegal instruction error with oneMKL mt2203 instruction #441

Open
ghost opened this issue Jan 23, 2024 · 16 comments
Open

Illegal instruction error with oneMKL mt2203 instruction #441

ghost opened this issue Jan 23, 2024 · 16 comments
Assignees

Comments

@ghost
Copy link

ghost commented Jan 23, 2024

Summary

MersenneTwisterGP11213 Sample migrated from CUDA fails on NVIDIA GPU with opensource oneMKL library - Illegal instruction (core dumped)

checkCudaErrors(DPCT_CHECK_ERROR(prngGPU = dpct::rng::create_host_rng(
                                       dpct::rng::random_engine_type::mt2203)));

Version

onemkl version - https://github.com/oneapi-src/oneMKL/releases/tag/v0.3

Environment

  • HW - Tesla P100-PCIE-12GB
  • OS name and version - Ubuntu* 22.04
  • Compiler version - clang version 18.0.0git (https://github.com/intel/llvm 3468f496c04ca9091da19ff5c73aa5f7ef792924)
  • output log -
./a.out Starting...

 Allocating data for 2400000 samples...
 Seeding with 777 ...

 Illegal instruction (core dumped)

Steps to reproduce

Code Repo - MersenneTwister
Compile command - clang++ -fsycl -fsycl-targets=nvptx64-nvidia-cuda MersenneTwister.cpp.dp.cpp -I../../../Common/ -I ../../../include/ -I -L -lonemkl_rng_curand -lonemkl

Observed behavior

Sample executes successfully with Intel oneMKL library on intel hardware(Gen9, Gen11)

Expected output

/a.out Starting...

Allocating data for 2400000 samples...
Seeding with 777 ...
Generating random numbers on GPU...


Reading back the results...
Shutting down...
@ghost
Copy link
Author

ghost commented Feb 2, 2024

Hi, Any update on this issue, can someone help with this ?

@ghost
Copy link
Author

ghost commented Feb 9, 2024

@aelizaro any update?

@aelizaro
Copy link
Contributor

aelizaro commented Feb 9, 2024

Hi, @Shwetha-Selma, sorry for the delayed responce, I missed this issue.

MT2203 generator is not yet available via oneMKL interfaces project, only via Intel oneMKL and so it can be used only on x86 CPUs and Intel's GPUs from the oneAPI package (however illegal instruction issue is a surprise, I can check it within dpct tool). In order to run on Tesla P100-PCIE-12GB, please, try another generator available in OneMKL Interfaces with cuRAND backend (Philox4x32x10 or mrg32k3a)

or if the point is the sample migration itself - you can build it with icpx compiler, link it against Intel oneMKL but it won't work on NVIDIA HW yet, you can validate it on x86 CPU:

icpx -fsycl -DMKL_ILP64 -I"${MKLROOT}/include MersenneTwister.cpp.dp.cpp -L${MKLROOT}/lib -lmkl_sycl_rng -lmkl_intel_ilp64 -lmkl_tbb_thread -lmkl_core -lsycl -lpthread -lm -ldl

@ghost
Copy link
Author

ghost commented Feb 12, 2024

Thanks @aelizaro for confirming MT2203 generator is not yet available for the NVIDIA backend. And It would be helpful if you check about the 'Illegal instruction' error.

Also Is there any plan to include support for MT2203 generator with open-source oneMKL?

@aelizaro
Copy link
Contributor

@Shwetha-Selma, yes, we plan to extend oneMKL Interfaces with more generators, the ones which are used in DPCT as the first priority, but no exact timeline yet.

@AvijitBag07
Copy link

Hi, any update for MT2203 support in oneMKL ??

@paveldyakov
Copy link

Hi @AvijitBag07, no updates yet.
Please let us know if it blocks your work - we can try to prioritize it

@AvijitBag07
Copy link

Yes it blocks our work, it will be beneficial if it is completed earlier.

@paveldyakov
Copy link

@AvijitBag07, got it, thank you for the feedback. We will increase priority for this engine

Just some clarification - we can introduce MT2203 in oneMKL Interfaces, but it won't support Nvidia backend. Is that fine for you?

@AvijitBag07
Copy link

No, we are looking for Nvidia Backend support only.

@paveldyakov
Copy link

cuRAND is the Nvidia backend in oneMKL Interfaces.
But cuRAND doesn't support MT2203 engine.

@AvijitBag07
Copy link

As oneMKL supports other RNG functions such as philox4x32x10<1> and mcg59<1> added for Nvidia backends, we also want MT2203 to be included

@paveldyakov
Copy link

@AvijitBag07, do you reference to Device RNG API?
If yes, we have a list of engines that is defined in oneMKL spec - https://github.com/uxlfoundation/oneAPI-spec/blob/main/source/elements/oneMKL/source/domains/rng/device_api/device-engines.rst

If you are interested in adding new engines to oneMKL Interfaces - please propose it for oneMKL spec

@AvijitBag07
Copy link

How Intel oneMKL supports MT2203 generator, you can add MT2203 generator too in oneMKL too

@paveldyakov
Copy link

Intel oneMKL supports MT2203 in Host API only (with x86 CPUs and Intel GPUs as the supported HW).

We can add support for MT2203 Host API into oneMKL Interfaces with Intel oneMKL backend. It means that it will have x86 CPUs and Intel GPUs supported HW. As there is no MT2203 in cuRAND - we cannot enable cuRAND as Nvidia backend for this generator.

@AvijitBag07
Copy link

We can link intel oneMKL lib and use it for intel GPU, but for Nvidia there is no option yet. It will be helpful if you can add it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants