Skip to content

Commit d2f10ee

Browse files
avik-palwsmoses
andauthored
feat: missing upstream passes + rocm jll (#1835)
* feat: missing upstream passes * chore: update Reactant_jll version to 0.0.258 * ci: run on AMDGPU ci * Update Reactant_jll version in Project.toml * Update Reactant_jll version in Project.toml * ci: disable amdgpu ci for now Comment out the Julia CI job configuration in the pipeline. * Apply suggestion from @avik-pal * fix: force a raising pass after enzyme is run --------- Co-authored-by: William Moses <wmoses@google.com>
1 parent daf2ea0 commit d2f10ee

File tree

3 files changed

+35
-9
lines changed

3 files changed

+35
-9
lines changed

.buildkite/pipeline.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,47 @@ steps:
4848
if: build.message !~ /\[skip tests\]/
4949
timeout_in_minutes: 120
5050

51-
# - label: "AMDGPU Julia v{{matrix.version}}"
51+
# - label: ":julia: :linux: AMDGPU Julia v{{matrix.version}} -- {{matrix.group}} -- {{matrix.runtime}}"
5252
# matrix:
5353
# setup:
5454
# version:
5555
# - "1.10"
56+
# group:
57+
# - core
58+
# - neural_networks
59+
# - integration
60+
# runtime:
61+
# - "IFRT"
5662
# plugins:
5763
# - JuliaCI/julia#v1:
5864
# version: "{{matrix.version}}"
59-
# - JuliaCI/julia-test#v1:
60-
# test_args: "--gpu"
6165
# - JuliaCI/julia-coverage#v1:
6266
# codecov: true
6367
# dirs:
6468
# - src
6569
# - ext
70+
# - lib/ReactantCore/src
6671
# agents:
6772
# queue: "juliagpu"
6873
# rocm: "*"
69-
# if: build.message !~ /\[skip tests\]/
70-
# timeout_in_minutes: 60
74+
# commands: |
75+
# touch LocalPreferences.toml
76+
77+
# echo "[Reactant]" >> LocalPreferences.toml
78+
# echo "xla_runtime = \"{{matrix.runtime}}\"" >> LocalPreferences.toml
79+
80+
# cat LocalPreferences.toml
81+
82+
# julia --project=. -e 'println("--- :julia: Instantiating project")
83+
# using Pkg
84+
# Pkg.develop([PackageSpec(path="lib/ReactantCore")])'
85+
86+
# julia --project=. -e 'println("--- :julia: Run Tests")
87+
# using Pkg
88+
# Pkg.test(; coverage="user")'
89+
# env:
90+
# REACTANT_TEST_GROUP: "{{matrix.group}}"
91+
# JULIA_DEBUG: "Reactant,Reactant_jll"
92+
# CUDA_VISIBLE_DEVICES: 0
93+
# if: build.message !~ /\[skip tests\]/
94+
# timeout_in_minutes: 120

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ PythonCall = "0.9.25"
105105
Random = "1.10"
106106
Random123 = "1.7"
107107
ReactantCore = "0.1.16"
108-
Reactant_jll = "0.0.257"
108+
Reactant_jll = "0.0.258"
109109
ScopedValues = "1.3.0"
110110
Scratch = "1.2"
111111
Sockets = "1.10"

src/Compiler.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -905,10 +905,9 @@ function optimization_passes(
905905
"self_mul_to_convolution_like($(Int(backend == "tpu")))",
906906
"subtract_multiply_const_to_add_mul_const",
907907
"trivial_reduce_window_to_reduce_op",
908+
"case_to_if",
908909
"dot_general_add_distributive_simplify",
909910
"dot_general_subtract_distributive_simplify",
910-
"dus_to_dynamic_pad",
911-
"dynamic_pad_to_pad",
912911
"remove_no_ops_from_while_loop",
913912
"while_is_copy_simplify",
914913
"split_variadic_scatter_op",
@@ -960,6 +959,7 @@ function optimization_passes(
960959
"dot_general_licm(0)",
961960
"reduce_licm(0)",
962961
"reduce_window_licm(0)",
962+
"reverse_licm(0)",
963963
],
964964
)
965965
end
@@ -1029,6 +1029,8 @@ function optimization_passes(
10291029
"rotate_pad",
10301030
"concat_multipad",
10311031
"speculate_if_pad_to_select",
1032+
"dus_to_dynamic_pad",
1033+
"dynamic_pad_to_pad",
10321034
],
10331035
)
10341036

@@ -1315,7 +1317,7 @@ end
13151317

13161318
# TODO we want to be able to run the more advanced passes via transform dialect as an enzyme intermediate
13171319
# However, this errs as we cannot attach the transform with to the funcop itself [as we run a functionpass].
1318-
const enzyme_pass::String = "enzyme{postpasses=\"arith-raise{stablehlo=true},canonicalize,cse,canonicalize,remove-unnecessary-enzyme-ops,enzyme-simplify-math,canonicalize,cse,canonicalize\"}"
1320+
const enzyme_pass::String = "enzyme{postpasses=\"arith-raise{stablehlo=true},canonicalize,cse,canonicalize,remove-unnecessary-enzyme-ops,enzyme-simplify-math,canonicalize,cse,canonicalize,arith-raise{stablehlo=true}\"}"
13191321

13201322
function run_pass_pipeline!(mod, pass_pipeline, key=""; enable_verifier=true)
13211323
pm = MLIR.IR.PassManager()

0 commit comments

Comments
 (0)