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

Add GPU support #75

Merged
merged 30 commits into from
May 14, 2024
Merged

Add GPU support #75

merged 30 commits into from
May 14, 2024

Conversation

lukem12345
Copy link
Member

@lukem12345 lukem12345 commented Apr 25, 2024

Before we merge, test that all DEC CUDA matrices load properly

  • Exterior derivative
  • Boundary
  • Dual derivative hodge
  • Inverse hodge
  • Primal-Primal Wedge products

@GeorgeR227
Copy link
Contributor

We don't have CUDA testing through Github actions but on HiPerGator with CUDA we see that all CUDA tests pass.
image

Not sure why the ExteriorCalculus tests take so long here but I don't see this behavior on my own machine. I think this is ready to merge.

@GeorgeR227 GeorgeR227 requested a review from epatters May 1, 2024 17:28
ext/CombinatorialSpacesCUDAExt.jl Outdated Show resolved Hide resolved
ext/CombinatorialSpacesCUDAExt.jl Outdated Show resolved Hide resolved
ext/CombinatorialSpacesCUDAExt.jl Outdated Show resolved Hide resolved
ext/CombinatorialSpacesCUDAExt.jl Outdated Show resolved Hide resolved
src/CombinatorialSpaces.jl Outdated Show resolved Hide resolved
test/OperatorsCUDA.jl Outdated Show resolved Hide resolved
test/OperatorsCUDA.jl Outdated Show resolved Hide resolved
test/OperatorsCUDA.jl Outdated Show resolved Hide resolved
test/OperatorsCUDA.jl Outdated Show resolved Hide resolved
test/OperatorsCUDA.jl Outdated Show resolved Hide resolved
Project.toml Outdated Show resolved Hide resolved
ext/CombinatorialSpacesCUDAExt.jl Outdated Show resolved Hide resolved
ext/CombinatorialSpacesCUDAExt.jl Show resolved Hide resolved
ext/CombinatorialSpacesCUDAExt.jl Show resolved Hide resolved
ext/CombinatorialSpacesCUDAExt.jl Show resolved Hide resolved
@test all(isapprox.(dec_inv_hodge_star(Val{i}, sd, GeometricHodge())(V_1), Array(dec_inv_hodge_star(Val{i}, sd, GeometricHodge(), Val{:CUDA})(CuArray(V_1))); atol = 1e-10))
end
for i in 1:1
for sd in dual_meshes_2D[1:end-1]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sphere is skipped here because you need to add support for meshes embedded in 3D here before we merge right

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No all meshes work fine. The matrix operators are generated on the CPU, as before, and just ported to the GPU. I skip the sphere here because it's inverse calculation is very unstable for some reason. To make the tests pass I'd need to drop down atol significantly.

JoshHKim and others added 20 commits May 13, 2024 18:18
Also added some higher level calls to wedge_product
Now need to change functions to be overloading
The method of handling CUDA functions from the extension should change. For now we have placeholder functions in the main module that are solely meant to be overloaded. This should probably changed to have CUDA overload the regular CPU variants. Also for some reason being in the test environment does not let the extension load, meaning the CUDA tests aren't running.
This seems to be needed since CUDA is really iffy with Int8s.
Also added DEC CUDA matrix checks
Tests run if ran manually. will not work with the ] test command. Should consider test-specific dependencies in the top-level project.toml: https://pkgdocs.julialang.org/v1/creating-packages/#Test-specific-dependencies
Also removed the test/Project.toml and updated the main Project.toml to include extra test dependencies.
@lukem12345 lukem12345 merged commit 98edd59 into main May 14, 2024
7 checks passed
@lukem12345 lukem12345 deleted the CUDA-Extensions branch May 14, 2024 14:02
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

Successfully merging this pull request may close these issues.

3 participants