r/sycl • u/SeatChance3750 • Jun 30 '26
r/sycl • u/[deleted] • Jun 08 '17
Pro tip : when you want to research something about sycl on google, don't forget to put it in quotes : "sycl", you will get better results
r/sycl • u/checoiscool • 10d ago
I built an AI agent that ported Karpathy's llm.c GPT-2 trainer from CUDA to SYCL, so it runs on NVIDIA, AMD and CPUs (open source)
For Meta's Global AI Developer Hackathon I built Muse Port, an open-source tool that takes CUDA code (which only runs on NVIDIA GPUs) and ports it to SYCL, an open standard that runs on NVIDIA, AMD and regular CPUs.
How it works:
A scanner (no AI) inventories the repo: every kernel, every NVIDIA library call and its oneAPI equivalent, and the CUDA-only parts that need real redesign.
Meta's Muse model writes a migration plan, which gets checked against that scan.
An agent loop ports each piece: write, compile, verify.
A hidden check the model never sees decides whether a piece is done. Then the ports run on real NVIDIA GPUs against the original CUDA, and on AMD GPUs.
Results (all linked to committed evidence in the repo):
- llm.c's production bf16 trainer (12 files, 4,884 lines) ported in one run; it passes llm.c's own test on CPU, NVIDIA and AMD
- tuned in portable SYCL + oneMath (no NVIDIA-specific code) to 1.40-1.55x CUDA's time per training step on an L4 and RTX A4000
- 18 of 19 llm.c kernel files correct; llama2.cu ported for $0.45 with byte-identical output on CPU, NVIDIA and AMD
Limits: the one-run port worked 1 of 2 times, and the H100 is at 2.90x. Every failure is documented in the repo too.
Code: https://github.com/checocadena/museport
2-min demo: https://youtu.be/uBpT5IuxPOY
r/sycl • u/yunglevn • Sep 09 '25
Is there a tool to translate CUDA to SYCL source code?
Sorry, totally messed up the title. I was looking for the other direction!
I only figured out I can emit human-readable PTX from SYCL source, but I couldn't go further translating from SYCL to CUDA.
r/sycl • u/victotronics • Jan 09 '25
Why was the offset deprecated?
With an offset of 1 I can write
a[i] = b[i-1] + b[i] + b[i+1]
Now I need to write
a[i+1] = b[i-1] + b[i] + b[i+1]
which is much less nice as math goes. So why was the offset deprecated?
r/sycl • u/nikita-1298 • Apr 24 '25
SYCL-powered s/w development tools & optimizations for faster AI, real-time graphics & smarter HPC solutions
r/sycl • u/Sweet_Eggplant4659 • Aug 05 '25
Is llama.cpp sycl backend really worth it?
r/sycl • u/thekhronosgroup • Jun 04 '26
IWOCL 2026 Proceedings
The presentations and video recordings from IWOCL 2026 are now available on the conference program page.
Held May 6–8 in Heilbronn, Germany, IWOCL 2026 brought together researchers and practitioners advancing OpenCL, SYCL, and heterogeneous computing. This year's program covered portability across GPU vendors, AI and LLM inference on OpenCL backends, safety-critical GPU programming, exascale SYCL frameworks, and much more.
Highlights include the Outstanding Full Paper winner on AdaptiveCpp Portable CUDA, the Outstanding Short Paper on advancing OpenCL-based LLM inference in llama.cpp, and invited presentations from the Khronos OpenCL and SYCL Working Groups.
Browse the full program, slides, and recordings: https://www.iwocl.org/iwocl-2026/conference-program/
r/sycl • u/krypto1198 • Nov 30 '25
SYCL (AdaptiveCpp) Kernel hangs indefinitely with large kernel sizes (601x601)
Hi everyone,
I am working on a university project implementing a Non-Separable Gaussian Blur (the assignment explicitly requires a non-separable implementation, so I cannot switch to a separable approach) using SYCL. I am running on a Linux headless server using AdaptiveCpp as my compiler. The GPU is an Intel Arc A770.
I have implemented a standard brute-force 2D convolution kernel.
When I run the program with small or medium kernels (e.g., 31x31), the code works perfectly and produces the correct image.
However, when I test it with a large kernel size (specifically 601x601, which is required for a stress test assignment), the application hangs indefinitely at q.wait(). It never returns, no error is thrown, and I have to kill the process manually.
My Question: I haven't changed the logic or the memory management, only the kernel size variable.
Does anyone know what could be causing this hang only when the kernel size is large? And most importantly, does anyone know how to resolve this to make the kernel finish execution successfully?
Code Snippet:
// ... buffer setup ...
q.submit([&](handler& h) {
// ... accessors ...
h.parallel_for(range<2>(height, width), [=](id<2> idx) {
int y = idx[0];
int x = idx[1];
// ... clamping logic ...
for (int c = 0; c < channels; c++) {
float sum = 0.f;
// The heavy loop: 601 * 601 iterations
for (int ky = -radius; ky <= radius; ky++) {
for (int kx = -radius; kx <= radius; kx++) {
// ... index calculation ...
sum += acc_in[...] * acc_kernel[...];
}
}
acc_out[...] = sum;
}
});
});
q.wait(); // <--- THE PROGRAM HANGS HEREThanks in advance for your help!
r/sycl • u/Imma93 • Mar 20 '19
What's the difference in restrictions compared to C++ AMP?
I'm planning on using SYCL. Currently I'm using C++ AMP, so are there less restrictions compared to it? A list of C++ AMP restrictions can be found here.
r/sycl • u/rodburns • Oct 17 '19
SYCL Academy - Making it Easier to Teach and Learn SYCL
codeplay.comr/sycl • u/rodburns • Jul 29 '19
Intel's LLVM-Based SYCL Compiler Continues Taking Shape
r/sycl • u/rodburns • Aug 23 '18
Codeplay Announces World's First Fully-Conformant SYCL 1.2.1 Solution
codeplay.comr/sycl • u/Brief-Bookkeeper-523 • Aug 30 '24
std::visit in SYCL kernel yet?
I'm using the open source intel/LLVM sycl compiler on Linux and I have successfully worked with a sycl buffer of std::variant's on device code, but I have not been successful in using std::visit on a variant object in device code. In particular, if I try std::visit(visitor, vars); in kernel code, I get an error: SYCL kernel cannot use exceptions. I suppose this is because std::visit can throw a bad_variant_access, but what alternative to I have?
MWE-ish
#include <sycl/sycl.hpp>
#include <variant>
#include <vector>
class A{double a;}
class B{double b;}
double funk(A a){return a.a;}
double funk(B b){return b.b;}
using Mix = std::variant<A,B>;
int main()
{
std::vector<Mix> mix = {A{0.0}, B{1.0}, A{2.0}};
{
std::buffer mixB(mix);
sycl::queue q;
q.submit([&](sycl::handler& h){
sycl::accessor mix_acc(mix, h);
h.single_task([=](){
std::visit([](auto x){return funk(x);}, mix_acc[0]);
});
}
}
}
r/sycl • u/blinkfrog12 • Jul 17 '24
How to access local (shared) workgroup memory using USM-pointers model?
I am trying to move from buffers/accessors model to USM pointers. I already see performance benefits of this approach in some cases such as dispatching a lot of small kernels. However, how I can use local workgroup memory when using USM pointers?
r/sycl • u/nikita-1298 • Aug 28 '24
Utilize heterogeneous computing capabilities of SYCL to accelerate AI/ML and Data Science applications.
r/sycl • u/rodburns • Sep 23 '19
Accelerating AI Performance in an Open Software Ecosystem using SYCL
In the latest White Paper from the Linley Group, Linley Gwennap examines how an open software ecosystem is critical to enable developers to write artificial intelligence software that takes full advantage of the latest processors.
Gwennap says “Customers need more than just fast hardware; they need to run many different types of networks. Furthermore, customers want to evolve their algorithms and even create new types of models in the future.”
“Nvidia’s software stack, based on its proprietary CUDA, creates a high barrier to entry for challengers. SYCL, the only open alternative to CUDA that has multivendor support, enables customers to move to higher performance hardware while retaining software flexibility. A commercial version of SYCL, branded ComputeCpp, is offered by Codeplay.”
r/sycl • u/No_Laugh3726 • Jan 30 '24
Best Ways to learn Sycl
Hi everyone,
Doing a master thesis in Heterogeneous computing and am expected to program in SYCl, the thing is I am having a hard time finding online materials to learn it.
I am aware of sycl-academy, one workshop given by EUROCC Sweden and a book (`Mastering DPC++ for Programming of Heterogeneous Systems using C++ and SYCL`), but it seems that examples and the classes are too simple.
I have experience in some parallel programming (OpenMp and OpenMPI) but all at CPU level, working with GPU is something completing new.
I am mostly missing (harder/more complex) exercises/examples, and having a hard time understanding `nd_range`.
Do you guys recommend anything ? How did you learn SYCL, do you use SYCL for any project ?
r/sycl • u/anshulgupta_4 • Feb 06 '24
Solving Heterogeneous Programming Challenges with Fortran and OpenMP
r/sycl • u/ramyaravi19 • Feb 01 '24
C-DAC achieves 1.75x performance improvement on seismic code migration using SYCL
r/sycl • u/No_Laugh3726 • Jan 31 '24
Cuda conversion
Sorry to spam this subreddit, if there are other places to discuss/ask for help please say so.
I found this code in a paper in CUDA, and with the help of this table. I tried to convert it to SYCL, the conversion compiles and runs, but is giving me the wrong answer.
The code is SPMV in Csr format.
__global__ void spmv_csr_vector_kernel(const int num_rows, const int *ptr,
const int *indices, const float *data,
const float *x, float *y) {
__shared__ float vals[];
int thread_id = blockDim.x * blockIdx.x + threadIdx.x; // global thread index
int warp_id = thread_id / 32; // global warp index
int lane = thread_id & (32 - 1); // thread index within the warp
// one warp per row
int row = warp_id;
if (row < num_rows) {
int row_start = ptr[row];
int row_end = ptr[row + 1];
// compute running sum per thread
vals[threadIdx.x] = 0;
for (int jj = row_start + lane; jj < row_end; jj += 32)
vals[threadIdx.x] += data[jj] * x[indices[jj]];
// parallel reduction in shared memory
if (lane < 16)
vals[threadIdx.x] += vals[threadIdx.x + 16];
if (lane < 8)
vals[threadIdx.x] += vals[threadIdx.x + 8];
if (lane < 4)
vals[threadIdx.x] += vals[threadIdx.x + 4];
if (lane < 2)
vals[threadIdx.x] += vals[threadIdx.x + 2];
if (lane < 1)
vals[threadIdx.x] += vals[threadIdx.x + 1];
// first thread writes the result
if (lane == 0)
y[row] += vals[threadIdx.x];
}
}And here is my sycl implementation:
void SPMV_Parallel(sycl::queue q, int compute_units, int work_group_size,
int num_rows, int *ptr, int *indices, float *data, float *x,
float *y) {
float *vals = sycl::malloc_shared<float>(work_group_size, q);
q.fill(y, 0, n).wait();
q.fill(vals, 0, work_group_size).wait();
q.submit([&](sycl::handler &cgh) {
const int WARP_SIZE = 32;
assert(work_group_size % WARP_SIZE == 0);
cgh.parallel_for(
sycl::nd_range<1>(compute_units * work_group_size, work_group_size),
[=](sycl::nd_item<1> item) {
int thread_id = item.get_local_range(0) * item.get_group(0) *
item.get_local_id(0);
int warp_id = thread_id / WARP_SIZE;
int lane = thread_id & (WARP_SIZE - 1);
int row = warp_id;
if (row < num_rows) {
int row_start = ptr[row];
int row_end = ptr[row + 1];
vals[item.get_local_id(0)] = 0;
for (int jj = row_start + lane; jj < row_end; jj += WARP_SIZE) {
vals[item.get_local_id(0)] += data[jj] * x[indices[jj]];
}
if (lane < 16)
vals[item.get_local_id(0)] += vals[item.get_local_id(0) + 16];
if (lane < 8)
vals[item.get_local_id(0)] += vals[item.get_local_id(0) + 8];
if (lane < 4)
vals[item.get_local_id(0)] += vals[item.get_local_id(0) + 4];
if (lane < 2)
vals[item.get_local_id(0)] += vals[item.get_local_id(0) + 2];
if (lane < 1)
vals[item.get_local_id(0)] += vals[item.get_local_id(0) + 1];
if (lane == 0)
y[row] += vals[item.get_local_id(0)];
}
});
}).wait();
sycl::free(vals, q);
}Any guidance would be greatly appreaciated !
r/sycl • u/Local_Book4367 • Feb 05 '24
Utilizing SYCL in Database Engines
I’m in the process of developing a prototype for a database engine that targets multiple architectures and accelerators. Maintaining a codebase for x86_64, ARM, various GPUs, and different accelerators is quite challenging, so I’m exploring ways to execute queries on different accelerators using a unified codebase.
I’ve experimented with LLVM MLIR and attempted to lower the affine dialect to various architectures. However, the experience was less than satisfactory, as it seemed that either I was not using it correctly, or there were missing compiler passes when I was lowering it to a code targeting a specific architecture.
I’m considering whether SYCL could be a solution to this problem. Is it feasible to generate SYCL or LLVM IR from SYCL at runtime? This capability would allow me to optimize the execution workflow in my database prototype.
Finally, given the context I’ve provided, would you recommend using SYCL, or am I perhaps using the wrong tool to address this problem?
For clarity, I'd like to build it for both Windows and Linux.
r/sycl • u/mastersilvapt • Jan 10 '24
Cuda to SYCL help
Hi need help converting the following cuda code to sycl. I am using unified shared memory, but the array y allways return 0, in all indexes.
I am genuinely lost. Any help is greatly appreciated.
global void
spmv_csr_scalar_kernel(
const int num_rows,
const int matrix->row_offsets,
const intmatrix->column_indices,
const float matrix->values,
const floatx,
float y)
{
int row = blockDim.x blockIdx.x + threadIdx.x;
if (row < num_rows)
{
float dot = 0;
int row_start = matrix->row_offsets[row];
int row_end = matrix->row_offsets[row + 1];
for (int jj = row_start; jj < row_end; jj++)
dot += matrix->values[jj] * x[matrix->column_indices[jj]];
y[row] += dot;
}
}I have tried the following:
void SPMVV_Parallel(sycl::queue q, const CompressedSparseRow matrix, const float *x, float *y)
{
q.parallel_for(sycl::range<1>(n), [=](sycl::id<1> gid)
{
int row = gid[0];
if (row < n) {
float dot = 0;
int row_start = matrix->row_offsets[row];
int row_end = matrix->row_offsets[row+1];
for (size_t i = row_start; i < row_end; i++)
{
dot+=matrix->values[i] x[matrix->column_indices[i]];
}
y[row]+=dot;
} });
}