8000 remove old copy of pass_pipeline and rename new one · IBMZ-Linux-OSS-Python/tensorflow@99b5904 · GitHub
[go: up one dir, main page]

Skip to content

Commit 99b5904

Browse files
ecalubaquibtensorflower-gardener
authored andcommitted
remove old copy of pass_pipeline and rename new one
PiperOrigin-RevId: 766479050
1 parent f2910a9 commit 99b5904

File tree

12 files changed

+38
-297
lines changed

12 files changed

+38
-297
lines changed

tensorflow/compiler/mlir/quantization/stablehlo/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ tf_cc_binary(
838838
":tf_passes",
839839
"//tensorflow/compiler/mlir:init_mlir",
840840
"//tensorflow/compiler/mlir/quantization/common/ir:QuantOps",
841-
"//tensorflow/compiler/mlir/quantization/stablehlo/cc:tf_pass_pipeline",
841+
"//tensorflow/compiler/mlir/quantization/stablehlo/cc:pass_pipeline",
842842
"//tensorflow/compiler/mlir/tensorflow",
843843
"//tensorflow/compiler/mlir/tensorflow/transforms:tensorflow_passes",
844844
"//tensorflow/compiler/mlir/tensorflow/transforms:tf_dialect_passes",

tensorflow/compiler/mlir/quantization/stablehlo/cc/BUILD

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ cc_library(
150150
compatible_with = get_compatible_with_portable(),
151151
deps = [
152152
":io",
153+
":pass_pipeline",
153154
":saved_model_import",
154-
":tf_pass_pipeline",
155155
":types",
156156
"//tensorflow/compiler/mlir/quantization/stablehlo:quantization_config_proto_cc",
157157
"//tensorflow/compiler/mlir/quantization/tensorflow:exported_model_proto_cc",
@@ -251,38 +251,17 @@ tf_cc_test(
251251
],
252252
)
253253

254-
cc_library(
255-
name = "tf_pass_pipeline",
256-
srcs = ["tf_pass_pipeline.cc"],
257-
hdrs = ["tf_pass_pipeline.h"],
258-
compatible_with = get_compatible_with_portable(),
259-
deps = [
260-
"//tensorflow/compiler/mlir/quantization/stablehlo:bridge_passes",
261-
"//tensorflow/compiler/mlir/quantization/stablehlo:quantization_config_proto_cc",
262-
"//tensorflow/compiler/mlir/quantization/stablehlo:tf_passes",
263-
"//tensorflow/compiler/mlir/quantization/tensorflow:quantization_options_proto_cc",
264-
"//tensorflow/compiler/mlir/quantization/tensorflow:tf_passes",
265-
"//tensorflow/compiler/mlir/tensorflow/transforms:tensorflow_passes",
266-
"@llvm-project//mlir:FuncDialect",
267-
"@llvm-project//mlir:Pass",
268-
"@llvm-project//mlir:ReconcileUnrealizedCasts",
269-
"@llvm-project//mlir:Transforms",
270-
"@local_xla//xla/mlir_hlo:mhlo_passes",
271-
"@stablehlo//:stablehlo_passes",
272-
],
273-
)
274-
275254
cc_library(
276255
name = "pass_pipeline",
277256
srcs = ["pass_pipeline.cc"],
278257
hdrs = ["pass_pipeline.h"],
279258
compatible_with = get_compatible_with_portable(),
280259
deps = [
281260
"//tensorflow/compiler/mlir/quantization/stablehlo:bridge_passes",
282-
"//tensorflow/compiler/mlir/quantization/stablehlo:passes",
283261
"//tensorflow/compiler/mlir/quantization/stablehlo:quantization_config_proto_cc",
284-
"//tensorflow/compiler/mlir/quantization/tensorflow:passes",
262+
"//tensorflow/compiler/mlir/quantization/stablehlo:tf_passes",
285263
"//tensorflow/compiler/mlir/quantization/tensorflow:quantization_options_proto_cc",
264+
"//tensorflow/compiler/mlir/quantization/tensorflow:tf_passes",
286265
"//tensorflow/compiler/mlir/tensorflow/transforms:tensorflow_passes",
287266
"@llvm-project//mlir:FuncDialect",
288267
"@llvm-project//mlir:Pass",
@@ -304,7 +283,7 @@ cc_library(
304283
],
305284
deps = [
306285
":component",
307-
":tf_pass_pipeline",
286+
":pass_pipeline",
308287
"//tensorflow/compiler/mlir/quantization/stablehlo:quantization_config_proto_cc",
309288
"//tensorflow/compiler/mlir/quantization/tensorflow:quantization_options_proto_cc",
310289
"//tensorflow/compiler/mlir/quantization/tensorflow:tf_passes",
@@ -419,7 +398,7 @@ cc_library(
419398
deps = [
420399
":component",
421400
":config",
422-
":tf_pass_pipeline",
401+
":pass_pipeline",
423402
"//tensorflow/compiler/mlir/quantization/stablehlo:quantization_config_proto_cc",
424403
"//tensorflow/compiler/mlir/quantization/stablehlo/instrumentations:save_report",
425404
"//tensorflow/compiler/mlir/quantization/tensorflow:tf_passes",
@@ -478,9 +457,9 @@ cc_library(
478457
":component",
479458
":config",
480459
":context",
460+
":pass_pipeline",
481461
":saved_model_export",
482462
":saved_model_import",
483-
":tf_pass_pipeline",
484463
":types",
485464
"//tensorflow/compiler/mlir/quantization/stablehlo:quantization_config_proto_cc",
486465
"//tensorflow/compiler/mlir/quantization/stablehlo/instrumentations:save_report",

tensorflow/compiler/mlir/quantization/stablehlo/cc/pass_pipeline.cc

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,32 @@ limitations under the License.
2121
#include "mlir/Transforms/Passes.h" // from @llvm-project
2222
#include "stablehlo/transforms/Passes.h" // from @stablehlo
2323
#include "tensorflow/compiler/mlir/quantization/stablehlo/passes/bridge/passes.h"
24-
#include "tensorflow/compiler/mlir/quantization/stablehlo/passes/passes.h"
24+
#include "tensorflow/compiler/mlir/quantization/stablehlo/passes/tf_passes.h"
2525
#include "tensorflow/compiler/mlir/quantization/stablehlo/quantization_config.pb.h"
26-
#include "tensorflow/compiler/mlir/quantization/tensorflow/passes/passes.h"
26+
#include "tensorflow/compiler/mlir/quantization/tensorflow/passes/tf_passes.h"
2727
#include "tensorflow/compiler/mlir/tensorflow/transforms/passes.h"
2828
#include "xla/mlir_hlo/mhlo/transforms/passes.h"
2929

3030
namespace mlir::quant::stablehlo {
3131

32+
using ::mlir::tf_quant::stablehlo::
33+
createConvertShapeToStablehloWithConstraintsPass;
34+
using ::mlir::tf_quant::stablehlo::createDeferActivationTransposePass;
35+
using ::mlir::tf_quant::stablehlo::createFoldConstantTransposePass;
36+
using ::mlir::tf_quant::stablehlo::CreateLiftQuantizableSpotsAsFunctionsPass;
37+
using ::mlir::tf_quant::stablehlo::createNchwConvolutionToNhwcPass;
38+
using ::mlir::tf_quant::stablehlo::
39+
createReplaceStablehloOpsInMainFunctionWithXlaCallModuleOpsPass;
40+
using ::mlir::tf_quant::stablehlo::createRestoreFunctionNamePass;
41+
using ::mlir::tf_quant::stablehlo::createUnwrapXlaCallModuleOpPass;
42+
using ::mlir::tf_quant::stablehlo::QuantizeCompositeFunctionsPassOptions;
3243
using ::stablehlo::quantization::CalibrationOptions;
3344
using ::stablehlo::quantization::DebuggerConfig;
3445
using ::stablehlo::quantization::PipelineConfig;
3546
using ::stablehlo::quantization::QuantizationSpecs;
47+
using tf_quant::CreateAddDumpTensorOpPass;
48+
using tf_quant::CreateConvertCustomAggregationOpToQuantStatsPass;
49+
using tf_quant::CreateInsertCustomAggregationOpsPass;
3650

3751
void AddPreCalibrationPasses(OpPassManager& pm,
3852
const CalibrationOptions& calibration_options,

tensorflow/compiler/mlir/quantization/stablehlo/cc/post_calibration.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ limitations under the License.
2222
#include "mlir/IR/BuiltinOps.h" // from @llvm-project
2323
#include "mlir/Pass/PassManager.h" // from @llvm-project
2424
#include "tensorflow/compiler/mlir/quantization/stablehlo/cc/config.h"
25-
#include "tensorflow/compiler/mlir/quantization/stablehlo/cc/tf_pass_pipeline.h"
25+
#include "tensorflow/compiler/mlir/quantization/stablehlo/cc/pass_pipeline.h"
2626
#include "tensorflow/compiler/mlir/quantization/stablehlo/instrumentations/save_report.h"
2727
#include "tensorflow/compiler/mlir/quantization/stablehlo/quantization_config.pb.h"
2828
#include "tensorflow/compiler/mlir/quantization/tensorflow/cc/run_passes.h"
@@ -51,8 +51,8 @@ absl::StatusOr<ModuleOp> PostCalibrationComponent::Run(
5151
std::make_unique<SaveQuantizationReportInstrumentation>(
5252
GetReportFilePath(config)));
5353

54-
tf_quant::stablehlo::AddPostCalibrationPasses(
55-
pm, config.pipeline_config(), config.specs());
54+
quant::stablehlo::AddPostCalibrationPasses(pm, config.pipeline_config(),
55+
config.specs());
5656
},
5757
*ctx_, module_op));
5858
return module_op;
@@ -61,7 +61,7 @@ absl::StatusOr<ModuleOp> PostCalibrationComponent::Run(
6161
void PostCalibrationComponent::AddPasses(
6262
OpPassManager& pm, const QuantizationSpecs& specs,
6363
const PipelineConfig& pipeline_config) const {
64-
tf_quant::stablehlo::AddPostCalibrationPasses(pm, pipeline_config, specs);
64+
quant::stablehlo::AddPostCalibrationPasses(pm, pipeline_config, specs);
6565
}
6666

6767
} // namespace mlir::quant::stablehlo

tensorflow/compiler/mlir/quantization/stablehlo/cc/pre_calibration.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ limitations under the License.
1919
#include "absl/status/statusor.h"
2020
#include "mlir/IR/BuiltinOps.h" // from @llvm-project
2121
#include "mlir/Pass/PassManager.h" // from @llvm-project
22-
#include "tensorflow/compiler/mlir/quantization/stablehlo/cc/tf_pass_pipeline.h"
22+
#include "tensorflow/compiler/mlir/quantization/stablehlo/cc/pass_pipeline.h"
2323
#include "tensorflow/compiler/mlir/quantization/stablehlo/quantization_config.pb.h"
2424
#include "tensorflow/compiler/mlir/quantization/tensorflow/cc/run_passes.h"
2525
#include "tensorflow/compiler/mlir/quantization/tensorflow/quantization_options.pb.h"
@@ -38,7 +38,7 @@ absl::StatusOr<ModuleOp> PreCalibrationComponent::Run(
3838
TF_RETURN_IF_ERROR(RunPasses(
3939
kName, /*add_passes_func=*/
4040
[&config](PassManager& pm) {
41-
tf_quant::stablehlo::AddPreCalibrationPasses(
41+
quant::stablehlo::AddPreCalibrationPasses(
4242
pm, config.calibration_options(), config.specs(),
4343
config.debugger_config());
4444
},

tensorflow/compiler/mlir/quantization/stablehlo/cc/saved_model_export.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ limitations under the License.
3737
#include "mlir/Support/LLVM.h" // from @llvm-project
3838
#include "mlir/Support/LogicalResult.h" // from @llvm-project
3939
#include "tensorflow/compiler/mlir/quantization/stablehlo/cc/io.h"
40-
#include "tensorflow/compiler/mlir/quantization/stablehlo/cc/tf_pass_pipeline.h"
40+
#include "tensorflow/compiler/mlir/quantization/stablehlo/cc/pass_pipeline.h"
4141
#include "tensorflow/compiler/mlir/quantization/stablehlo/cc/types.h"
4242
#include "tensorflow/compiler/mlir/quantization/stablehlo/quantization_config.pb.h"
4343
#include "tensorflow/compiler/mlir/quantization/tensorflow/cc/convert_asset_args.h"
@@ -175,7 +175,7 @@ ExportedModel CreateExportedModelFromGraphDef(
175175

176176
void AddExportPasses(mlir::PassManager& pm,
177177
const bool duplicate_shape_determining_constants) {
178-
tf_quant::stablehlo::AddCallModuleSerializationPasses(pm);
178+
quant::stablehlo::AddCallModuleSerializationPasses(pm);
179179
if (duplicate_shape_determining_constants) {
180180
pm.addNestedPass<mlir::func::FuncOp>(
181181
mlir::tf_quant::CreateDuplicateShapeDeterminingConstantsPass());

tensorflow/compiler/mlir/quantization/stablehlo/cc/tf_pass_pipeline.cc

Lines changed: 0 additions & 177 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0