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

Very different numerical results on GPU vs CPU using mmd #34

Open
alec-hoyland opened this issue Jan 8, 2024 · 0 comments
Open

Very different numerical results on GPU vs CPU using mmd #34

alec-hoyland opened this issue Jan 8, 2024 · 0 comments

Comments

@alec-hoyland
Copy link

When using mmd with CUDA, I am getting wildly different numerical results than on CPU. Is this a bug or am I doing something wrong?

julia> using Flux, IPMeasures

julia> A = f32(rand(200, 128)); B = f32(rand(200, 128));

julia> A2 = gpu(A); B2 = gpu(B);

julia> mmd(GaussianKernel(2), A, B)
-2.9192196f-7

julia> mmd(GaussianKernel(2), A2, B2)
-2.5343708f-8

julia> mmd(GaussianKernel(80), A2, B2)
-1.0104629f-6

julia> mmd(GaussianKernel(80), A, B)
-1.1662798f-5

julia> mmd(GaussianKernel(80), 100*A2, B2)
29872.396f0

julia> mmd(GaussianKernel(80), 100*A, B)
-0.0033887483f0

julia>

My system

Julia Version 1.9.4
Commit 8e5136fa297 (2023-11-14 08:46 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 24 × AMD Ryzen 9 7900X 12-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver3)
  Threads: 1 on 24 virtual cores
CUDA toolkit 11.7, artifact installation
NVIDIA driver 545.29.6, for CUDA 12.3
CUDA driver 12.3
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

1 participant