Skip to content

Commit

Permalink
Control flow support (#107)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Jan 27, 2022
1 parent 336f681 commit 679de09
Show file tree
Hide file tree
Showing 10 changed files with 275 additions and 259 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/BenchmarksAndMicroIntegration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
using Pkg
try
# force it to use this PR's version of the package
pkg"add Turing#master" # TODO: remove this when Turing is updated
pkg"add Turing#libtask-integration"
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
Pkg.update()
catch err
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/IntegrationTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
package:
- {user: TuringLang, repo: AdvancedPS.jl, ref: releases}
- {user: TuringLang, repo: Turing.jl, ref: hg/new-libtask2}
- {user: TuringLang, repo: Turing.jl, ref: libtask-integration}

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
license = "MIT"
desc = "Tape based task copying in Turing"
repo = "https://github.com/TuringLang/Libtask.jl.git"
version = "0.6.5"
version = "0.6.6"

[deps]
IRTools = "7869d1d1-7146-5819-86e3-90919afe41df"
Expand Down
8 changes: 4 additions & 4 deletions perf/p0.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ args = m.evaluator[2:end];
t = @btime Libtask.CTask(f, args...)
# schedule(t.task) # work fine!
# @show Libtask.result(t.tf)
@show "Step in a tape..."
@btime Libtask.step_in(t.tf, args)
@show "Run a tape..."
@btime t.tf(args...)

# Case 2: SMC sampler

Expand All @@ -43,5 +43,5 @@ m = Turing.Core.TracedModel(gdemo(1.5, 2.), Sampler(SMC(50)), VarInfo());
t = @btime Libtask.CTask(m.evaluator[1], m.evaluator[2:end]...);
# schedule(t.task)
# @show Libtask.result(t.tf.tape)
@show "Step in a tape..."
@btime Libtask.step_in(t.tf, m.evaluator[2:end])
@show "Run a tape..."
@btime t.tf(m.evaluator[2:end]...)
2 changes: 1 addition & 1 deletion perf/p2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ args = m.evaluator[2:end]

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

Libtask.step_in(t.tf, args)
t.tf(args...)

@show Libtask.result(t.tf)
Loading

2 comments on commit 679de09

@yebai
Copy link
Member

@yebai yebai commented on 679de09 Jan 27, 2022

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/53268

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.6 -m "<description of version>" 679de094952e9589da4c01465e7caa0aa4572a05
git push origin v0.6.6

Please sign in to comment.