Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Dec 17, 2024
1 parent 6121847 commit d62d01e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
1 change: 0 additions & 1 deletion deps/ReactantExtra/API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#include "xla/pjrt/pjrt_executable.h"
#include "xla/pjrt/pjrt_api.h"
#include "xla/pjrt/pjrt_c_api_client.h"
#include "xla/service/cpu/simple_orc_jit.h"

#include "xla/python/ifrt/hlo/hlo_program.h"
#include "llvm/MC/TargetRegistry.h"
Expand Down
25 changes: 22 additions & 3 deletions ext/ReactantCUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,29 @@ Reactant.@reactant_override @noinline function (func::LLVMFunc{F,tt})(args...; c

fname = Reactant.TracedUtils.get_attribute_by_name(func.entry, "sym_name")
# Force public for now while we don't have real users
MLIR.IR.rmattr!(func.entry, "sym_visibility")
# MLIR.IR.rmattr!(func.entry, "sym_visibility")

op_ty_results = IR.Type[result_0...,]
operands = Value[inputs...,]
owned_regions = MLIR.IR.Region[]
successors = MLIR.IR.Block[]
attributes = MLIR.IR.NamedAttribute[
MLIR.IR.namedattribute("fn", fname),
MLIR.IR.namedattribute("output_operand_aliases", output_operand_aliases)
]

location = MLIR.IR.Location()
call = MLIR.IR.create_operation(
"stablehlo.custom_call",
location;
mlir_args,
owned_regions,
successors,
attributes,
results=restys
result_inference=false,
)

call = MLIR.Dialects.stablehlo.custom_call(mlir_args; result_0=restys, call_target_name="reactant_gpu_call", output_operand_aliases, backend_config=MLIR.IR.Attribute(fname))
# call = MLIR.Dialects.stablehlo.custom_call(mlir_args; result_0=restys, call_target_name="reactant_gpu_call", output_operand_aliases, backend_config=MLIR.IR.Attribute(func.mod))
for (i, res) in enumerate(rarrays)
res.mlir_data = transpose_val(MLIR.IR.result(call, i))
end
Expand Down

0 comments on commit d62d01e

Please sign in to comment.