Skip to content

Commit 679de09

Browse files
KDr2yebairikhuijzer
authored
Control flow support (#107)
* control flow support * revert the infinite loops * bugfix * Update CI scripts (#111) * Add refs to integration tests (#106) * Add refs to integration tests * Update .github/workflows/IntegrationTest.yml Co-authored-by: Hong Ge <[email protected]> * Update IntegrationTest.yml (#109) Co-authored-by: Rik Huijzer <[email protected]> * revise types * Update IntegrationTest.yml * Update BenchmarksAndMicroIntegration.yml * only try to eval Symbol and GlobalRef * refactor * fix Turing branch * Update IntegrationTest.yml * minor update * remove used var * code refactor * remove `step_in`, move copying functions * fix perf code * move cache mechanism into TapedFunction's constructor * Update Project.toml Co-authored-by: Hong Ge <[email protected]> Co-authored-by: Rik Huijzer <[email protected]>
1 parent 336f681 commit 679de09

File tree

10 files changed

+275
-259
lines changed

10 files changed

+275
-259
lines changed

Diff for: .github/workflows/BenchmarksAndMicroIntegration.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
using Pkg
2626
try
2727
# force it to use this PR's version of the package
28-
pkg"add Turing#master" # TODO: remove this when Turing is updated
28+
pkg"add Turing#libtask-integration"
2929
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
3030
Pkg.update()
3131
catch err

Diff for: .github/workflows/IntegrationTest.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
matrix:
1616
package:
1717
- {user: TuringLang, repo: AdvancedPS.jl, ref: releases}
18-
- {user: TuringLang, repo: Turing.jl, ref: hg/new-libtask2}
18+
- {user: TuringLang, repo: Turing.jl, ref: libtask-integration}
1919

2020
steps:
2121
- uses: actions/checkout@v2

Diff for: Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
33
license = "MIT"
44
desc = "Tape based task copying in Turing"
55
repo = "https://github.com/TuringLang/Libtask.jl.git"
6-
version = "0.6.5"
6+
version = "0.6.6"
77

88
[deps]
99
IRTools = "7869d1d1-7146-5819-86e3-90919afe41df"

Diff for: perf/p0.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ args = m.evaluator[2:end];
3030
t = @btime Libtask.CTask(f, args...)
3131
# schedule(t.task) # work fine!
3232
# @show Libtask.result(t.tf)
33-
@show "Step in a tape..."
34-
@btime Libtask.step_in(t.tf, args)
33+
@show "Run a tape..."
34+
@btime t.tf(args...)
3535

3636
# Case 2: SMC sampler
3737

@@ -43,5 +43,5 @@ m = Turing.Core.TracedModel(gdemo(1.5, 2.), Sampler(SMC(50)), VarInfo());
4343
t = @btime Libtask.CTask(m.evaluator[1], m.evaluator[2:end]...);
4444
# schedule(t.task)
4545
# @show Libtask.result(t.tf.tape)
46-
@show "Step in a tape..."
47-
@btime Libtask.step_in(t.tf, m.evaluator[2:end])
46+
@show "Run a tape..."
47+
@btime t.tf(m.evaluator[2:end]...)

Diff for: perf/p2.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ args = m.evaluator[2:end]
5858

5959
t = Libtask.CTask(f, args...)
6060

61-
Libtask.step_in(t.tf, args)
61+
t.tf(args...)
6262

6363
@show Libtask.result(t.tf)

0 commit comments

Comments
 (0)