arrayfire icon indicating copy to clipboard operation
arrayfire copied to clipboard

[BUG] found on AF 3.8.3 and 3.9.0 for OPENCL, possibly with af::join

Open sebastienleclaire opened this issue 2 years ago • 4 comments

Hi,

First, congragulation for the release of AF 3.9.0.

I found a bug on OpenCL for AF version 3.8.3 and 3.9.0. Everything is fine with 3.8.2 on CPU and OPENCL. I did not test CUDA or ONEAPI.

Here the snippet:

float column_host[] = { 1, 2, 3 };
af::array column(3, 1, column_host); 

af::array result1 = af::join(1, -column, af::constant(0, 3, 1, f32), column);
af_print(result1)

af::array result2 = af::join(1, -column, af::constant(0, 3, 1, f32));
result2 = af::join(1, result2, column);
af_print(result2)

I'm not sure where the problem is comming from but result1 and result2 should be identical between CPU and OPENCL, however I do get: FOR OPENCL: result1 [3 3 1 1] 1.0000 -1.0000 0.0000 2.0000 -2.0000 0.0000 3.0000 -3.0000 0.0000 FOR CPU: result1 and result2 [3 3 1 1] -1.0000 0.0000 1.0000 -2.0000 0.0000 2.0000 -3.0000 0.0000 3.0000

The correct result should be "result2" as in AF 3.8.2 and before.

If you can't reproduce the problem, please let me know and I'll post more information.

Sébastien Leclaire

sebastienleclaire avatar Oct 13 '23 00:10 sebastienleclaire

Hey thanks for submitting this issue. I was able to reproduce this. I am investigating the issue and will follow up with a solution.

Thanks

umar456 avatar Oct 13 '23 18:10 umar456

@umar

Since I updated the join part in 3.8.3, I looked into it and found the error in the jit module (is also present in CUDA). If you like, I can upload the latest version of master and create a PR.

Willy Born

On Fri, 13 Oct 2023 at 20:06, Umar Arshad @.***> wrote:

Hey thanks for submitting this issue. I was able to reproduce this. I am investigating the issue and will follow up with a solution.

Thanks

— Reply to this email directly, view it on GitHub https://github.com/arrayfire/arrayfire/issues/3511#issuecomment-1761963013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ2WGPHYOZZIEJEIZ7OKIA3X7F7MFAVCNFSM6AAAAAA56MF6USVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRRHE3DGMBRGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

willyborn avatar Oct 14 '23 11:10 willyborn

Thanks @willyborn for submitting the PR. I am going to try to get it in later today so we can fix this issue.

umar456 avatar Oct 16 '23 16:10 umar456

Hello @umar456! Is there any progress on this? I've just got bitten by this bug, and a fix/workaround would be greatly appreciated.

twesterhout avatar Nov 30 '23 20:11 twesterhout