Skip to content

Commit

Permalink
fix docs and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ytdHuang committed Oct 31, 2023
1 parent 7f50a9f commit 67ecb5e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 30 deletions.
19 changes: 19 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
steps:
- label: "HierarchicalEOM_CUDAExt"
plugins:
- JuliaCI/julia#v1:
version: "1"
- JuliaCI/julia-test#v1:
test_args: "--quickfail"
- JuliaCI/julia-coverage#v1:
dirs:
- src
agents:
queue: "juliagpu"
cuda: "*"
env:
GROUP: "HierarchicalEOM_CUDAExt"
SECRET_CODECOV_TOKEN: "kaIXEN51HinaQ4JGclQcIgxeMMtXDb5uvnP3E2eKrH4Eruf2pKd5QwUGcIVL8+rcWeo5FWj883rNxRQEH3YeCWs6/i7vzs+ORvG51QeCNYQgNqFzPsWRcq5qJYc+JPFbisS7q9nghqWTwr52cnjarD4Xx3ceGorMyS5NvFpCNxMgqHNyGkLvipxcTTJfKZK61bpnbntoIjiIO1XSZKjcxnXFGFnolV9BHCr5v8f7F42n2tUH7X3nDHmTBr1AbO2lFAU9ra/KezHcIf0wg2HcV8LZD0+mj8q/SBPjQZSH7cxwx4Q2eTjT4Sw7xnrBGuySVm8ZPCAV7nRNEHo+VqR+GQ=="
timeout_in_minutes: 30
# Don't run Buildkite if the commit message includes the text [skip tests]
if: build.message !~ /\[skip tests\]/
2 changes: 0 additions & 2 deletions .github/workflows/Runtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:
include:
- julia-version: '1'
group: 'HierarchicalEOM_QOExt'
- julia-version: '1'
group: 'HierarchicalEOM_CUDAExt'
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
Expand Down
42 changes: 14 additions & 28 deletions docs/src/extensions/CUDA.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,16 @@ Therefore, we wrapped several functions in `CUDA` and `CUDA.CUSPARSE` in order t
The extension will be automatically loaded if user imports the package `CUDA.jl` :

````@example CUDA_Ext_example
using BenchmarkTools
using CUDA
using HierarchicalEOM
using LinearSolve # to change the solver for better GPU performance
using Plots
````

### Check version info. of `HierarchicalEOM.jl`

````@example CUDA_Ext_example
HierarchicalEOM.versioninfo()
````

### Check version info. of `CUDA.jl`

````@example CUDA_Ext_example
CUDA.versioninfo()
````

### Setup

Here, we demonstrate this extension by using the example of [the single-impurity Anderson model](@ref exp-SIAM).

````@example CUDA_Ext_example
```julia
ϵ = -5
U = 10
Γ = 2
Expand Down Expand Up @@ -78,31 +64,31 @@ M_odd_gpu = cu(M_odd_cpu)

# solve steady state with CPU
ados_ss = SteadyState(M_even_cpu);
````
```

!!! note "Note"
This extension does not support for solving [`SteadyState`](@ref doc-Stationary-State) on GPU since it is not efficient and might get wrong solutions. If you really want to obtain the stationary state with GPU, you can repeatedly solve the [`evolution`](@ref doc-Time-Evolution) until you find it.

### Solving time evolution with CPU

````@example CUDA_Ext_example
@benchmark ados_list_cpu = evolution(M_even_cpu, ρ0, tlist; verbose=false)
````
```julia
ados_list_cpu = evolution(M_even_cpu, ρ0, tlist; verbose=false)
```

### Solving time evolution with GPU

````@example CUDA_Ext_example
@benchmark ados_list_gpu = evolution(M_even_gpu, ρ0, tlist; verbose=false)
````
```julia
ados_list_gpu = evolution(M_even_gpu, ρ0, tlist; verbose=false)
```

### Solving Spectrum with CPU

````@example CUDA_Ext_example
@benchmark dos_cpu = spectrum(M_odd_cpu, ados_ss, d_up, ωlist; verbose=false)
````
```julia
dos_cpu = spectrum(M_odd_cpu, ados_ss, d_up, ωlist; verbose=false)
```

### Solving Spectrum with GPU

````@example CUDA_Ext_example
@benchmark dos_gpu = spectrum(M_odd_gpu, ados_ss, d_up, ωlist; solver=KrylovJL_BICGSTAB(rtol=1f-10, atol=1f-12), verbose=false)
````
```julia
dos_gpu = spectrum(M_odd_gpu, ados_ss, d_up, ωlist; solver=KrylovJL_BICGSTAB(rtol=1f-10, atol=1f-12), verbose=false)
```

0 comments on commit 67ecb5e

Please sign in to comment.