Forum - VEDA - A CUDA-like API for hybrid programming

Jump to navigation Jump to search
Overview > Topics > Software/tools > VEDA - A CUDA-like API for hybrid programming
[#67]

The VEDA project is a "CUDA Driver-API and Runtime-API"-like programming interface, to make it easier to port existing CUDA, OpenCL and HIP applications to the SX-Aurora. It is based on AVEO.

As the SX-Aurora is not CUDA compatible, there are some differences.

  • The launch of kernels does not have any Grid/Block or Shared Memory information.
  • The usage of streams differs. In CUDA, these allow to overlap computations with memcopy operations. In VEDA we support two modes, either using all cores (through OMP) of the VE in one stream, or to utilize a single stream per core. * This needs to be selected when creating the context for a device.
  • VEDA allows allocating/freeing memory without synching the execution via vedaMemAllocAsync(...) and vedaMemFreeAsync(...).
  • VEDAdeviceptr need to be translated in the device code to C-pointers via vedaMemPtr(...) prior they can be used!
  • Mixing Host + Device code into a single file is not supported yet.

To assist in development, we provide an own CMake module path (/usr/local/ve/veda/cmake) that allows to enable the languages VEDA_C, VEDA_CXX and VEDA_Fortran. To allow CMake to distinguish between device and host code, all device files need to have *.vX file extensions, i.e., *.vc, *.vcpp, *.vc++, *.vf.

The VEDA CMake also allows to port existing CMake CPU applications to SX-Aurora without modifying the CMakeLists.txt or setting paths manually. For this use:

cmake -C /usr/local/ve/veda/cmake/InjectVE.cmake /path/to/src

to create your project.

Posted by NEC admin (administrator) on 24 June 2022 at 02:17.
Edited by NEC admin (administrator) on 24 June 2022 at 02:20.

A RPM is now available in the following yum repository:

[efextra]
name=Aurora TSUBASA EF Extra
baseurl=https://sx-aurora.com/repos/veos/ef_extra
gpgcheck=0
enabled=1

Currently, in order to allow for parallel installation of multiple versions, the VEDA RPM name carries also the version number. Install for example with:

sudo yum install veda-0.9.2
Posted by NEC admin (administrator) on 24 June 2022 at 02:24.

We released the new v0.10.0 of the VEDA project.

  • Support for NUMA mode. Each NUMA node is a separate VEDAdevice. You can use the function vedaDeviceDistance(A, B) to get the relation between two VE's: 0.0 = same device, 0.5 = same device but different NUMA node, 1.0 = different device.
  • Compatibility for NEC-MPI with VEO integration. ( https://www.hpc.nec/forums/topic?id=pgmcA8 )
    As mentioned in https://www.hpc.nec/documents/mpi/g2am01e-NEC_MPI_User_Guide_en/chap3.html#3.17 you need a HMEM pointer for the interoperability. For this you can use the function vedaMemGetHMEM to translate a VEDAdeviceptr to an HMEM pointer.
  • New strongly typed VEDAptr<typename>. The VEDAptr<typename> has several useful functions, i.e. you can directly get the associated device via vptr.device(). Further, you can directly use VEDAptr<typename> with the VEO-aware NEC MPI, i.e. mpi_recv(vptr, ...). It automatically converts the underlying VEDAdeviceptr into an HMEM pointer.
  • VEDA-SMI command. The command /usr/local/ve/veda/bin/veda-smi shows available VE's in your system, together with important hardware features and sensor readings. The command respects the VEDA_VISIBLE_DEVICES env var.

VEDA - A CUDA-like API for hybrid programming reply.png

You can install VEDA either through sudo yum install veda-0.10.0 or by compiling the source code:

git clone https://github.com/SX-Aurora/veda
mkdir veda/build
cd veda/build
cmake ../src
make
sudo make install
Posted by NEC admin (administrator) on 24 June 2022 at 03:12.
Edited by NEC admin (administrator) on 24 June 2022 at 06:04.