Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: JuliaParallel/Dagger.jl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.18.0
Choose a base ref
...
head repository: JuliaParallel/Dagger.jl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.18.1
Choose a head ref
  • 14 commits
  • 6 files changed
  • 2 contributors

Commits on Jul 31, 2023

  1. CI: Add CompatHelper

    jpsamaroo committed Jul 31, 2023
    Copy the full SHA
    777d716 View commit details
  2. UB StatsBase to 0.34

    jpsamaroo committed Jul 31, 2023
    Copy the full SHA
    5917cd1 View commit details
  3. Merge pull request #412 from JuliaParallel/jps/compathelper

    Add CompatHelper, UB StatsBase to 0.34
    jpsamaroo authored Jul 31, 2023
    Copy the full SHA
    8afc692 View commit details

Commits on Aug 1, 2023

  1. Copy the full SHA
    32a8eaa View commit details
  2. CI: Implement custom actions

    Currently implements just benchmarks
    jpsamaroo committed Aug 1, 2023
    Copy the full SHA
    cca1031 View commit details
  3. Copy the full SHA
    9f3e01a View commit details
  4. Merge pull request #413 from JuliaParallel/jps/ci-commands

    TEST: Try implementing custom actions
    jpsamaroo authored Aug 1, 2023
    Copy the full SHA
    8548c6f View commit details

Commits on Aug 3, 2023

  1. Copy the full SHA
    c18704d View commit details

Commits on Aug 7, 2023

  1. build(deps): bump actions/checkout from 2 to 3

    Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v2...v3)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot[bot] authored Aug 7, 2023
    Copy the full SHA
    4ce621f View commit details
  2. Merge pull request #415 from JuliaParallel/dependabot/github_actions/…

    …actions/checkout-3
    
    build(deps): bump actions/checkout from 2 to 3
    jpsamaroo authored Aug 7, 2023
    Copy the full SHA
    46cae33 View commit details
  3. Copy the full SHA
    c778d9b View commit details
  4. Merge pull request #416 from JuliaParallel/jps/ci-actions-once

    CI: Only check for custom cmds once
    jpsamaroo authored Aug 7, 2023
    Copy the full SHA
    7595b22 View commit details
  5. Merge pull request #414 from JuliaParallel/jps/caching-pass-module

    disk_caching: Pass Dagger module in remotecall
    jpsamaroo authored Aug 7, 2023
    Copy the full SHA
    b6f72ec View commit details
  6. Bump to 0.18.1

    jpsamaroo authored Aug 7, 2023
    2
    Copy the full SHA
    9f803c6 View commit details
Showing with 104 additions and 23 deletions.
  1. +35 −0 .github/workflows/CompatHelper.yml
  2. +43 −0 .github/workflows/CustomCommands.yml
  3. +4 −4 Manifest.toml
  4. +2 −2 Project.toml
  5. +16 −13 benchmarks/suites/nmf.jl
  6. +4 −4 src/utils/caching.jl
35 changes: 35 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CompatHelper

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Julia compatibility
id: julia_compat
# NOTE: this requires a Julia compat lower-bound with minor version!
run : |
version=$(grep '^julia = ' Project.toml | grep -o '".*"' | cut -d '"' -f2)
echo "::set-output name=version::$version"
- uses: julia-actions/setup-julia@v1
with:
version: ${{ steps.julia_compat.outputs.version }}
- name: Install CompatHelper
run: |
import Pkg
name = "CompatHelper"
version = "2"
Pkg.add(; name, version)
shell: julia --color=yes {0}
- name: Run CompatHelper
run: |
using CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/CustomCommands.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Custom Commands

on:
pull_request:

