Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Apr 14, 2024
1 parent 3858cee commit 797b8f4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,15 @@ jobs:
if: ${{ matrix.libReactant == 'local' && matrix.os != 'macOS-latest'}}
id: build_libreactant
run: |
python -m pip install numpy
julia --project=deps -e 'using Pkg; Pkg.instantiate()'
julia --project=deps deps/build_local.jl
cp LocalPreferences.toml test/
- name: Build libReactant MacOS
if: ${{ matrix.libReactant == 'local' && matrix.os == 'macOS-latest'}}
id: build_libreactant_mac
run: |
python -m pip install numpy
julia --project=deps -e 'using Pkg; Pkg.instantiate()'
SDKROOT=`xcrun --show-sdk-path` julia --project=deps deps/build_local.jl
cp LocalPreferences.toml test/
Expand Down
5 changes: 4 additions & 1 deletion deps/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
Scratch = "6c6a2e73-6563-6170-7368-637461726353"
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"
BinaryBuilderBase = "7f725544-6523-48cd-82d1-3fa08ff4056e"
BinaryBuilderBase = "7f725544-6523-48cd-82d1-3fa08ff4056e"

[compat]
Clang = "0.18"
5 changes: 4 additions & 1 deletion deps/ReactantExtra/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[deps]
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"
BinaryBuilderBase = "7f725544-6523-48cd-82d1-3fa08ff4056e"
BinaryBuilderBase = "7f725544-6523-48cd-82d1-3fa08ff4056e"

[compat]
Clang = "0.18"
2 changes: 1 addition & 1 deletion deps/build_local.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Pkg.activate(; temp=true)
# Build!
@info "Building" source_dir scratch_dir
run(`mkdir -p $(scratch_dir)`)
run(Cmd(`$(Base.julia_cmd().exec[1]) --project=. -e "using Pkg; Pkg.instantiate(); Pkg.add(url=\"https://github.com/JuliaInterop/Clang.jl\", rev=\"vc/cxx_parse2\")"`, dir=source_dir))
run(Cmd(`$(Base.julia_cmd().exec[1]) --project=. -e "using Pkg; Pkg.instantiate()"`, dir=source_dir))
run(Cmd(`bazel build -c dbg --action_env=JULIA=$(Base.julia_cmd().exec[1]) --check_visibility=false ...`, dir=source_dir))

# Discover built libraries
Expand Down
4 changes: 4 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
Reactant_jll = "0192cb87-2b54-54ad-80e0-3be72ad8a3c0"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
10 changes: 5 additions & 5 deletions test/bcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ end


mutable struct Data
v::(Reactant.TracedRArray{Float64, S,2} where S)
v::(Reactant.TracedRArray{Float64, S,1} where S)
end
@noinline function tmp(a, b, d)
@show d
Expand All @@ -34,7 +34,7 @@ function test()
mod = MLIR.IR.Module(MLIR.IR.Location())
modbody = MLIR.IR.body(mod)

in_tys = [MLIR.IR.TensorType([2,2], MLIR.IR.Type(Float64))]
in_tys = [MLIR.IR.TensorType([4,], MLIR.IR.Type(Float64))]

func = MLIR.Dialects.func.func_(; sym_name="main_tmp", function_type=MLIR.IR.FunctionType(in_tys, []), body=MLIR.IR.Region())

Expand All @@ -45,9 +45,9 @@ function test()

GC.@preserve mod func fnbody begin
MLIR.IR.block!(fnbody) do
a = ones(2,2)
b = ones(2,2)
d = Data(Reactant.TracedRArray{Float64, (2,2),2}((), MLIR.IR.argument(fnbody, 1)))
a = ones(4)
b = ones(4)
d = Data(Reactant.TracedRArray{Float64, (4,),1}((), MLIR.IR.argument(fnbody, 1)))

tmp(a, b, d)
end
Expand Down

0 comments on commit 797b8f4

Please sign in to comment.