Skip to content

Commit

Permalink
Use recorded tape to impl task copying (#93)
Browse files Browse the repository at this point in the history
* use recorded tape to impl task copying

* remove dup converter

* remove Libtask_jll in test CI script

* exception of task is not set in Julia prior v1.5

* lazy mode produce

* close consume channel when task is done

* try to fix integration tests

* check task status

* code refactor

* support `produce` in nested call

* add docs

* switch back to the old `produce` impl

* construct TapedTask from another TapedTask

* integration tests against certain branch

* Update Project.toml

Co-authored-by: Hong Ge <[email protected]>
  • Loading branch information
KDr2 and yebai authored Dec 12, 2021
1 parent 7c404c4 commit af47df9
Show file tree
Hide file tree
Showing 43 changed files with 567 additions and 1,572 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/IntegrationTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
fail-fast: false
matrix:
package:
- {user: TuringLang, repo: AdvancedPS.jl}
- {user: TuringLang, repo: Turing.jl}
- {user: TuringLang, repo: AdvancedPS.jl, ref: taped-libtask}
- {user: TuringLang, repo: Turing.jl, ref: master}

steps:
- uses: actions/checkout@v2
Expand All @@ -28,6 +28,7 @@ jobs:
uses: actions/checkout@v2
with:
repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
ref: ${{ matrix.package.ref }}
path: downstream
- name: Load this and run the downstream tests
shell: julia --color=yes --project=downstream {0}
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/MemLayoutGen.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/Testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,5 @@ jobs:
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- if: ${{ matrix.version == 'nightly' }}
run: julia --color=yes --project -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/JuliaBinaryWrappers/Libtask_jll.jl.git"))'
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
138 changes: 0 additions & 138 deletions .github/workflows/tasklayout/memlayout.cpp

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/tasklayout/memlayout.jl

This file was deleted.

7 changes: 3 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
license = "MIT"
desc = "C shim for task copying in Turing"
repo = "https://github.com/TuringLang/Libtask.jl.git"
version = "0.5.3"
version = "0.6"

[deps]
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Libtask_jll = "3ae2931a-708c-5973-9c38-ccf7496fb450"
IRTools = "7869d1d1-7146-5819-86e3-90919afe41df"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
Libtask_jll = "0.5.1"
julia = "1.3"

[extras]
Expand Down
22 changes: 10 additions & 12 deletions src/Libtask.jl
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
module Libtask

using Libdl
using Libtask_jll
using IRTools
using MacroTools

export CTask, consume, produce, TArray, tzeros, tfill, TRef
export CTask, consume, produce
export TArray, tzeros, tfill, TRef

function __init__()
@static if VERSION < v"1.6.0"
push!(Libdl.DL_LOAD_PATH,
Libtask_jll.get_libtask_julia_path() |> dirname)
Libdl.dlopen(Libtask_jll.libtask_julia_path)
end
end
export TapedTask

include("tapedfunction.jl")
include("tapedtask.jl")

include("memlayout/main.jl")
include("ctask.jl")
include("tarray.jl")
include("tref.jl")

CTask = TapedTask

end
Loading

2 comments on commit af47df9

@yebai
Copy link
Member

@yebai yebai commented on af47df9 Dec 12, 2021

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/50401

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.0 -m "<description of version>" af47df9530a861b44837f27f38491677ca9ad489
git push origin v0.6.0

Please sign in to comment.