Skip to content

Commit af47df9

Browse files
KDr2yebai
andauthored
Use recorded tape to impl task copying (#93)
* 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 <hg344@cam.ac.uk>
1 parent 7c404c4 commit af47df9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+567
-1572
lines changed

.github/workflows/IntegrationTest.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
package:
17-
- {user: TuringLang, repo: AdvancedPS.jl}
18-
- {user: TuringLang, repo: Turing.jl}
17+
- {user: TuringLang, repo: AdvancedPS.jl, ref: taped-libtask}
18+
- {user: TuringLang, repo: Turing.jl, ref: master}
1919

2020
steps:
2121
- uses: actions/checkout@v2
@@ -28,6 +28,7 @@ jobs:
2828
uses: actions/checkout@v2
2929
with:
3030
repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
31+
ref: ${{ matrix.package.ref }}
3132
path: downstream
3233
- name: Load this and run the downstream tests
3334
shell: julia --color=yes --project=downstream {0}

.github/workflows/MemLayoutGen.yaml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/Testing.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,5 @@ jobs:
4141
${{ runner.os }}-test-${{ env.cache-name }}-
4242
${{ runner.os }}-test-
4343
${{ runner.os }}-
44-
- if: ${{ matrix.version == 'nightly' }}
45-
run: julia --color=yes --project -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/JuliaBinaryWrappers/Libtask_jll.jl.git"))'
4644
- uses: julia-actions/julia-buildpkg@latest
4745
- uses: julia-actions/julia-runtest@latest

.github/workflows/tasklayout/memlayout.cpp

Lines changed: 0 additions & 138 deletions
This file was deleted.

.github/workflows/tasklayout/memlayout.jl

Lines changed: 0 additions & 32 deletions
This file was deleted.

Project.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
33
license = "MIT"
44
desc = "C shim for task copying in Turing"
55
repo = "https://github.com/TuringLang/Libtask.jl.git"
6-
version = "0.5.3"
6+
version = "0.6"
77

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

1414
[compat]
15-
Libtask_jll = "0.5.1"
1615
julia = "1.3"
1716

1817
[extras]

src/Libtask.jl

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
module Libtask
22

3-
using Libdl
4-
using Libtask_jll
3+
using IRTools
4+
using MacroTools
55

6-
export CTask, consume, produce, TArray, tzeros, tfill, TRef
6+
export CTask, consume, produce
7+
export TArray, tzeros, tfill, TRef
78

8-
function __init__()
9-
@static if VERSION < v"1.6.0"
10-
push!(Libdl.DL_LOAD_PATH,
11-
Libtask_jll.get_libtask_julia_path() |> dirname)
12-
Libdl.dlopen(Libtask_jll.libtask_julia_path)
13-
end
14-
end
9+
export TapedTask
10+
11+
include("tapedfunction.jl")
12+
include("tapedtask.jl")
1513

16-
include("memlayout/main.jl")
17-
include("ctask.jl")
1814
include("tarray.jl")
1915
include("tref.jl")
2016

17+
CTask = TapedTask
18+
2119
end

0 commit comments

Comments
 (0)