Skip to content

Commit

Permalink
Merge pull request #55 from dfdx/julia-1.10-only
Browse files Browse the repository at this point in the history
Julia 1.10 only
  • Loading branch information
dfdx authored Mar 21, 2024
2 parents 828988c + d188d0c commit 9b0d4fb
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

matrix:
version:
- '1.9'
- '1.10'
- '1'
os:
- ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Umlaut"
uuid = "92992a2b-8ce5-4a9c-bb9d-58be9a7dc841"
authors = ["Andrei Zhabinski <[email protected]>"]
version = "0.6.3"
version = "0.7.0"

[deps]
ExprTools = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
Expand All @@ -11,4 +11,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
ExprTools = "0.1"
julia = "1.9"
julia = "1.10"
5 changes: 3 additions & 2 deletions src/core.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Base.Experimental.@compiler_options optimize=0 compile=min infer=no

import Core: Argument, CodeInfo, GotoIfNot, GotoNode, ReturnNode, SSAValue, SlotNumber
using Core.Compiler: IRCode
import Core: CodeInfo, SSAValue, SlotNumber, Argument
import Core: GotoNode, GotoIfNot, ReturnNode
import Core.Compiler: IRCode
import Statistics, LinearAlgebra # include primitives from these standard modules
using ExprTools

Expand Down
13 changes: 12 additions & 1 deletion src/trace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ const VecOrTuple = Union{Tuple, Vector}
# Frame #
###############################################################################

# see https://github.com/dfdx/Umlaut.jl/issues/58
function new_exprs(ir::IRCode)
stmts = ir.new_nodes.stmts
if hasfield(typeof(stmts), :inst)
return stmts.inst
else
return stmts.stmt
end
end


"""
block_expressions(ir::IRCode)
Expand All @@ -25,7 +36,7 @@ Returns Vector{block_info}, where block_info is Vector{ssa_id => expr}
"""
function block_expressions(ir::IRCode)
# new statements
new_exs = ir.new_nodes.stmts.inst
new_exs = new_exprs(ir)
# where to insert them
new_positions = [(info.attach_after ? info.pos + 1 : info.pos)
for info in ir.new_nodes.info]
Expand Down
2 changes: 2 additions & 0 deletions test/test_trace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ end

# constructors
_, tape = trace(constructor_loss, 4.0)
@test tape[V(3)].val isa Point
@test_broken tape[V(4)].fn == __new__ # test broken in v1.10

# Exact code generated is version dependent -- either is fine.
@test(
Expand Down

0 comments on commit 9b0d4fb

Please sign in to comment.