Skip to content

Commit

Permalink
Revert "iree_gpu Python bindings (GPUPipelineOptionsAttr)" (iree-…
Browse files Browse the repository at this point in the history
…org#18833)

Reverts iree-org#18804

This broke local builds on Windows:
iree-org#18804 (comment).
  • Loading branch information
ScottTodd authored Oct 18, 2024
1 parent 5546ae0 commit df5e5aa
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 417 deletions.
1 change: 0 additions & 1 deletion compiler/bindings/c/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ cc_library(
name = "headers",
hdrs = [
"iree/compiler/api_support.h",
"iree/compiler/dialects/iree_gpu.h",
"iree/compiler/embedding_api.h",
"iree/compiler/loader.h",
"iree/compiler/mlir_interop.h",
Expand Down
1 change: 0 additions & 1 deletion compiler/bindings/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ iree_cc_library(
headers
HDRS
"iree/compiler/api_support.h"
"iree/compiler/dialects/iree_gpu.h"
"iree/compiler/embedding_api.h"
"iree/compiler/loader.h"
"iree/compiler/mlir_interop.h"
Expand Down
59 changes: 0 additions & 59 deletions compiler/bindings/c/iree/compiler/dialects/iree_gpu.h

This file was deleted.

20 changes: 0 additions & 20 deletions compiler/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,6 @@ declare_mlir_dialect_python_bindings(
DIALECT_NAME vm
)

declare_mlir_dialect_python_bindings(
ADD_TO_PARENT IREEPythonSources.Dialects
ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/iree/compiler"
TD_FILE dialects/IREEGPUBinding.td
GEN_ENUM_BINDINGS
SOURCES dialects/iree_gpu.py
DIALECT_NAME iree_gpu
)

declare_mlir_python_sources(IREECompilerAPIPythonCore
ADD_TO_PARENT IREEPythonSources
ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/iree/compiler"
Expand Down Expand Up @@ -174,17 +165,6 @@ declare_mlir_python_extension(IREECompilerPythonExtensions.Registration
LLVMSupport
)

declare_mlir_python_extension(IREECompilerPythonExtensions.CompilerDialects
MODULE_NAME _ireeCompilerDialects
ADD_TO_PARENT IREECompilerPythonExtensions
SOURCES
IREECompilerDialectsModule.cpp
EMBED_CAPI_LINK_LIBS
iree_compiler_API_SharedImpl
PRIVATE_LINK_LIBS
LLVMSupport
)

################################################################################
# Generate packages and shared library
################################################################################
Expand Down
123 changes: 0 additions & 123 deletions compiler/bindings/python/IREECompilerDialectsModule.cpp

This file was deleted.

12 changes: 0 additions & 12 deletions compiler/bindings/python/iree/compiler/dialects/IREEGPUBinding.td

This file was deleted.

9 changes: 0 additions & 9 deletions compiler/bindings/python/iree/compiler/dialects/iree_gpu.py

This file was deleted.

73 changes: 7 additions & 66 deletions compiler/bindings/python/test/ir/dialects_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,69 +7,10 @@
from iree.compiler import ir

# Make sure that our dialects import.
from iree.compiler.dialects import flow, hal, stream, vm, util, iree_gpu


@lambda _: _()
def gpu_pipeline_options_attr():
with ir.Context() as ctx, ir.Location.unknown():
module = ir.Module.create()
with ir.InsertionPoint(module.body):
reorder_attr = iree_gpu.ReorderWorkgroupsStrategyAttr.get(
iree_gpu.ReorderWorkgroupsStrategy.Swizzle, ctx
)
gpu_attr = iree_gpu.GPUPipelineOptionsAttr.get(
True,
False,
reorder_attr,
)
assert type(gpu_attr) is iree_gpu.GPUPipelineOptionsAttr
assert gpu_attr.prefetch_shared_memory
assert not gpu_attr.no_reduce_shared_memory_bank_conflicts

gpu_attr = iree_gpu.GPUPipelineOptionsAttr.get(
False,
True,
iree_gpu.ReorderWorkgroupsStrategyAttr.get(
iree_gpu.ReorderWorkgroupsStrategy.Transpose, ctx
),
)
assert not gpu_attr.prefetch_shared_memory
assert gpu_attr.no_reduce_shared_memory_bank_conflicts

gpu_attr = iree_gpu.GPUPipelineOptionsAttr.get()
assert (
gpu_attr.prefetch_shared_memory is None
and gpu_attr.no_reduce_shared_memory_bank_conflicts is None
and gpu_attr.reorder_workgroups_strategy is None
)

gpu_attr = iree_gpu.GPUPipelineOptionsAttr.get(True)
assert gpu_attr.prefetch_shared_memory
assert (
gpu_attr.no_reduce_shared_memory_bank_conflicts is None
and gpu_attr.reorder_workgroups_strategy is None
)

gpu_attr = iree_gpu.GPUPipelineOptionsAttr.get(True, False)
assert gpu_attr.reorder_workgroups_strategy is None

gpu_attr = iree_gpu.GPUPipelineOptionsAttr.get(
no_reduce_shared_memory_bank_conflicts=False
)
assert (
gpu_attr.no_reduce_shared_memory_bank_conflicts is not None
and not gpu_attr.no_reduce_shared_memory_bank_conflicts
)
assert gpu_attr.prefetch_shared_memory is None
assert gpu_attr.reorder_workgroups_strategy is None

gpu_attr = iree_gpu.GPUPipelineOptionsAttr.get(
reorder_workgroups_strategy=reorder_attr
)
assert gpu_attr.reorder_workgroups_strategy is not None
assert (
gpu_attr.reorder_workgroups_strategy.value
# unfortunately not `is`
== iree_gpu.ReorderWorkgroupsStrategy.Swizzle
)
from iree.compiler.dialects import (
flow,
hal,
stream,
vm,
util,
)
2 changes: 0 additions & 2 deletions compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ iree_compiler_cc_library(
":IREEGPUEnums",
":IREEGPUInterfaces",
":IREEGPUOpsGen",
"//compiler/bindings/c:headers",
"//compiler/src/iree/compiler/Codegen/Common:TileSwizzle",
"//compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR:IREECodegenDialect",
"//compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR:IREEVectorExtDialect",
Expand All @@ -93,7 +92,6 @@ iree_compiler_cc_library(
"@llvm-project//mlir:AffineDialect",
"@llvm-project//mlir:ArithDialect",
"@llvm-project//mlir:ArithUtils",
"@llvm-project//mlir:CAPIIR",
"@llvm-project//mlir:ControlFlowInterfaces",
"@llvm-project//mlir:DialectUtils",
"@llvm-project//mlir:IR",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ iree_cc_library(
MLIRAffineDialect
MLIRArithDialect
MLIRArithUtils
MLIRCAPIIR
MLIRControlFlowInterfaces
MLIRIR
MLIRLinalgDialect
Expand All @@ -68,7 +67,6 @@ iree_cc_library(
iree::compiler::Codegen::Dialect::VectorExt::IR::IREEVectorExtDialect
iree::compiler::Codegen::Utils::VectorOpUtils
iree::compiler::Dialect::LinalgExt::IR
iree::compiler::bindings::c::headers
PUBLIC
)

Expand Down
Loading

0 comments on commit df5e5aa

Please sign in to comment.