From 3733d350377aeafbe8a6744bbe1e9c79e0ce2112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20S=C3=A1nchez=20Ram=C3=ADrez?= Date: Fri, 4 Oct 2024 15:39:07 -0400 Subject: [PATCH 1/2] Write Bazel rule for IFRT dialect --- deps/ReactantExtra/BUILD | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/deps/ReactantExtra/BUILD b/deps/ReactantExtra/BUILD index a60874e4..940b0141 100644 --- a/deps/ReactantExtra/BUILD +++ b/deps/ReactantExtra/BUILD @@ -514,6 +514,20 @@ gentbl_cc_library( tblgen = "//:mlir-jl-tblgen", ) +gentbl_cc_library( + name = "IFRTJLIncGen", + tbl_outs = [( + ["--generator=jl-op-defs", "--disable-module-wrap=0"], + "IFRT.inc.jl" + ) + ], + td_file = "@xla//xla/python/ifrt/ir:ifrt_ops.td", + deps = [ + "@xla//xla/python/ifrt/ir:ifrt_td", + ], + tblgen = "//:mlir-jl-tblgen", +) + genrule( name = "libMLIR_h.jl", tags = [ From 7a964067b57d3d46ae55b8b4688973a9df58eb51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20S=C3=A1nchez=20Ram=C3=ADrez?= Date: Fri, 4 Oct 2024 15:46:49 -0400 Subject: [PATCH 2/2] Format code --- deps/ReactantExtra/BUILD | 88 ++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/deps/ReactantExtra/BUILD b/deps/ReactantExtra/BUILD index 940b0141..f737d863 100644 --- a/deps/ReactantExtra/BUILD +++ b/deps/ReactantExtra/BUILD @@ -242,9 +242,9 @@ cc_library( "@xla//xla:xla_data.pb.cc", "@xla//xla/stream_executor:device_description.pb.cc", "@xla//xla/service:hlo.pb.cc", - # # "@tsl//tsl/protobuf:dnn.pb.cc", - #"@tsl//tsl/protobuf:histogram.pb.cc", - #"@tsl//tsl/protobuf:bfc_memory_map_proto",bfc_memory_map.pb.cc", + # "@tsl//tsl/protobuf:dnn.pb.cc", + # "@tsl//tsl/protobuf:histogram.pb.cc", + # "@tsl//tsl/protobuf:bfc_memory_map_proto",bfc_memory_map.pb.cc", "@xla//xla/service/gpu:backend_configs.pb.cc", "@xla//xla:autotuning.pb.cc", "@xla//xla:autotune_results.pb.cc", @@ -265,45 +265,45 @@ cc_library( linkopts = select({ "//conditions:default": [], "@bazel_tools//src/conditions:darwin": [ -"-Wl,-exported_symbol,_stablehlo*", -"-Wl,-exported_symbol,_mlir*", -"-Wl,-exported_symbol,_InitializeLogs", -"-Wl,-exported_symbol,_SetLogLevel", -"-Wl,-exported_symbol,_SetModuleLogLevel", -"-Wl,-exported_symbol,_GetDefaultTargetTriple", -"-Wl,-exported_symbol,_enzymeActivityAttrGet", -"-Wl,-exported_symbol,_MakeCPUClient", -"-Wl,-exported_symbol,_MakeGPUClient", -"-Wl,-exported_symbol,_MakeTPUClient", -"-Wl,-exported_symbol,_LoadPjrtPlugin", -"-Wl,-exported_symbol,_InitializePjrtPlugin", -"-Wl,-exported_symbol,_GetCApiClient", -"-Wl,-exported_symbol,_ClientNumDevices", -"-Wl,-exported_symbol,_ClientNumAddressableDevices", -"-Wl,-exported_symbol,_ClientProcessIndex", -"-Wl,-exported_symbol,_ClientGetDevice", -"-Wl,-exported_symbol,_ClientGetAddressableDevice", -"-Wl,-exported_symbol,_ExecutableFree", -"-Wl,-exported_symbol,_BufferToDevice", -"-Wl,-exported_symbol,_BufferToClient", -"-Wl,-exported_symbol,_DeviceToClient", -"-Wl,-exported_symbol,_PjRtBufferFree", -"-Wl,-exported_symbol,_UnsafeBufferPointer", -"-Wl,-exported_symbol,_ArrayFromHostBuffer", -"-Wl,-exported_symbol,_BufferOnCPU", -"-Wl,-exported_symbol,_CopyBufferToDevice", -"-Wl,-exported_symbol,_BufferToHost", -"-Wl,-exported_symbol,_FreeClient", -"-Wl,-exported_symbol,_ClientCompile", -"-Wl,-exported_symbol,_FreeFuture", -"-Wl,-exported_symbol,_FutureIsReady", -"-Wl,-exported_symbol,_FutureAwait", -"-Wl,-exported_symbol,_XLAExecute", -"-Wl,-exported_symbol,_RegisterDialects", -"-Wl,-exported_symbol,_InitializeRegistryAndPasses", + "-Wl,-exported_symbol,_stablehlo*", + "-Wl,-exported_symbol,_mlir*", + "-Wl,-exported_symbol,_InitializeLogs", + "-Wl,-exported_symbol,_SetLogLevel", + "-Wl,-exported_symbol,_SetModuleLogLevel", + "-Wl,-exported_symbol,_GetDefaultTargetTriple", + "-Wl,-exported_symbol,_enzymeActivityAttrGet", + "-Wl,-exported_symbol,_MakeCPUClient", + "-Wl,-exported_symbol,_MakeGPUClient", + "-Wl,-exported_symbol,_MakeTPUClient", + "-Wl,-exported_symbol,_LoadPjrtPlugin", + "-Wl,-exported_symbol,_InitializePjrtPlugin", + "-Wl,-exported_symbol,_GetCApiClient", + "-Wl,-exported_symbol,_ClientNumDevices", + "-Wl,-exported_symbol,_ClientNumAddressableDevices", + "-Wl,-exported_symbol,_ClientProcessIndex", + "-Wl,-exported_symbol,_ClientGetDevice", + "-Wl,-exported_symbol,_ClientGetAddressableDevice", + "-Wl,-exported_symbol,_ExecutableFree", + "-Wl,-exported_symbol,_BufferToDevice", + "-Wl,-exported_symbol,_BufferToClient", + "-Wl,-exported_symbol,_DeviceToClient", + "-Wl,-exported_symbol,_PjRtBufferFree", + "-Wl,-exported_symbol,_UnsafeBufferPointer", + "-Wl,-exported_symbol,_ArrayFromHostBuffer", + "-Wl,-exported_symbol,_BufferOnCPU", + "-Wl,-exported_symbol,_CopyBufferToDevice", + "-Wl,-exported_symbol,_BufferToHost", + "-Wl,-exported_symbol,_FreeClient", + "-Wl,-exported_symbol,_ClientCompile", + "-Wl,-exported_symbol,_FreeFuture", + "-Wl,-exported_symbol,_FutureIsReady", + "-Wl,-exported_symbol,_FutureAwait", + "-Wl,-exported_symbol,_XLAExecute", + "-Wl,-exported_symbol,_RegisterDialects", + "-Wl,-exported_symbol,_InitializeRegistryAndPasses", ]}), deps = [ - "@enzyme//:EnzymeMLIR", + "@enzyme//:EnzymeMLIR", "@llvm-project//mlir:AffineDialect", "@llvm-project//mlir:AllPassesAndDialects", "@llvm-project//mlir:ArithDialect", @@ -343,8 +343,8 @@ cc_library( "@xla//xla/service/cpu:cpu_transfer_manager", "@xla//xla/pjrt/gpu:se_gpu_pjrt_client", - - "@xla//xla/tsl/protobuf:protos_all_cc_impl", + + "@xla//xla/tsl/protobuf:protos_all_cc_impl", "@xla//xla/tsl/framework:allocator_registry_impl", "@xla//xla/pjrt:status_casters", @@ -353,7 +353,7 @@ cc_library( "@xla//xla/python/ifrt/hlo:hlo_program", "@xla//xla/ffi:call_frame", "@com_google_protobuf//:protobuf", - "@xla//xla/tsl/profiler/backends/cpu:annotation_stack_impl", + "@xla//xla/tsl/profiler/backends/cpu:annotation_stack_impl", "@xla//xla/tsl/profiler/backends/cpu:traceme_recorder_impl", "@xla//xla/tsl/profiler/utils:time_utils_impl", "@tsl//tsl/platform:env_impl", @@ -366,7 +366,7 @@ cc_library( "@com_google_absl//absl/log:globals", "@llvm-project//mlir:CAPIIRObjects", ] + select({ - "@xla//xla/tsl:is_cuda_enabled_and_oss":[ + "@xla//xla/tsl:is_cuda_enabled_and_oss":[ "@xla//xla/stream_executor/cuda:all_runtime", "@xla//xla/service/gpu/model:hlo_op_profiles", "@xla//xla/service/gpu/model:hlo_op_profile_proto_cc_impl",