Skip to content

Commit

Permalink
[Mosaic GPU] Delete unused declarations of `mosaic_gpu_memcpy_async_h…
Browse files Browse the repository at this point in the history
…2d`.

PiperOrigin-RevId: 716616807
  • Loading branch information
bchetioui authored and Google-ML-Automation committed Jan 17, 2025
1 parent d34c40f commit d3be190
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
4 changes: 0 additions & 4 deletions jax/experimental/mosaic/gpu/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,6 @@ def _declare_runtime_functions():
func.FuncOp(
"mosaic_gpu_init_tma_desc", init_tma_desc_type, visibility="private"
)
memcpy_async_type = ir.FunctionType.get([ptr_ty, ptr_ty, i64, ptr_ty], [])
func.FuncOp(
"mosaic_gpu_memcpy_async_h2d", memcpy_async_type, visibility="private"
)


def as_gpu_kernel(
Expand Down
6 changes: 0 additions & 6 deletions jaxlib/mosaic/dialect/gpu/mosaic_gpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,6 @@ void DeclareRuntimeFunctions(mlir::OpBuilder& builder) {
builder.getFunctionType(
TypeRange{ptr, ptr, i64, i64, ptr, ptr, i64, ptr}, TypeRange{}))
.setVisibility(mlir::func::FuncOp::Visibility::Private);

builder
.create<mlir::func::FuncOp>(
builder.getUnknownLoc(), kRuntimeMemcpyAsyncH2DName,
builder.getFunctionType(TypeRange{ptr, ptr, i64, ptr}, TypeRange{}))
.setVisibility(mlir::func::FuncOp::Visibility::Private);
}

bool IsContiguous(mlir::MemRefType type) {
Expand Down
2 changes: 0 additions & 2 deletions jaxlib/mosaic/dialect/gpu/mosaic_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ struct GlobalMemory : public mlir::SideEffects::Resource::Base<GlobalMemory> {

constexpr absl::string_view kRuntimeTmaDescriptorInitializerName =
"mosaic_gpu_init_tma_desc";
constexpr absl::string_view kRuntimeMemcpyAsyncH2DName =
"mosaic_gpu_memcpy_async_h2d";

template <typename T>
std::string MlirToString(T&& value) {
Expand Down
8 changes: 4 additions & 4 deletions jaxlib/mosaic/dialect/gpu/mosaic_gpu_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,16 @@ TEST_F(MosaicGpuTest, RuntimeFunctionsAreRegistered) {

llvm::SmallVector<mlir::func::FuncOp> func_ops =
llvm::to_vector(module_op->getBody()->getOps<mlir::func::FuncOp>());
EXPECT_EQ(func_ops.size(), 2);
EXPECT_EQ(func_ops.size(), 1);

absl::flat_hash_set<std::string> func_names;
for (mlir::func::FuncOp& func_op : func_ops) {
func_names.insert(func_op.getSymName().str());
}

EXPECT_THAT(func_names, UnorderedElementsAre(
mosaic_gpu::kRuntimeTmaDescriptorInitializerName,
mosaic_gpu::kRuntimeMemcpyAsyncH2DName));
EXPECT_THAT(
func_names,
UnorderedElementsAre(mosaic_gpu::kRuntimeTmaDescriptorInitializerName));
}


Expand Down

0 comments on commit d3be190

Please sign in to comment.