Skip to content

Commit

Permalink
Use Chmy as backend (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
luraess authored Sep 3, 2024
1 parent 7261d0b commit 46e9d4b
Show file tree
Hide file tree
Showing 87 changed files with 2,820 additions and 2,744 deletions.
2 changes: 1 addition & 1 deletion .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
style = "yas"
margin = 140
margin = 165
align_assignment = true
align_conditional = true
whitespace_ops_in_indices = false
Expand Down
5 changes: 4 additions & 1 deletion .buildkite/run_tests.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# DEBUG: until registered, Chmy.jl needs to be explicitly added in "command:" steps
steps:
- label: "CUDA Julia {{matrix.version}}"
matrix:
Expand All @@ -13,6 +14,7 @@ steps:
command: |
julia -e 'println("--- :julia: Instantiating project")
using Pkg
Pkg.add(url="https://github.com/PTsolvers/Chmy.jl")
Pkg.develop(; path=pwd())' || exit 3
julia -e 'println("+++ :julia: Running tests")
Expand All @@ -38,6 +40,7 @@ steps:
command: |
julia -e 'println("--- :julia: Instantiating project")
using Pkg
Pkg.add(url="https://github.com/PTsolvers/Chmy.jl")
Pkg.develop(; path=pwd())' || exit 3
julia -e 'println("+++ :julia: Running tests")
Expand All @@ -46,7 +49,7 @@ steps:
agents:
queue: "juliagpu"
rocm: "*"
rocmgpu: "gfx1101" # select Ludovic's Navi 3 card (ROCm 6.0)
rocmgpu: "*" #"gfx1101" # select Ludovic's Navi 3 card (ROCm 6.0)
timeout_in_minutes: 120
soft_fail:
- exit_status: 3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
run: julia -e 'using CompatHelper; CompatHelper.main(; subdirs=["", "test", "docs"])'
34 changes: 34 additions & 0 deletions .github/workflows/DocPreviewCleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Doc Preview Cleanup

on:
pull_request:
types: [closed]

jobs:
doc-preview-cleanup:
# Do not run on forks to avoid authorization errors
# Source: https://github.community/t/have-github-action-only-run-on-master-repo-and-not-on-forks/140840/18
# Note: This does not always work as intended - but you can just ignore
# the failed CI runs after merging a PR
if: github.repository_owner == 'PTsolvers'
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages

- name: Delete preview and history
shell: bash
run: |
git config user.name "Documenter.jl"
git config user.email "documenter@juliadocs.github.io"
git rm -rf --ignore-unmatch "previews/PR$PRNUM"
git commit -m "delete preview" --allow-empty
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
env:
PRNUM: ${{ github.event.number }}

- name: Push changes
run: |
git push --force origin gh-pages-new:gh-pages
11 changes: 8 additions & 3 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# DEBUG: until registered, Chmy.jl needs to be explicitly added in "Install dependencies" step
name: Documentation

on:
Expand All @@ -14,11 +15,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@v2
with:
version: '1.10'
version: '1'
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
run: |
julia --project=docs/ -e 'using Pkg
Pkg.add(url="https://github.com/PTsolvers/Chmy.jl")
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/UnitTests.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# DEBUG: until registered, Chmy.jl needs to be explicitly added in "Run tests" (instead of using "legacy testing")
name: Unit Tests
on:
push:
Expand Down Expand Up @@ -45,7 +46,7 @@ jobs:
# allow_failure: true
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
Expand All @@ -59,8 +60,21 @@ jobs:
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
# --- legacy testing
# - uses: julia-actions/julia-buildpkg@latest
# - uses: julia-actions/julia-runtest@latest
# --- testing with un-registered Chmy.jl
- name: Run tests
run: |
julia -e 'println("--- :julia: Instantiating project")
using Pkg
Pkg.add(url="https://github.com/PTsolvers/Chmy.jl")
Pkg.develop(; path=pwd())'
julia -e 'println("+++ :julia: Running tests")
using Pkg
Pkg.test("FastIce"; coverage=true)'
# codecov
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
with:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Manifest.toml
LocalPreferences.toml

.DS_Store
.vscode

# Project-specific files
prof_*
Expand Down
19 changes: 3 additions & 16 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,41 +1,28 @@
name = "FastIce"
uuid = "e0de9f13-a007-490e-b696-b07d031015ca"
authors = ["Ludovic Raess <ludovic.rass@gmail.com>, Ivan Utkin <utkin@hey.com>, Samuel Omlin <samuel.omlin@cscs.ch> and contributors"]
version = "0.2.0"
version = "0.3.2"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Chmy = "33a72cf0-4690-46d7-b987-06506c2248b9"
ElasticArrays = "fdbdab4c-e67f-52f5-8c3f-e7b388dad3d4"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
ImplicitGlobalGrid = "4d7a3746-15be-11ea-1130-334b0c4f5fa0"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
LightXML = "9c8b4983-aa76-5018-a973-4c85ecc9e179"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[weakdeps]
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"

[extensions]
FastIceAMDGPUExt = "AMDGPU"
FastIceCUDAExt = "CUDA"

[compat]
AMDGPU = "0.8"
Adapt = "4"
CUDA = "5"
ElasticArrays = "1"
GeometryBasics = "0.4"
HDF5 = "0.17"
ImplicitGlobalGrid = "0.15"
HDF5 = "0.16, 0.17"
KernelAbstractions = "0.9"
LightXML = "0.9"
MPI = "0.20"
OffsetArrays = "1"
Preferences = "1"
23 changes: 1 addition & 22 deletions docs/src/lib/modules.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
# Modules

## Grids

```@autodocs
Modules = [FastIce.Grids]
Order = [:type, :function]
```

## Distributed

```@autodocs
Modules = [FastIce.Distributed]
Order = [:type, :function]
```

## Kernel launch

```@autodocs
Modules = [FastIce.KernelLaunch]
Order = [:type, :function]
```

## Writers

```@autodocs
Expand All @@ -33,4 +12,4 @@ Order = [:type, :function]
```@autodocs
Modules = [FastIce.LevelSets]
Order = [:type, :function]
```
```
12 changes: 6 additions & 6 deletions docs/src/usage/runtests.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

To run the FastIce test suite on the CPU, simple run `test` from within the package mode or using `Pkg`:
```julia-repl
using Pkg
Pkg.test("FastIce")
julia> using Pkg
julia> Pkg.test("FastIce")
```

## GPU tests
Expand All @@ -15,13 +15,13 @@ To run the FastIce test suite on CUDA or ROC backend (Nvidia or AMD GPUs), respe
### For CUDA backend (Nvidia GPUs):

```julia-repl
using Pkg
Pkg.test("FastIce"; test_args=["--backend=CUDA"])
julia> using Pkg
julia> Pkg.test("FastIce"; test_args=["--backend=CUDA"])
```

### For ROC backend (AMD GPUs):

```julia-repl
using Pkg
Pkg.test("FastIce"; test_args=["--backend=AMDGPU"])
julia> using Pkg
julia> Pkg.test("FastIce"; test_args=["--backend=AMDGPU"])
```
14 changes: 0 additions & 14 deletions ext/FastIceAMDGPUExt/FastIceAMDGPUExt.jl

This file was deleted.

15 changes: 0 additions & 15 deletions ext/FastIceCUDAExt/FastIceCUDAExt.jl

This file was deleted.

5 changes: 1 addition & 4 deletions scripts_future_API/Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Chmy = "33a72cf0-4690-46d7-b987-06506c2248b9"
FastIce = "e0de9f13-a007-490e-b696-b07d031015ca"
FastIceTools = "14532042-4700-46e0-8dec-55d517bc1ae0"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
Expand Down
Loading

0 comments on commit 46e9d4b

Please sign in to comment.