jobs:
custom_actions:
runs-on: ubuntu-latest
steps:
- name: Wait for commands
id: read_commands
run: |
ci_commands=$(curl -sH "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X GET "${{ github.event.pull_request.comments_url }}" | jq -r ".[] | select(.body | startswith(\"/run-actions\")) | .body")
if [ ! -z "$ci_commands" ]; then
echo "Read commands $ci_commands"
echo "ci_commands=$ci_commands" >> $GITHUB_OUTPUT
break
fi
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: '1.9'
arch: 'x64'

- name: Run provided commands
run: |
echo "Got custom commands:"
ci_commands="${{ steps.read_commands.outputs.ci_commands }}"
echo $ci_commands
if echo "$ci_commands" | grep -q benchmark; then
echo "Running benchmarks..."
julia -e 'using Pkg; Pkg.add("BenchmarkTools"); Pkg.develop(;path=pwd())'
JULIA_PROJECT=$PWD julia --project benchmarks/benchmark.jl
fi
if echo "$ci_commands" | grep -q premerge; then
echo "Running pre-merge checks..."
julia -e 'using Pkg; Pkg.add("Aqua"); Pkg.develop(;path=pwd())'
JULIA_PROJECT=$PWD julia --project -e 'using Aqua, Dagger; Aqua.test_all(Dagger)'
fi
env:
BENCHMARK: "nmf:raw,dagger"
BENCHMARK_SCALE: "5:5:10"
8 changes: 4 additions & 4 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -36,9 +36,9 @@ version = "0.12.10"

[[deps.Compat]]
deps = ["Dates", "LinearAlgebra", "UUIDs"]
git-tree-sha1 = "4e88377ae7ebeaf29a047aa1ee40826e0b708a5d"
git-tree-sha1 = "5ce999a19f4ca23ea484e92a1774a61b8ca4cf8e"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "4.7.0"
version = "4.8.0"

[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
@@ -211,9 +211,9 @@ version = "1.6.0"

[[deps.StatsBase]]
deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"]
git-tree-sha1 = "d1bf48bfcc554a3761a133fe3a9bb01488e06916"
git-tree-sha1 = "75ebe04c5bed70b91614d684259b661c9e6274a4"
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
version = "0.33.21"
version = "0.34.0"

[[deps.Test]]
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Dagger"
uuid = "d58978e5-989f-55fb-8d15-ea34adc7bf54"
version = "0.18.0"
version = "0.18.1"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
@@ -28,7 +28,7 @@ DataStructures = "0.18"
MacroTools = "0.5"
MemPool = "0.4.3"
Requires = "1"
StatsBase = "0.28, 0.29, 0.30, 0.31, 0.32, 0.33"
StatsBase = "0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34"
TimespanLogging = "0.1"
julia = "1.7"

29 changes: 16 additions & 13 deletions benchmarks/suites/nmf.jl
Original file line number Diff line number Diff line change
@@ -55,40 +55,43 @@ function nmf_suite(ctx; method, accels)
nw = length(workers())
nsuite = BenchmarkGroup()
while nw > 0
opts = if accel == "cuda"
scope = if accel == "cuda"
error("Not implemented")
Dagger.Sch.SchedulerOptions(;proctypes=[
DaggerGPU.CuArrayDeviceProc
])
elseif accel == "amdgpu"
error("Not implemented")
Dagger.Sch.SchedulerOptions(;proctypes=[
DaggerGPU.ROCArrayProc
])
elseif accel == "cpu"
Dagger.Sch.SchedulerOptions()
scope = Dagger.scope(;workers=workers()[1:nw])
else
error("Unknown accelerator $accel")
end
#bsz = ncol ÷ length(workers())
bsz = ncol ÷ 64
nsuite["Workers: $nw"] = @benchmarkable begin
_ctx = Context($ctx, workers()[1:$nw])
compute(_ctx, nnmf($X[], $W[], $H[]); options=$opts)
Dagger.with_options(;scope=$scope) do
fetch(nnmf($X[], $W[], $H[]))
end
end setup=begin
_nw, _scale = $nw, $scale
@info "Starting $_nw worker Dagger NNMF (scale by $_scale)"
if $accel == "cuda"
# FIXME: Allocate with CUDA.rand if possible
$X[] = Dagger.mapchunks(CUDA.cu, compute(rand(Blocks($bsz, $bsz), Float32, $nrow, $ncol); options=$opts))
$W[] = Dagger.mapchunks(CUDA.cu, compute(rand(Blocks($bsz, $bsz), Float32, $nrow, $nfeatures); options=$opts))
$H[] = Dagger.mapchunks(CUDA.cu, compute(rand(Blocks($bsz, $bsz), Float32, $nfeatures, $ncol); options=$opts))
$X[] = Dagger.mapchunks(CuArray, rand(Blocks($bsz, $bsz), Float32, $nrow, $ncol))
$W[] = Dagger.mapchunks(CuArray, rand(Blocks($bsz, $bsz), Float32, $nrow, $nfeatures))
$H[] = Dagger.mapchunks(CuArray, rand(Blocks($bsz, $bsz), Float32, $nfeatures, $ncol))
elseif $accel == "amdgpu"
$X[] = Dagger.mapchunks(ROCArray, compute(rand(Blocks($bsz, $bsz), Float32, $nrow, $ncol); options=$opts))
$W[] = Dagger.mapchunks(ROCArray, compute(rand(Blocks($bsz, $bsz), Float32, $nrow, $nfeatures); options=$opts))
$H[] = Dagger.mapchunks(ROCArray, compute(rand(Blocks($bsz, $bsz), Float32, $nfeatures, $ncol); options=$opts))
$X[] = Dagger.mapchunks(ROCArray, rand(Blocks($bsz, $bsz), Float32, $nrow, $ncol))
$W[] = Dagger.mapchunks(ROCArray, rand(Blocks($bsz, $bsz), Float32, $nrow, $nfeatures))
$H[] = Dagger.mapchunks(ROCArray, rand(Blocks($bsz, $bsz), Float32, $nfeatures, $ncol))
elseif $accel == "cpu"
$X[] = compute(rand(Blocks($bsz, $bsz), Float32, $nrow, $ncol); options=$opts)
$W[] = compute(rand(Blocks($bsz, $bsz), Float32, $nrow, $nfeatures); options=$opts)
$H[] = compute(rand(Blocks($bsz, $bsz), Float32, $nfeatures, $ncol); options=$opts)
$X[] = rand(Blocks($bsz, $bsz), Float32, $nrow, $ncol)
$W[] = rand(Blocks($bsz, $bsz), Float32, $nrow, $nfeatures)
$H[] = rand(Blocks($bsz, $bsz), Float32, $nfeatures, $ncol)
end
end teardown=begin
if render != "" && !live
8 changes: 4 additions & 4 deletions src/utils/caching.jl
Original file line number Diff line number Diff line change
@@ -66,10 +66,10 @@ function enable_disk_caching!(
processes::Vector{Int}=procs(),
)
results = [
remotecall(id) do
!isdefined(Main, :Dagger) && Main.eval(:(using Dagger))
Dagger.MemPool.setup_global_device!(
Dagger.MemPool.DiskCacheConfig(;
# N.B. We pass the Dagger module to help serialization find it remotely
remotecall(id, Dagger) do _Dagger
_Dagger.MemPool.setup_global_device!(
_Dagger.MemPool.DiskCacheConfig(;
toggle=true, membound=mem_limits[id], diskbound=disk_limit_mb * 2^20
),
)