├── .bazelrc ├── .bazelversion ├── .clang-format ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── amd.yml │ ├── auto_rebase.yml │ ├── d2_trt_bench.yml │ ├── pytorch113_cpu.yml │ ├── pytorch113_gpu.yml │ ├── pytorch113_yitian.yml │ ├── pytorch200_cpu.yml │ ├── pytorch200_yitian.yml │ ├── pytorch201_gpu.yml │ ├── resuable_cpu_build.yml │ ├── resuable_gpu_build.yml │ ├── reusable.yml │ ├── tf250_cpu.yml │ ├── tf250_gpu.yml │ ├── tf280_yitian.yml │ ├── torchbench.yml │ └── torchbench_cpu.yml ├── .gitignore ├── .gitmodules ├── .pre-commit-config.yaml ├── LICENSE ├── README.md ├── RELEASE.md ├── VERSION ├── conf.py ├── docker ├── cronjobs │ ├── Dockerfile.dummy │ ├── Dockerfile.torch.bench │ ├── Dockerfile.torch.bench.aarch64 │ └── Dockerfile.torch.ngc ├── dev │ ├── Dockerfile │ ├── Dockerfile.aarch64 │ ├── Dockerfile.rocm5.2 │ └── ROCM-HOST-TF2.9-PATCH.patch ├── runtime │ ├── Dockerfile.pytorch │ ├── Dockerfile.pytorch.aarch64 │ ├── Dockerfile.tf │ ├── Dockerfile.tf.aarch64 │ └── Dockerfile.tf_blade └── scripts │ ├── find-fastest-apt.sh │ ├── install-bazel.sh │ ├── install-cmake.sh │ ├── install-cudnn.sh │ ├── install-python-aarch64.sh │ ├── install-python.sh │ ├── install-tensorrt.sh │ └── ubuntu20.04.list ├── docs ├── build_from_source.md ├── contribution.md ├── design │ ├── images │ │ ├── ltc_disc_overview.png │ │ ├── shape-constraint-pass-workflow.png │ │ ├── split_op_example.png │ │ └── symbolic_shape_analysis_example.png │ ├── ltc_disc.md │ └── shape_constraint_ir.md ├── developers │ ├── add_custom_call.md │ ├── bladedisc_torch_overview.md │ ├── pass_pipeline.md │ ├── pics │ │ ├── RAL.png │ │ ├── Torch-MLIR-MHLO.png │ │ ├── bladedisc_torch_arch.png │ │ ├── bladedisc_torch_overview.jpg │ │ ├── fusion_codegen.png │ │ └── pass_pipeline.png │ ├── runtime_abstraction_layer.md │ └── torch_add_a_new_operator.md ├── html_docs │ ├── Makefile │ ├── README.md │ ├── build │ │ └── html │ │ │ └── .nojekyll │ ├── requirements.txt │ └── workaround_passpipeline_html.sh ├── install_with_docker.md ├── papers │ └── asplos-22-zhenzheng.pdf ├── pics │ ├── dingtalk_support.png │ ├── numbers.png │ ├── v0.3.0_torch_benchmark.png │ └── v0.3.0_torch_mlir_commits.jpeg ├── quickstart.md └── tutorials │ ├── index.rst │ ├── tensorflow_inference_and_training.md │ └── torch_bert_inference.md ├── examples ├── PyTorch │ ├── Inference │ │ ├── CPU │ │ │ └── albert │ │ │ │ ├── README.md │ │ │ │ ├── main.py │ │ │ │ ├── requirements.txt │ │ │ │ └── test.sh │ │ ├── CUDA │ │ │ ├── AlphaFold │ │ │ │ ├── FoldAcc │ │ │ │ │ ├── foldacc │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ ├── fold │ │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ │ ├── openfold.py │ │ │ │ │ │ │ └── unifold.py │ │ │ │ │ │ ├── foldacc.py │ │ │ │ │ │ ├── model │ │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ │ ├── distributed │ │ │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ │ │ └── comm.py │ │ │ │ │ │ │ ├── modules │ │ │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ │ │ ├── embedder.py │ │ │ │ │ │ │ │ ├── evoformer.py │ │ │ │ │ │ │ │ ├── msa.py │ │ │ │ │ │ │ │ ├── ops.py │ │ │ │ │ │ │ │ ├── outer_product_mean.py │ │ │ │ │ │ │ │ ├── structure_module.py │ │ │ │ │ │ │ │ ├── template.py │ │ │ │ │ │ │ │ ├── triangle.py │ │ │ │ │ │ │ │ └── utils.py │ │ │ │ │ │ │ ├── optimize.py │ │ │ │ │ │ │ └── utils.py │ │ │ │ │ │ └── optimization │ │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ │ ├── auto_mix_precision_optimize.py │ │ │ │ │ │ │ ├── bladedisc_optimize.py │ │ │ │ │ │ │ ├── distributed │ │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ │ ├── convert.py │ │ │ │ │ │ │ ├── kernel │ │ │ │ │ │ │ │ └── custom.cpp │ │ │ │ │ │ │ └── utils.py │ │ │ │ │ │ │ ├── run_bladedisc.py │ │ │ │ │ │ │ ├── torchscript_optimize.py │ │ │ │ │ │ │ └── utils.py │ │ │ │ │ └── setup.py │ │ │ │ ├── README.md │ │ │ │ ├── openfold_inference.py │ │ │ │ ├── pics │ │ │ │ │ ├── foldacc_speed.png │ │ │ │ │ └── unifold_foldacc.png │ │ │ │ └── unifold_inference.py │ │ │ ├── BERT │ │ │ │ ├── README.md │ │ │ │ ├── main.py │ │ │ │ ├── requirements.txt │ │ │ │ └── test.sh │ │ │ ├── ResNet │ │ │ │ ├── README.md │ │ │ │ ├── main.py │ │ │ │ ├── requirements.txt │ │ │ │ └── test.sh │ │ │ ├── S2T │ │ │ │ ├── README.md │ │ │ │ ├── main.py │ │ │ │ ├── requirements.txt │ │ │ │ └── test.sh │ │ │ └── T5 │ │ │ │ ├── README.md │ │ │ │ ├── main.py │ │ │ │ ├── requirements.txt │ │ │ │ └── test.sh │ │ └── hf_transformers │ │ │ ├── README.md │ │ │ ├── blade_adapter.py │ │ │ └── tests │ │ │ ├── test_create_model.py │ │ │ ├── test_load_model_info.py │ │ │ ├── test_optimize.py │ │ │ ├── test_pipeline.py │ │ │ ├── test_trace_model.py │ │ │ └── test_wrapper_model.py │ ├── Quantization │ │ ├── README.md │ │ └── bert_ptq.py │ └── Train │ │ ├── Dynamo │ │ ├── Bert │ │ │ ├── requirements.txt │ │ │ ├── test.sh │ │ │ └── test_bert.py │ │ └── StableDiffusion │ │ │ ├── README.md │ │ │ ├── disc_wrapper.py │ │ │ ├── docs │ │ │ └── image.png │ │ │ ├── inference.py │ │ │ ├── launch_dreambooth_train.sh │ │ │ └── train_dreambooth.py │ │ └── Lazy │ │ └── Bert │ │ ├── bert_train_ltc.py │ │ └── requirements.txt └── TensorFlow │ ├── Inference │ ├── AArch64 │ │ └── BERT │ │ │ ├── README.md │ │ │ ├── download_model.sh │ │ │ └── main.py │ ├── CUDA │ │ ├── BERT │ │ │ ├── README.md │ │ │ ├── download_model.sh │ │ │ └── main.py │ │ └── FastSpeech2 │ │ │ ├── README.md │ │ │ ├── download_model.sh │ │ │ └── main.py │ └── X86 │ │ └── BERT │ │ ├── README.md │ │ ├── download_model.sh │ │ └── main.py │ └── Train │ └── DeePMD │ ├── README.md │ ├── download_data.sh │ ├── main.py │ └── run.sh ├── index.rst ├── pytorch_blade ├── .bazelrc ├── .bazelversion ├── .clang-format ├── .flake8 ├── .gitignore ├── .mdl_style.rb ├── .mdlrc ├── BUILD.bazel ├── README.md ├── WORKSPACE ├── bazel │ ├── BUILD │ ├── build_defs.bzl │ ├── platform_alibaba │ │ └── workspace.bzl │ ├── tests │ │ ├── BUILD │ │ ├── glob_lit_test.bzl │ │ └── lit.cfg.py │ ├── torch │ │ ├── BUILD │ │ ├── repo.bzl │ │ └── torch.BUILD.tpl │ └── torch_mlir │ │ ├── BUILD │ │ ├── absl-build-path.patch │ │ ├── disable-simplify-dynamic-gather-to-gather.patch │ │ └── repo.bzl ├── bazel_build.py ├── benchmark │ ├── README.md │ ├── TorchBench │ │ ├── cpu-utils │ │ │ ├── compare_results_between_archs.py │ │ │ ├── full_models.txt │ │ │ ├── generate_yaml_for_cpu.py │ │ │ ├── parse_cpu_profiling_results.py │ │ │ ├── parse_cpu_results.py │ │ │ ├── partial_models.txt │ │ │ ├── requirements_aarch64_131.txt │ │ │ ├── requirements_aarch64_200.txt │ │ │ ├── requirements_cpu_131.txt │ │ │ ├── requirements_cpu_200.txt │ │ │ ├── requirements_cpu_pre.txt │ │ │ └── tiny_models.txt │ │ ├── requirements_cuda.txt │ │ ├── results_analysis.py │ │ ├── torch_bench_cpu.sh │ │ └── torch_bench_gpu.sh │ ├── detectron2 │ │ ├── README.md │ │ ├── run_blade.py │ │ └── test_d2_benchmark.sh │ ├── requirements.txt │ ├── run_benchmark.sh │ └── torch-tensorrt │ │ ├── README.md │ │ ├── config │ │ ├── crnn.yml │ │ ├── vgg16.yml │ │ └── yolov5.yml │ │ ├── models │ │ └── .gitkeep │ │ ├── perf_run.py │ │ └── test_trt_benchmark.sh ├── common_setup.py ├── distribution.cfg ├── pytorch_blade │ ├── BUILD │ ├── common_utils │ │ ├── BUILD │ │ ├── logging.h │ │ ├── macros.h │ │ ├── tempfs.cpp │ │ ├── tempfs.h │ │ ├── tempfs_test.cpp │ │ ├── utils.cpp │ │ ├── utils.h │ │ └── utils_test.cpp │ ├── compiler │ │ ├── BUILD │ │ ├── backends │ │ │ ├── BUILD │ │ │ ├── backend_input_outputs.cpp │ │ │ ├── backend_input_outputs.h │ │ │ ├── engine_class.cpp │ │ │ ├── engine_class.h │ │ │ ├── engine_interface.cpp │ │ │ └── engine_interface.h │ │ ├── jit │ │ │ ├── BUILD │ │ │ ├── aten_custom_ops.cpp │ │ │ ├── fusion.cpp │ │ │ ├── fusion.h │ │ │ ├── fusion_test.cpp │ │ │ ├── onnx_funcs.cpp │ │ │ ├── onnx_funcs.h │ │ │ ├── pybind_functions.cpp │ │ │ ├── pybind_functions.h │ │ │ ├── shape_type_spec.cpp │ │ │ ├── shape_type_spec.h │ │ │ ├── shape_type_test.cpp │ │ │ ├── tool_funcs.cpp │ │ │ ├── tool_funcs.h │ │ │ └── torch │ │ │ │ ├── BUILD │ │ │ │ ├── README.md │ │ │ │ ├── alias_analysis.cpp │ │ │ │ ├── alias_analysis.h │ │ │ │ ├── const_loop_unroll.cpp │ │ │ │ ├── const_loop_unroll.h │ │ │ │ ├── constant_propagation.cpp │ │ │ │ ├── constant_propagation.h │ │ │ │ ├── eliminate_redundant_permutations.cpp │ │ │ │ ├── eliminate_redundant_permutations.h │ │ │ │ ├── freeze_module.cpp │ │ │ │ ├── freeze_module.h │ │ │ │ ├── onnx.cpp │ │ │ │ ├── onnx.h │ │ │ │ ├── op_registry.cpp │ │ │ │ ├── op_registry.h │ │ │ │ ├── pybind_utils.cpp │ │ │ │ ├── schema_set.cpp │ │ │ │ ├── schema_set.h │ │ │ │ ├── shape_analysis.cpp │ │ │ │ ├── shape_analysis.h │ │ │ │ └── shape_analysis_test.cpp │ │ ├── mlir │ │ │ ├── BUILD │ │ │ ├── converters │ │ │ │ ├── BUILD │ │ │ │ ├── mhlo_conversion.cpp │ │ │ │ ├── mhlo_conversion.h │ │ │ │ ├── torch_mlir_op_filter.cpp │ │ │ │ └── torch_mlir_op_filter.h │ │ │ ├── pybind_functions.cpp │ │ │ ├── pybind_functions.h │ │ │ └── runtime │ │ │ │ ├── BUILD │ │ │ │ ├── disc_engine.cpp │ │ │ │ ├── disc_engine.h │ │ │ │ ├── ral_context.cpp │ │ │ │ └── ral_context.h │ │ ├── neural_engine │ │ │ ├── BUILD │ │ │ ├── neural_engine.cpp │ │ │ ├── neural_engine.h │ │ │ ├── pybind_functions.cpp │ │ │ └── pybind_functions.h │ │ └── tensorrt │ │ │ ├── BUILD │ │ │ ├── bridge │ │ │ ├── tensorrt_calibrator.cpp │ │ │ ├── tensorrt_calibrator.h │ │ │ ├── tensorrt_common.cpp │ │ │ ├── tensorrt_common.h │ │ │ ├── tensorrt_flags.cpp │ │ │ ├── tensorrt_flags.h │ │ │ ├── tensorrt_logger.cpp │ │ │ ├── tensorrt_logger.h │ │ │ ├── tensorrt_onnx_parser.cpp │ │ │ └── tensorrt_onnx_parser.h │ │ │ ├── pybind_functions.cpp │ │ │ ├── pybind_functions.h │ │ │ ├── tensorrt_engine.cpp │ │ │ ├── tensorrt_engine.h │ │ │ ├── tensorrt_engine_context.cpp │ │ │ └── tensorrt_engine_context.h │ ├── disc_ops │ │ ├── BUILD │ │ └── attention_op.cpp │ ├── ltc │ │ ├── BUILD │ │ ├── disc_backend │ │ │ ├── backend_impl.cpp │ │ │ └── backend_impl.h │ │ ├── disc_compiler │ │ │ ├── BUILD │ │ │ ├── README.md │ │ │ ├── disc_compiler.cpp │ │ │ ├── disc_compiler.h │ │ │ ├── disc_compiler_test.cpp │ │ │ ├── passes │ │ │ │ ├── disc_fuser.cpp │ │ │ │ ├── disc_fuser.h │ │ │ │ ├── disc_fuser_test.cpp │ │ │ │ ├── graph_fuser.cpp │ │ │ │ ├── graph_fuser.h │ │ │ │ ├── io.h │ │ │ │ ├── register_disc_class.cpp │ │ │ │ └── register_disc_class.h │ │ │ ├── replay.cpp │ │ │ └── replay.h │ │ ├── include │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── torch │ │ │ │ └── csrc │ │ │ │ └── lazy │ │ │ │ ├── core │ │ │ │ └── internal_ops │ │ │ │ │ └── ltc_ops.h │ │ │ │ ├── python │ │ │ │ └── python_util.h │ │ │ │ └── ts_backend │ │ │ │ ├── config.h │ │ │ │ ├── dynamic_ir.h │ │ │ │ ├── ir_builder.h │ │ │ │ ├── ops │ │ │ │ ├── batch_norm_ops.h │ │ │ │ ├── cast.h │ │ │ │ ├── device_data.h │ │ │ │ ├── expand.h │ │ │ │ ├── generic.h │ │ │ │ ├── random_ops.h │ │ │ │ ├── scalar.h │ │ │ │ └── to_copy.h │ │ │ │ ├── tensor_aten_ops.h │ │ │ │ ├── ts_autograd_functions.h │ │ │ │ ├── ts_backend_impl.h │ │ │ │ ├── ts_eager_fallback.h │ │ │ │ ├── ts_lowering_context.h │ │ │ │ ├── ts_node.h │ │ │ │ ├── ts_node_lowering.h │ │ │ │ └── view_ops │ │ │ │ ├── as_strided.h │ │ │ │ ├── as_strided_view_update.h │ │ │ │ ├── diagonal.h │ │ │ │ ├── diagonal_view_update.h │ │ │ │ ├── narrow.h │ │ │ │ ├── narrow_view_update.h │ │ │ │ ├── permute.h │ │ │ │ ├── resize.h │ │ │ │ ├── select.h │ │ │ │ ├── select_view_update.h │ │ │ │ ├── squeeze.h │ │ │ │ ├── unsqueeze.h │ │ │ │ └── view.h │ │ ├── init_python_bindings.cpp │ │ └── init_python_bindings.h │ ├── pybind.cpp │ ├── pybind.h │ ├── quantization │ │ ├── BUILD │ │ ├── alias.h │ │ ├── custom_op.cpp │ │ ├── pybind_functions.cpp │ │ └── pybind_functions.h │ ├── torch-mlir │ │ ├── BUILD │ │ ├── include │ │ │ ├── torch-mlir │ │ │ │ ├── Conversion │ │ │ │ │ ├── MhloPasses.h │ │ │ │ │ └── MhloPasses.td │ │ │ │ └── Dialect │ │ │ │ │ └── TorchConversion │ │ │ │ │ └── Transforms │ │ │ │ │ └── DiscPdlPredefinedPatterns.h │ │ │ └── utils │ │ │ │ └── env.h │ │ └── lib │ │ │ ├── Conversion │ │ │ ├── MhloPasses.cpp │ │ │ └── TorchToMhlo │ │ │ │ └── DiscTorchToMhlo.cpp │ │ │ ├── Dialect │ │ │ └── TorchConversion │ │ │ │ └── Transforms │ │ │ │ ├── ApplyDiscPdlPatterns.cpp │ │ │ │ ├── ApplyValueSemantics.cpp │ │ │ │ ├── DiscConvertTorchToDiscMhlo.cpp │ │ │ │ ├── DiscDecomposeComplexOps.cpp │ │ │ │ ├── DiscSimplifyPatterns.cpp │ │ │ │ ├── ReduceTensorConversions.cpp │ │ │ │ ├── UpgradeLegacyOps.cpp │ │ │ │ └── VerifyMhloBackendContract.cpp │ │ │ └── utils │ │ │ └── env.cpp │ └── torch_blade.lds ├── release_version.py ├── scripts │ ├── build_pytorch_blade.sh │ ├── build_pytorch_blade_dcu.sh │ └── pip │ │ ├── requirements-dev-1.13.1+aarch64.txt │ │ ├── requirements-dev-1.13.1+cpu.txt │ │ ├── requirements-dev-1.13.1+cu116.txt │ │ ├── requirements-dev-2.0.0+aarch64.txt │ │ ├── requirements-dev-2.0.0+cpu.txt │ │ ├── requirements-dev-2.0.1+cu118.txt │ │ └── requirements-dev-ngc.txt ├── setup.py ├── tensorflow │ └── tools │ │ └── toolchains │ │ ├── README.md │ │ └── java ├── tests │ ├── __init__.py │ ├── disc │ │ ├── __init__.py │ │ ├── ops │ │ │ ├── __init__.py │ │ │ ├── test_activation.py │ │ │ ├── test_batchnorm.py │ │ │ ├── test_binary_ops.py │ │ │ ├── test_block_ops.py │ │ │ ├── test_bool_tensor.py │ │ │ ├── test_broadcast.py │ │ │ ├── test_const.py │ │ │ ├── test_conv_ops.py │ │ │ ├── test_factory_like.py │ │ │ ├── test_feature_group_conv.py │ │ │ ├── test_group_norm.py │ │ │ ├── test_input_mutation.py │ │ │ ├── test_layer_norm.py │ │ │ ├── test_list.py │ │ │ ├── test_matmul.py │ │ │ ├── test_mem_ops.py │ │ │ ├── test_nn_ops.py │ │ │ ├── test_permutation.py │ │ │ ├── test_power.py │ │ │ ├── test_reduction.py │ │ │ ├── test_scatter.py │ │ │ ├── test_shapes.py │ │ │ ├── test_slices.py │ │ │ ├── test_tensor.py │ │ │ └── test_unary_ops.py │ │ ├── pdl │ │ │ ├── __init__.py │ │ │ ├── pdll_files │ │ │ │ ├── common │ │ │ │ │ └── fake_quant.pdll │ │ │ │ ├── cpu │ │ │ │ │ └── dequant_gemm_quant.pdll │ │ │ │ └── gpu │ │ │ │ │ ├── conv_bias.pdll │ │ │ │ │ ├── dequant_gemm_quant.pdll │ │ │ │ │ ├── dequant_gemm_quant_bias_f32_quant.pdll │ │ │ │ │ ├── dequant_gemm_quant_bias_quant.pdll │ │ │ │ │ └── weight_only_qgemm.pdll │ │ │ ├── test_e2e │ │ │ │ ├── __init__.py │ │ │ │ ├── test_conv_bias.py │ │ │ │ ├── test_quantization.py │ │ │ │ └── test_quantized_qkv_merge.py │ │ │ └── test_torchscipt_to_mhlo │ │ │ │ ├── __init__.py │ │ │ │ ├── test_conv_bias.py │ │ │ │ └── test_quantization.py │ │ ├── test_black_list.py │ │ ├── test_cache.py │ │ ├── test_const_propagation.py │ │ ├── test_disc_engine.py │ │ ├── test_dynamo.py │ │ ├── test_is_mlir_mhlo_supported.py │ │ ├── test_multi_streams.py │ │ └── testing_base.py │ ├── disc_mlir │ │ ├── BUILD │ │ ├── disc_cse.mlir │ │ └── lit.site.cfg.py │ ├── ltc │ │ ├── __init__.py │ │ └── test_mnist.py │ ├── mhlo │ │ ├── BUILD │ │ ├── autocast.mlir │ │ ├── custom_call.mlir │ │ ├── custom_fake_quant.mlir │ │ ├── custom_quantize_dequantize.mlir │ │ ├── disc_simlifier.mlir │ │ ├── dropout.mlir │ │ ├── elementwise.mlir │ │ ├── extract.mlir │ │ ├── lit.site.cfg.py │ │ ├── loss.mlir │ │ ├── matmul.mlir │ │ ├── matmul_half.mlir │ │ ├── mem_ops.mlir │ │ ├── multi_outputs.mlir │ │ ├── ops.mlir │ │ ├── reduction.mlir │ │ ├── slices.mlir │ │ ├── softmax.mlir │ │ ├── split.mlir │ │ ├── tensor.mlir │ │ ├── torch-mlir-opt │ │ │ ├── BUILD │ │ │ └── torch-mlir-opt.cpp │ │ ├── unsqueeze_and_squeeze.mlir │ │ └── views.mlir │ ├── neural_engine │ │ ├── __init__.py │ │ ├── test_support_info.py │ │ └── testing_base.py │ ├── quantization │ │ ├── __init__.py │ │ ├── test_data_prepare.py │ │ ├── test_fake_quant.py │ │ └── test_graph_process.py │ ├── run_no_init_class_subprocess.py │ ├── tensorrt │ │ ├── __init__.py │ │ ├── run_no_init_class_subprocess.py │ │ ├── test_builder_flags.py │ │ ├── test_holder_serialize.py │ │ ├── test_onnx.py │ │ ├── test_onnxparser.py │ │ ├── test_optimize.py │ │ ├── test_support_info.py │ │ ├── test_tensorrt.py │ │ ├── test_trt_extension.py │ │ └── test_trt_support_fusion.py │ ├── test_algorithm.py │ ├── test_almost_equal.py │ ├── test_config.py │ ├── test_contiguous.py │ ├── test_export.py │ ├── test_flags.py │ ├── test_freeze_module.py │ ├── test_parallel_conversion.py │ ├── test_passes.py │ ├── test_python_ir_passes.py │ ├── test_record_shape.py │ ├── test_tools.py │ ├── test_utils.py │ ├── torch-disc-ops │ │ └── test_attention_op.py │ ├── torch-disc-pdll │ │ ├── BUILD │ │ ├── tests │ │ │ ├── BUILD │ │ │ ├── conv_relu.mlir │ │ │ ├── conv_relu.pdll │ │ │ ├── dequant_qgemm_quant.mlir │ │ │ ├── dequant_qgemm_quant.pdll │ │ │ ├── fake_quant.mlir │ │ │ ├── fake_quant.pdll │ │ │ └── lit.site.cfg.py │ │ ├── torch-disc-pdll.cpp │ │ ├── utils.cpp │ │ └── utils.h │ └── torchscript │ │ ├── BUILD │ │ ├── basics.graph │ │ ├── factory_like.graph │ │ ├── gather_like.graph │ │ ├── lit.site.cfg.py │ │ ├── shape_analysis_tool.cpp │ │ ├── since_1_10.graph │ │ ├── since_1_11.graph │ │ ├── since_1_12.graph │ │ ├── since_1_13.graph │ │ ├── since_1_14.graph │ │ ├── slice_like.graph │ │ └── view_likes.graph ├── torch_blade │ ├── __init__.py │ ├── algorithm │ │ ├── __init__.py │ │ ├── directed_graph.py │ │ └── union_set.py │ ├── clustering │ │ ├── __init__.py │ │ ├── support_fusion_algorithm.py │ │ ├── support_fusion_group.py │ │ └── support_group_conversion.py │ ├── config.py │ ├── context.py │ ├── dynamo │ │ ├── __init__.py │ │ ├── monkey_patch.py │ │ └── patch_user_defined.py │ ├── exporter.py │ ├── logging.py │ ├── mlir │ │ ├── __init__.py │ │ ├── cache.py │ │ ├── disc_engine_conversion.py │ │ └── hash.py │ ├── monkey_patch │ │ ├── __init__.py │ │ └── patch_utils.py │ ├── neural_engine │ │ ├── __init__.py │ │ └── neural_engine_optimization.py │ ├── onnx_backends │ │ ├── __init__.py │ │ ├── backend_conversion.py │ │ ├── backend_testbed.py │ │ └── onnx_symbolic_opset9_patches.py │ ├── optimization.py │ ├── pass_manager.py │ ├── python_ir_analysis.py │ ├── quantization │ │ ├── __init__.py │ │ └── prepare_data.py │ ├── tensorrt │ │ ├── __init__.py │ │ ├── dynamic_shapes.py │ │ ├── flags.py │ │ └── tensorrt_optimization.py │ ├── testing │ │ ├── __init__.py │ │ └── common_utils.py │ ├── tools │ │ ├── __init__.py │ │ ├── low_precision_analysis.py │ │ ├── onnx_lower_guard.py │ │ └── shape_inference.py │ └── utils.py └── torch_blade_build.py ├── scripts ├── ci │ ├── auto_rebase.sh │ ├── build_and_test.sh │ ├── deploy_docker.sh │ ├── deploy_pytorch_blade.sh │ ├── deploy_tensorflow_blade.sh │ ├── deploy_wrapper.sh │ ├── ossutil │ ├── ossutil-arm64 │ ├── parse_args.sh │ ├── test_cpu_examples.sh │ ├── test_pytorch_blade.sh │ └── test_tensorflow_blade.sh ├── pre-commit │ └── copyright.py └── python │ ├── bazel_snapshot_client.py │ ├── common_setup.py │ ├── tao_build.py │ └── tao_common.py ├── tao ├── .bazelignore ├── .bazelrc ├── .bazelversion ├── .gitignore ├── BUILD ├── CMake │ ├── FindTensorflow.cmake │ ├── Googletest │ │ ├── CMakeLists.txt.in │ │ └── DownloadGTest.cmake │ ├── README.md │ ├── SetupCUDA.cmake │ ├── SetupROCM.cmake │ ├── TaoHelpers.cmake │ └── config.cmake ├── CMakeLists.txt ├── README.md ├── WORKSPACE ├── bridge_version_scripts.lds ├── config.mk ├── docker │ ├── Dockerfile.warmup.cuda10 │ └── install_cuda10_toolkit.sh ├── python │ ├── blade_disc_tf │ │ ├── __init__.py │ │ ├── _version.py │ │ └── disc.py │ └── tests │ │ ├── __init__.py │ │ └── test_import.py ├── setup.py ├── tao_bridge.bzl ├── tao_bridge │ ├── CMakeLists.txt │ ├── common.cc │ ├── common.h │ ├── common_test.cc │ ├── cuda_utils.cc │ ├── cuda_utils.h │ ├── cuda_utils_test.cc │ ├── dumper_common.cc │ ├── dumper_common.h │ ├── dumper_common_test.cc │ ├── errors.cc │ ├── errors.h │ ├── errors_test.cc │ ├── executable.cc │ ├── executable.h │ ├── kernels │ │ ├── CMakeLists.txt │ │ ├── disc_launch.cc │ │ ├── disc_launch.h │ │ ├── launch_base.cc │ │ ├── launch_base.h │ │ ├── platform_info.cc │ │ ├── platform_info.h │ │ ├── process.cc │ │ ├── process.h │ │ ├── profiling.cc │ │ ├── profiling.h │ │ ├── tao_compilation_cache.cc │ │ ├── tao_compilation_cache.h │ │ ├── tao_compilation_info_collector.cc │ │ ├── tao_compilation_info_collector.h │ │ ├── tao_profiling_guided_compilation.cc │ │ └── tao_profiling_guided_compilation.h │ ├── mlir │ │ ├── CMakeLists.txt │ │ ├── mlir_executable.cc │ │ └── mlir_executable.h │ ├── ops │ │ ├── CMakeLists.txt │ │ ├── fake_quant_op.cc │ │ └── tao_ops.cc │ ├── passes │ │ ├── CMakeLists.txt │ │ ├── defunctionalize_control_flow.cc │ │ ├── defunctionalize_control_flow.h │ │ ├── functionalize_cond.cc │ │ ├── functionalize_cond.h │ │ ├── functionalize_control_flow.cc │ │ ├── functionalize_control_flow.h │ │ ├── functionalize_control_flow_util.cc │ │ ├── functionalize_control_flow_util.h │ │ ├── functionalize_while.cc │ │ ├── functionalize_while.h │ │ ├── tao_bace_reformat_pass.cc │ │ ├── tao_bace_reformat_pass.h │ │ ├── tao_bace_reformat_pass_test.cc │ │ ├── tao_build_tao_op_pass.cc │ │ ├── tao_build_tao_op_pass.h │ │ ├── tao_clone_constants_for_better_clustering.cc │ │ ├── tao_clone_constants_for_better_clustering.h │ │ ├── tao_clone_constants_for_better_clustering_test.cc │ │ ├── tao_defuse_pass.cc │ │ ├── tao_defuse_pass.h │ │ ├── tao_defuse_pass_test.cc │ │ ├── tao_encapsulate_subgraphs_pass.cc │ │ ├── tao_encapsulate_subgraphs_pass.h │ │ ├── tao_encapsulate_subgraphs_pass_test.cc │ │ ├── tao_feature_detector.cc │ │ ├── tao_feature_detector.h │ │ ├── tao_mark_for_compilation_pass.cc │ │ ├── tao_mark_for_compilation_pass.h │ │ ├── tao_optimization_pass.cc │ │ ├── tao_optimization_pass.h │ │ ├── tao_partially_decluster_pass.cc │ │ ├── tao_partially_decluster_pass.h │ │ └── tao_partially_decluster_pass_test.cc │ ├── ral │ │ ├── .gitignore │ │ └── CMakeLists.txt │ ├── tao_compilation_result.proto │ ├── tao_compiler_input.proto │ ├── tao_util.cc │ ├── tao_util.h │ ├── tao_util_test.cc │ ├── test │ │ ├── README.md │ │ ├── __init__.py │ │ ├── gpu │ │ │ ├── __init__.py │ │ │ └── mlir │ │ │ │ ├── __init__.py │ │ │ │ ├── base.py │ │ │ │ ├── test_mlir.py │ │ │ │ ├── test_mlir_fake_quant.py │ │ │ │ ├── test_mlir_static_rank_cache.py │ │ │ │ └── test_mlir_transpose.py │ │ ├── pytest.ini │ │ └── tao_ut_common.py │ ├── test_helpers.h │ ├── tf │ │ ├── CMakeLists.txt │ │ ├── compilability_check_util.cc │ │ ├── compilability_check_util.h │ │ ├── const_analysis.cc │ │ ├── const_analysis.h │ │ ├── const_analysis_test.cc │ │ ├── deadness_analysis.cc │ │ ├── deadness_analysis.h │ │ ├── deadness_analysis_internal.h │ │ ├── deadness_analysis_test.cc │ │ ├── defs.cc │ │ ├── defs.h │ │ ├── device_util.cc │ │ ├── device_util.h │ │ ├── dump_graph.cc │ │ ├── dump_graph.h │ │ ├── flags.cc │ │ ├── flags.h │ │ ├── graphcycles.cc │ │ ├── graphcycles.h │ │ ├── graphcycles_test.cc │ │ ├── lower_if_op.cc │ │ ├── lower_if_op.h │ │ ├── lower_while_op.cc │ │ ├── lower_while_op.h │ │ ├── mark_for_compilation_pass_flags.cc │ │ ├── mark_for_compilation_pass_flags.h │ │ ├── ordered_set.h │ │ ├── parse_flags_from_env.cc │ │ ├── parse_flags_from_env.h │ │ ├── register_tensor_array_ops.cc │ │ ├── resource_operation_safety_analysis.cc │ │ ├── resource_operation_safety_analysis.h │ │ ├── resource_operation_safety_analysis_test.cc │ │ ├── resource_operation_table.cc │ │ ├── resource_operation_table.h │ │ ├── resource_operation_table_test.cc │ │ ├── shape_inference_helpers.cc │ │ ├── shape_inference_helpers.h │ │ ├── status.h │ │ ├── statusor.h │ │ ├── subprocess.cc │ │ ├── subprocess.h │ │ ├── tf2xla_util.cc │ │ ├── tf2xla_util.h │ │ ├── types.h │ │ ├── union_find.h │ │ ├── util.cc │ │ ├── util.h │ │ ├── util_test.cc │ │ ├── xla_cluster_util.cc │ │ ├── xla_cluster_util.h │ │ ├── xla_cluster_util_test.cc │ │ ├── xla_config_registry.cc │ │ ├── xla_config_registry.h │ │ ├── xla_op_registry.cc │ │ ├── xla_op_registry.h │ │ └── xla_op_registry_test.cc │ ├── tf_compatible.h │ ├── version.cc │ ├── version.h.in │ └── xla_activity.proto ├── third_party │ ├── mkldnn │ │ ├── BUILD │ │ └── CMakeLists.txt │ └── ptxas │ │ └── 10.2 │ │ └── ptxas ├── tools │ └── download_protoc.sh ├── workspace0.bzl ├── workspace1.bzl └── workspace2.bzl ├── tao_compiler ├── .bazelrc ├── .bazelrc.user ├── .bazelversion ├── .gitignore ├── WORKSPACE ├── build_tools │ └── bazel │ │ ├── BUILD │ │ └── workspace.bzl ├── ci_build │ └── platforms │ │ └── tao │ │ ├── cpu │ │ └── env.conf │ │ ├── dcu │ │ └── env.conf │ │ ├── gpu │ │ ├── env.conf.cuda10 │ │ ├── env.conf.cuda10_2 │ │ ├── env.conf.cuda11 │ │ ├── env.conf.cuda11_1 │ │ ├── env.conf.cuda11_2 │ │ ├── env.conf.cuda11_3 │ │ ├── env.conf.cuda11_4 │ │ ├── env.conf.cuda11_5 │ │ ├── env.conf.cuda11_6 │ │ └── env.conf.cuda11_8 │ │ └── rocm │ │ └── env.conf ├── decoupling │ ├── BUILD │ ├── README │ ├── compiler_base.cc │ ├── compiler_base.h │ ├── fake_quant_op.cc │ ├── mlir_compiler.cc │ ├── mlir_compiler.h │ ├── mlir_compiler_impl_cpu.cc │ ├── mlir_compiler_impl_cpu.h │ ├── mlir_compiler_impl_gpu.cc │ ├── mlir_compiler_impl_gpu.h │ ├── mlir_compiler_impl_rocm.cc │ ├── mlir_compiler_impl_rocm.h │ ├── tao_compiler_main.cc │ ├── tao_compiler_trace.cc │ ├── tao_compiler_trace.h │ ├── tao_compiler_trace_test.cc │ └── tests_data │ │ └── mlir_gpu.proto ├── file_map ├── mlir │ ├── BUILD │ ├── custom_ops │ │ ├── BUILD │ │ ├── custom_library │ │ │ ├── atomic.cu.h │ │ │ ├── bitonic_sort.cu.h │ │ │ ├── dimensions.h │ │ │ ├── dynamic_sort.cu.cc │ │ │ ├── dynamic_sort.h │ │ │ ├── filter_n_compress.cu.h │ │ │ ├── gather_topk.cu.h │ │ │ ├── gpu_helper.h │ │ │ ├── kth_biggest.cu.h │ │ │ ├── philox_random.h │ │ │ ├── philox_random_test.cc │ │ │ ├── random.h │ │ │ ├── random_gpu.cu.cc │ │ │ ├── small_top128.cu.h │ │ │ ├── tf_topk.cu.h │ │ │ ├── tf_transpose.cu.h │ │ │ ├── top128.cu.h │ │ │ ├── top2.cu.h │ │ │ ├── topk_sort.cu.h │ │ │ ├── topk_util.cu.h │ │ │ ├── transpose.h │ │ │ ├── transpose_gpu.cu.cc │ │ │ └── warp.cu.h │ │ ├── dynamic_sort_impl.cc │ │ ├── dynamic_sort_impl.h │ │ ├── random_impl.cc │ │ └── transpose_impl.cc │ ├── disc │ │ ├── BUILD │ │ ├── IR │ │ │ ├── custom_call_base.cc │ │ │ ├── custom_call_base.h │ │ │ ├── disc_ral_ops.cc │ │ │ ├── disc_ral_ops.h │ │ │ ├── disc_ral_ops.td │ │ │ ├── disc_shape_ops.cc │ │ │ ├── disc_shape_ops.h │ │ │ ├── disc_shape_ops.td │ │ │ ├── disc_tf_additional_ops.cc │ │ │ ├── disc_tf_additional_ops.h │ │ │ ├── disc_tf_additional_ops.td │ │ │ ├── hlo_disc_enums.td │ │ │ ├── hlo_disc_ops.cc │ │ │ ├── hlo_disc_ops.h │ │ │ ├── hlo_disc_ops.td │ │ │ ├── lhlo_disc_enums.td │ │ │ ├── lhlo_disc_ops.cc │ │ │ ├── lhlo_disc_ops.h │ │ │ ├── lhlo_disc_ops.td │ │ │ ├── qconv_custom_call_op.cc │ │ │ ├── rng_uniform_custom_call_op.cc │ │ │ ├── rng_uniform_custom_call_op.h │ │ │ ├── sparse_custom_call_op.cc │ │ │ ├── tests │ │ │ │ ├── BUILD │ │ │ │ ├── invalid_hlo_disc.mlir │ │ │ │ └── ops_hlo_disc.mlir │ │ │ ├── topk_custom_call_op.cc │ │ │ └── topk_custom_call_op.h │ │ ├── disc_compiler.cc │ │ ├── disc_compiler.h │ │ ├── disc_compiler_main.cc │ │ ├── disc_util.cc │ │ ├── disc_util.h │ │ ├── glob_lit_test.bzl │ │ ├── mhlo_disc_builder.lds │ │ ├── runlit.cfg.py │ │ ├── runlit.site.cfg.py │ │ ├── tests │ │ │ ├── BUILD │ │ │ ├── disc-transform │ │ │ │ ├── BUILD │ │ │ │ ├── data │ │ │ │ │ ├── default_schedule_matmul_nn_d_f32.mlir │ │ │ │ │ ├── default_schedule_matmul_nn_p_2x768_f32.mlir │ │ │ │ │ ├── default_schedule_matmul_nn_p_3072x768_f32.mlir │ │ │ │ │ ├── default_schedule_matmul_nn_p_512x1024_f32.mlir │ │ │ │ │ ├── default_schedule_matmul_nn_p_768x2_f32.mlir │ │ │ │ │ ├── default_schedule_matmul_nn_s_24x24x64_f32.mlir │ │ │ │ │ ├── default_schedule_matmul_nn_s_24x64x24_f32.mlir │ │ │ │ │ ├── default_schedule_matmul_nn_s_256x256x128_f16.mlir │ │ │ │ │ ├── default_schedule_matmul_nt_d_f32.mlir │ │ │ │ │ ├── default_schedule_matmul_tn_d_f32.mlir │ │ │ │ │ ├── default_schedule_matmul_tt_d_f32.mlir │ │ │ │ │ ├── matmul_epilogue_biasadd_p_768x3072_f32.mlir │ │ │ │ │ ├── matmul_epilogue_biasadd_relu_p_768_3072_f32.mlir │ │ │ │ │ ├── matmul_epilogue_complex_test0.mlir │ │ │ │ │ ├── matmul_epilogue_small_static_shape_test0.mlir │ │ │ │ │ ├── matmul_epilogue_small_static_shape_test1.mlir │ │ │ │ │ ├── matmul_epilogue_small_static_shape_test2.mlir │ │ │ │ │ ├── matmul_epilogue_small_static_shape_test3.mlir │ │ │ │ │ ├── matmul_multithread_nn_d_f32.mlir │ │ │ │ │ ├── matmul_multithread_nn_d_f32_large_schedule.mlir │ │ │ │ │ ├── matmul_multithread_nn_d_f32_schedule.mlir │ │ │ │ │ ├── matmul_nn_d_f32.mlir │ │ │ │ │ ├── matmul_nn_d_f32_large_schedule.mlir │ │ │ │ │ ├── matmul_nn_d_f32_large_schedule_2.mlir │ │ │ │ │ ├── matmul_nn_d_f32_large_schedule_3.mlir │ │ │ │ │ ├── matmul_nn_d_f32_large_schedule_4.mlir │ │ │ │ │ ├── matmul_nn_d_f32_large_schedule_5.mlir │ │ │ │ │ ├── matmul_nn_d_f32_schedule.mlir │ │ │ │ │ ├── matmul_nn_s_256x256x128_f16.mlir │ │ │ │ │ ├── matmul_nn_s_f16_gpu_schedule.mlir │ │ │ │ │ ├── matmul_nn_s_f16_gpu_schedule_1.mlir │ │ │ │ │ ├── packed_matmul_nn_p_512x1024_f32.mlir │ │ │ │ │ ├── packed_matmul_nn_p_f32_large_schedule.mlir │ │ │ │ │ ├── use_inlined_code_input_code.mlir │ │ │ │ │ └── use_inlined_code_input_computation.mlir │ │ │ │ ├── default_schedule_matmul.cc │ │ │ │ ├── matmul.cc │ │ │ │ ├── matmul_epilogue.cc │ │ │ │ ├── matmul_multithread.cc │ │ │ │ ├── packed_matmul.cc │ │ │ │ └── use_inlined_code.cc │ │ │ ├── glob_op_test.bzl │ │ │ ├── mlir_feature_test.cc │ │ │ ├── mlir_feature_test.h │ │ │ ├── mlir_test.cc │ │ │ ├── mlir_test.h │ │ │ ├── pdll │ │ │ │ ├── BUILD │ │ │ │ ├── data │ │ │ │ │ ├── qgemm_i8.pdll │ │ │ │ │ ├── qgemm_i8_per_tensor.mlir │ │ │ │ │ ├── quantized_conv2d_i8.pdll │ │ │ │ │ ├── quantized_conv2d_p_nhwc_i8_per_channel.mlir │ │ │ │ │ ├── quantized_conv2d_s_nchw_i8_per_channel_1.mlir │ │ │ │ │ ├── quantized_conv2d_s_nchw_i8_per_channel_2.mlir │ │ │ │ │ ├── quantized_conv2d_s_nchw_i8_per_channel_3.mlir │ │ │ │ │ ├── quantized_conv2d_s_nchw_i8_per_channel_4.mlir │ │ │ │ │ ├── quantized_conv2d_s_nhwc_i8_per_channel_1.mlir │ │ │ │ │ ├── quantized_conv2d_s_nhwc_i8_per_channel_2.mlir │ │ │ │ │ ├── quantized_conv2d_s_nhwc_i8_per_channel_3.mlir │ │ │ │ │ ├── quantized_conv2d_s_nhwc_i8_per_channel_4.mlir │ │ │ │ │ ├── quantized_conv2d_s_nhwc_i8_per_channel_5.mlir │ │ │ │ │ ├── simple_fused_add_mul.mlir │ │ │ │ │ ├── simple_fused_add_mul.pdll │ │ │ │ │ ├── simple_fused_add_mul_multi_results.mlir │ │ │ │ │ └── simple_fused_add_mul_multi_results.pdll │ │ │ │ ├── qgemm.cc │ │ │ │ ├── quantized_conv2d.cc │ │ │ │ └── simple.cc │ │ │ ├── regression │ │ │ │ ├── BUILD │ │ │ │ ├── algebraic_simplifier.cc │ │ │ │ ├── bladnn.cc │ │ │ │ ├── corner_case.cc │ │ │ │ ├── data │ │ │ │ │ ├── algebraic_simplifier_pow_d_f32.mlir │ │ │ │ │ ├── bladnn_batch_gemm.mlir │ │ │ │ │ ├── bladnn_conv.mlir │ │ │ │ │ ├── bladnn_gemm.mlir │ │ │ │ │ ├── corner_case_error_before_ptxas11100.mlir │ │ │ │ │ ├── corner_case_fusion_order_mismatch.mlir │ │ │ │ │ ├── element_type_converter_conv.mlir │ │ │ │ │ ├── element_type_converter_gemm.mlir │ │ │ │ │ ├── embedding_column_d_3d_i64.mlir │ │ │ │ │ ├── empty_tensor.mlir │ │ │ │ │ ├── empty_tensor_reshape_matmul.mlir │ │ │ │ │ ├── epilogue_fusion_gemm_gelu_f16.mlir │ │ │ │ │ ├── epilogue_fusion_gemm_gelu_f32.mlir │ │ │ │ │ ├── epilogue_fusion_gemm_multi_consumers.mlir │ │ │ │ │ ├── epilogue_fusion_gemm_multi_fusion.mlir │ │ │ │ │ ├── epilogue_fusion_transpose_bmm0213.mlir │ │ │ │ │ ├── horizontal_fusion.mlir │ │ │ │ │ ├── int_arithmetic_add_d_i32.mlir │ │ │ │ │ ├── int_arithmetic_add_d_i8.mlir │ │ │ │ │ ├── int_arithmetic_add_d_ui8.mlir │ │ │ │ │ ├── int_arithmetic_convert_d_ui8.mlir │ │ │ │ │ ├── int_arithmetic_div_d_i8.mlir │ │ │ │ │ ├── int_arithmetic_div_d_ui8.mlir │ │ │ │ │ ├── int_arithmetic_mul_d_i8.mlir │ │ │ │ │ ├── int_arithmetic_mul_d_ui8.mlir │ │ │ │ │ ├── int_arithmetic_sub_d_i8.mlir │ │ │ │ │ ├── int_arithmetic_sub_d_ui8.mlir │ │ │ │ │ ├── io_forwarding_cpu_cpu.mlir │ │ │ │ │ ├── io_forwarding_cpu_gpu.mlir │ │ │ │ │ ├── io_forwarding_cpu_gpu_f16.mlir │ │ │ │ │ ├── io_forwarding_gpu_cpu.mlir │ │ │ │ │ ├── io_forwarding_gpu_cpu_f16.mlir │ │ │ │ │ ├── io_forwarding_gpu_gpu.mlir │ │ │ │ │ ├── kstitch_fusion_3d_f64.mlir │ │ │ │ │ ├── kstitch_fusion_adj_skl_small_output_f16.mlir │ │ │ │ │ ├── kstitch_fusion_cpu_multioutputs.mlir │ │ │ │ │ ├── kstitch_fusion_elemwise_shm_cache_large.mlir │ │ │ │ │ ├── kstitch_fusion_elemwise_shm_cache_small.mlir │ │ │ │ │ ├── kstitch_fusion_irregular_xroot.mlir │ │ │ │ │ ├── kstitch_fusion_non_cover_output.mlir │ │ │ │ │ ├── kstitch_fusion_non_skl_output.mlir │ │ │ │ │ ├── kstitch_fusion_simple.mlir │ │ │ │ │ ├── kstitch_fusion_with_splat_const.mlir │ │ │ │ │ ├── kstitch_fusion_with_transpose.mlir │ │ │ │ │ ├── large_concat_cpu.mlir │ │ │ │ │ ├── large_concat_cpu_fused.mlir │ │ │ │ │ ├── layer_norm.mlir │ │ │ │ │ ├── multi_cc.mlir │ │ │ │ │ ├── multi_threading_cpu_2d.mlir │ │ │ │ │ ├── multi_threading_cpu_3d.mlir │ │ │ │ │ ├── multi_threading_cpu_4d.mlir │ │ │ │ │ ├── onednn_batch_gemm.mlir │ │ │ │ │ ├── onednn_gemm.mlir │ │ │ │ │ ├── quantized_const_qi32.mlir │ │ │ │ │ ├── quantized_const_qi8.mlir │ │ │ │ │ ├── quantized_conv2d_with_bias_and_requantize_p_i8_i8_i8_no_bias.mlir │ │ │ │ │ ├── quantized_conv2d_with_bias_and_requantize_p_i8_i8_i8_no_bias_qint32.mlir │ │ │ │ │ ├── reshape_fusion_cpu_kinput.mlir │ │ │ │ │ ├── reshape_fusion_cpu_kloop.mlir │ │ │ │ │ ├── reshape_fusion_cpu_kstitch.mlir │ │ │ │ │ ├── reshape_fusion_cpu_kstitch_test2.mlir │ │ │ │ │ ├── softmax.mlir │ │ │ │ │ ├── transpose_simplifier_test0.mlir │ │ │ │ │ ├── uint_cast.mlir │ │ │ │ │ ├── uint_cast_const.mlir │ │ │ │ │ ├── use_expect_output.mlir │ │ │ │ │ ├── weight_prepacking_cpu_matmul.mlir │ │ │ │ │ └── where_fusion_d_3d_i64.mlir │ │ │ │ ├── element_type_converter.cc │ │ │ │ ├── embedding_column.cc │ │ │ │ ├── empty_tensor.cc │ │ │ │ ├── epilogue_fusion.cc │ │ │ │ ├── horizontal_fusion.cc │ │ │ │ ├── int_arithmetic.cc │ │ │ │ ├── io_forwarding.cc │ │ │ │ ├── kstitch_fusion.cc │ │ │ │ ├── large_concat.cc │ │ │ │ ├── layer_norm.cc │ │ │ │ ├── multi_cc.cc │ │ │ │ ├── multi_threading_cpu.cc │ │ │ │ ├── onednn.cc │ │ │ │ ├── quantized_const.cc │ │ │ │ ├── quantized_conv2d_with_bias_and_requantize.cc │ │ │ │ ├── reshape_fusion_cpu.cc │ │ │ │ ├── softmax.cc │ │ │ │ ├── transpose_simplifier.cc │ │ │ │ ├── uint_cast.cc │ │ │ │ ├── use_expect_output.cc │ │ │ │ ├── weight_prepacking_cpu.cc │ │ │ │ └── where_fusion.cc │ │ │ └── tensorflow_ops │ │ │ │ ├── BUILD │ │ │ │ ├── abs.cc │ │ │ │ ├── add.cc │ │ │ │ ├── add_n.cc │ │ │ │ ├── add_v2.cc │ │ │ │ ├── all.cc │ │ │ │ ├── any.cc │ │ │ │ ├── batch_matmul.cc │ │ │ │ ├── batch_matmul_v2.cc │ │ │ │ ├── bias_add.cc │ │ │ │ ├── broadcast_to.cc │ │ │ │ ├── bucketize.cc │ │ │ │ ├── cast.cc │ │ │ │ ├── ceil.cc │ │ │ │ ├── concat_v2.cc │ │ │ │ ├── const.cc │ │ │ │ ├── conv2d.cc │ │ │ │ ├── conv2d_backprop_filter.cc │ │ │ │ ├── conv2d_backprop_input.cc │ │ │ │ ├── cos.cc │ │ │ │ ├── data │ │ │ │ ├── abs_d_f32.mlir │ │ │ │ ├── abs_p_f32.mlir │ │ │ │ ├── abs_s_f32.mlir │ │ │ │ ├── add_d_f32.mlir │ │ │ │ ├── add_n_d_f32.mlir │ │ │ │ ├── add_n_p_f32.mlir │ │ │ │ ├── add_n_s_f32.mlir │ │ │ │ ├── add_p_f32.mlir │ │ │ │ ├── add_s_f32.mlir │ │ │ │ ├── add_v2_d_f32.mlir │ │ │ │ ├── add_v2_p_f32.mlir │ │ │ │ ├── add_v2_s_f32.mlir │ │ │ │ ├── all_d_i1.mlir │ │ │ │ ├── all_p_i1.mlir │ │ │ │ ├── all_s_i1.mlir │ │ │ │ ├── any_d_i1.mlir │ │ │ │ ├── any_p_i1.mlir │ │ │ │ ├── any_s_i1.mlir │ │ │ │ ├── batch_matmul_nn_d_f16.mlir │ │ │ │ ├── batch_matmul_nn_d_f32.mlir │ │ │ │ ├── batch_matmul_nn_p_f32.mlir │ │ │ │ ├── batch_matmul_nn_s_f32.mlir │ │ │ │ ├── batch_matmul_nt_d_f16.mlir │ │ │ │ ├── batch_matmul_nt_d_f32.mlir │ │ │ │ ├── batch_matmul_nt_p_f32.mlir │ │ │ │ ├── batch_matmul_nt_s_f32.mlir │ │ │ │ ├── batch_matmul_tn_d_f16.mlir │ │ │ │ ├── batch_matmul_tn_d_f32.mlir │ │ │ │ ├── batch_matmul_tn_p_f32.mlir │ │ │ │ ├── batch_matmul_tn_s_f32.mlir │ │ │ │ ├── batch_matmul_tt_d_f16.mlir │ │ │ │ ├── batch_matmul_tt_d_f32.mlir │ │ │ │ ├── batch_matmul_tt_p_f32.mlir │ │ │ │ ├── batch_matmul_tt_s_f32.mlir │ │ │ │ ├── batch_matmul_v2_nn_d_f16.mlir │ │ │ │ ├── batch_matmul_v2_nn_d_f32.mlir │ │ │ │ ├── batch_matmul_v2_nn_d_f64.mlir │ │ │ │ ├── batch_matmul_v2_nn_p_f32.mlir │ │ │ │ ├── batch_matmul_v2_nn_s_f32.mlir │ │ │ │ ├── batch_matmul_v2_nt_d_f32.mlir │ │ │ │ ├── batch_matmul_v2_tn_d_f32.mlir │ │ │ │ ├── batch_matmul_v2_tt_d_f32.mlir │ │ │ │ ├── bias_add_d_f32.mlir │ │ │ │ ├── bias_add_p_2_f32.mlir │ │ │ │ ├── bias_add_p_f32.mlir │ │ │ │ ├── bias_add_s_f32.mlir │ │ │ │ ├── broadcast_to_d_f32.mlir │ │ │ │ ├── broadcast_to_p_f32.mlir │ │ │ │ ├── broadcast_to_s_f32.mlir │ │ │ │ ├── bucketize_d_f32.mlir │ │ │ │ ├── bucketize_d_i32.mlir │ │ │ │ ├── bucketize_p_f32.mlir │ │ │ │ ├── bucketize_p_i64.mlir │ │ │ │ ├── bucketize_s_f32.mlir │ │ │ │ ├── bucketize_s_f64.mlir │ │ │ │ ├── cast_d_f32tof16.mlir │ │ │ │ ├── cast_p_f32tof16.mlir │ │ │ │ ├── cast_s_f16tof32.mlir │ │ │ │ ├── cast_s_f32tof16.mlir │ │ │ │ ├── cast_s_f32toi32.mlir │ │ │ │ ├── cast_s_i32toi1.mlir │ │ │ │ ├── ceil_d_f32.mlir │ │ │ │ ├── ceil_p_f32.mlir │ │ │ │ ├── ceil_s_f32.mlir │ │ │ │ ├── concat_v2_d_f32.mlir │ │ │ │ ├── concat_v2_p_f32.mlir │ │ │ │ ├── concat_v2_s_f32.mlir │ │ │ │ ├── const_2d_f32.mlir │ │ │ │ ├── const_2d_i32.mlir │ │ │ │ ├── const_scalar_f32.mlir │ │ │ │ ├── const_scalar_i32.mlir │ │ │ │ ├── const_scalar_i64.mlir │ │ │ │ ├── conv2d_backprop_filter_d_f16.mlir │ │ │ │ ├── conv2d_backprop_filter_d_f32.mlir │ │ │ │ ├── conv2d_backprop_filter_p_f32.mlir │ │ │ │ ├── conv2d_backprop_filter_s_f32.mlir │ │ │ │ ├── conv2d_backprop_input_d_f32.mlir │ │ │ │ ├── conv2d_backprop_input_p_f16.mlir │ │ │ │ ├── conv2d_backprop_input_p_f32.mlir │ │ │ │ ├── conv2d_backprop_input_p_same_f32.mlir │ │ │ │ ├── conv2d_backprop_input_s_f32.mlir │ │ │ │ ├── conv2d_const_weight_d_f32.mlir │ │ │ │ ├── conv2d_d_f16.mlir │ │ │ │ ├── conv2d_d_f32.mlir │ │ │ │ ├── conv2d_d_f32_2.mlir │ │ │ │ ├── conv2d_d_nchw_f32.mlir │ │ │ │ ├── conv2d_p_f32.mlir │ │ │ │ ├── conv2d_s_f32.mlir │ │ │ │ ├── cos_d_f32.mlir │ │ │ │ ├── cos_p_f32.mlir │ │ │ │ ├── cos_s_f32.mlir │ │ │ │ ├── depthwise_conv2d_native_const_weight_d_f32.mlir │ │ │ │ ├── depthwise_conv2d_native_d_f32.mlir │ │ │ │ ├── depthwise_conv2d_native_p_f32.mlir │ │ │ │ ├── depthwise_conv2d_native_s_f32.mlir │ │ │ │ ├── depthwise_conv2d_native_s_f32_2.mlir │ │ │ │ ├── dequantize_d_int8_channel_scaled.mlir │ │ │ │ ├── dequantize_d_int8_scalar_scaled.mlir │ │ │ │ ├── dequantize_p_int8_channel_scaled.mlir │ │ │ │ ├── dequantize_p_int8_scalar_scaled.mlir │ │ │ │ ├── dequantize_s_int8_channel_scaled.mlir │ │ │ │ ├── dequantize_s_int8_scalar_scaled.mlir │ │ │ │ ├── dynamic_stitch_d_f32.mlir │ │ │ │ ├── dynamic_stitch_s_f32.mlir │ │ │ │ ├── einsum_d_f32.mlir │ │ │ │ ├── einsum_p_f32.mlir │ │ │ │ ├── einsum_s_f32.mlir │ │ │ │ ├── equal_d_i64.mlir │ │ │ │ ├── equal_p_i64.mlir │ │ │ │ ├── equal_s_i64.mlir │ │ │ │ ├── erf_d_f32.mlir │ │ │ │ ├── erf_p_f32.mlir │ │ │ │ ├── erf_s_f32.mlir │ │ │ │ ├── erfc_d_f32.mlir │ │ │ │ ├── erfc_p_f32.mlir │ │ │ │ ├── erfc_s_f32.mlir │ │ │ │ ├── exp_d_f32.mlir │ │ │ │ ├── exp_p_f32.mlir │ │ │ │ ├── exp_s_f32.mlir │ │ │ │ ├── expand_dims_d_f32.mlir │ │ │ │ ├── expand_dims_p_f32.mlir │ │ │ │ ├── expand_dims_s_f32.mlir │ │ │ │ ├── fill_d_f32.mlir │ │ │ │ ├── fill_p_f32.mlir │ │ │ │ ├── fill_s_f32.mlir │ │ │ │ ├── floor_d_f32.mlir │ │ │ │ ├── floor_div_d_f32.mlir │ │ │ │ ├── floor_div_p_f32.mlir │ │ │ │ ├── floor_div_s_f32.mlir │ │ │ │ ├── floor_mod_d_f32.mlir │ │ │ │ ├── floor_mod_p_f32.mlir │ │ │ │ ├── floor_mod_s_f32.mlir │ │ │ │ ├── floor_p_f32.mlir │ │ │ │ ├── floor_s_f32.mlir │ │ │ │ ├── gather_nd_d_f32.mlir │ │ │ │ ├── gather_nd_p_f32.mlir │ │ │ │ ├── gather_nd_s_f32.mlir │ │ │ │ ├── gather_v2_d_f32.mlir │ │ │ │ ├── gather_v2_d_f32_2.mlir │ │ │ │ ├── gather_v2_p_f32.mlir │ │ │ │ ├── gather_v2_s_f32.mlir │ │ │ │ ├── gather_v2_s_i32.mlir │ │ │ │ ├── greater_d_i64.mlir │ │ │ │ ├── greater_equal_d_i64.mlir │ │ │ │ ├── greater_equal_p_i64.mlir │ │ │ │ ├── greater_equal_s_i64.mlir │ │ │ │ ├── greater_p_i64.mlir │ │ │ │ ├── greater_s_i64.mlir │ │ │ │ ├── identity_d_f32.mlir │ │ │ │ ├── identity_p_f32.mlir │ │ │ │ ├── identity_s_f32.mlir │ │ │ │ ├── inline_h2d_d_f32.mlir │ │ │ │ ├── inline_h2d_s_i64.mlir │ │ │ │ ├── isfinite_d_f32.mlir │ │ │ │ ├── isfinite_p_f32.mlir │ │ │ │ ├── isfinite_s_f32.mlir │ │ │ │ ├── less_d_i64.mlir │ │ │ │ ├── less_equal_d_i64.mlir │ │ │ │ ├── less_equal_p_i64.mlir │ │ │ │ ├── less_equal_s_i64.mlir │ │ │ │ ├── less_p_i64.mlir │ │ │ │ ├── less_s_i64.mlir │ │ │ │ ├── log_d_f32.mlir │ │ │ │ ├── log_p_f32.mlir │ │ │ │ ├── log_s_f32.mlir │ │ │ │ ├── logical_and_d_i1.mlir │ │ │ │ ├── logical_and_p_i1.mlir │ │ │ │ ├── logical_and_s_i1.mlir │ │ │ │ ├── logical_not_d_i1.mlir │ │ │ │ ├── logical_not_p_i1.mlir │ │ │ │ ├── logical_not_s_i1.mlir │ │ │ │ ├── logical_or_d_i1.mlir │ │ │ │ ├── logical_or_p_i1.mlir │ │ │ │ ├── logical_or_s_i1.mlir │ │ │ │ ├── matmul_nn_const_weight_f32.mlir │ │ │ │ ├── matmul_nn_d_f16.mlir │ │ │ │ ├── matmul_nn_d_f32.mlir │ │ │ │ ├── matmul_nn_p_f32.mlir │ │ │ │ ├── matmul_nn_s_f32.mlir │ │ │ │ ├── matmul_nt_d_f16.mlir │ │ │ │ ├── matmul_nt_d_f32.mlir │ │ │ │ ├── matmul_nt_p_f32.mlir │ │ │ │ ├── matmul_nt_s_f32.mlir │ │ │ │ ├── matmul_tn_d_f16.mlir │ │ │ │ ├── matmul_tn_d_f32.mlir │ │ │ │ ├── matmul_tn_p_f32.mlir │ │ │ │ ├── matmul_tn_s_f32.mlir │ │ │ │ ├── matmul_tt_d_f16.mlir │ │ │ │ ├── matmul_tt_d_f32.mlir │ │ │ │ ├── matmul_tt_d_f64.mlir │ │ │ │ ├── matmul_tt_p_f32.mlir │ │ │ │ ├── matmul_tt_s_f32.mlir │ │ │ │ ├── max_col_d_f32.mlir │ │ │ │ ├── max_col_p_f32.mlir │ │ │ │ ├── max_col_s_f32.mlir │ │ │ │ ├── max_multidim_d_f32.mlir │ │ │ │ ├── max_row_d_f32.mlir │ │ │ │ ├── max_row_p_f32.mlir │ │ │ │ ├── max_row_s_2d_f32.mlir │ │ │ │ ├── max_row_s_f32.mlir │ │ │ │ ├── maximum_d_f32.mlir │ │ │ │ ├── maximum_p_f32.mlir │ │ │ │ ├── maximum_s_f32.mlir │ │ │ │ ├── mean_col_d_f32.mlir │ │ │ │ ├── mean_col_p_f32.mlir │ │ │ │ ├── mean_col_s_f32.mlir │ │ │ │ ├── mean_multidim_d_f32.mlir │ │ │ │ ├── mean_row_d_f32.mlir │ │ │ │ ├── mean_row_p_f32.mlir │ │ │ │ ├── mean_row_s_f32.mlir │ │ │ │ ├── min_col_d_f32.mlir │ │ │ │ ├── min_col_p_f32.mlir │ │ │ │ ├── min_col_s_f32.mlir │ │ │ │ ├── min_multidim_d_f32.mlir │ │ │ │ ├── min_row_d_f32.mlir │ │ │ │ ├── min_row_p_f32.mlir │ │ │ │ ├── min_row_s_f32.mlir │ │ │ │ ├── minimum_d_f32.mlir │ │ │ │ ├── minimum_p_f32.mlir │ │ │ │ ├── minimum_s_f32.mlir │ │ │ │ ├── mul_d_f32.mlir │ │ │ │ ├── mul_p_f32.mlir │ │ │ │ ├── mul_s_f32.mlir │ │ │ │ ├── neg_d_f32.mlir │ │ │ │ ├── neg_p_f32.mlir │ │ │ │ ├── neg_s_f32.mlir │ │ │ │ ├── not_equal_d_i64.mlir │ │ │ │ ├── not_equal_p_i64.mlir │ │ │ │ ├── not_equal_s_i64.mlir │ │ │ │ ├── pack_d_f32.mlir │ │ │ │ ├── pack_p_f32.mlir │ │ │ │ ├── pack_s_f32.mlir │ │ │ │ ├── pack_s_i32.mlir │ │ │ │ ├── pad_d_f32.mlir │ │ │ │ ├── pad_p_f32.mlir │ │ │ │ ├── pad_s_f32.mlir │ │ │ │ ├── pow_d_f32.mlir │ │ │ │ ├── pow_p_f32.mlir │ │ │ │ ├── pow_s_f32.mlir │ │ │ │ ├── prod_col_d_f32.mlir │ │ │ │ ├── prod_col_p_f32.mlir │ │ │ │ ├── prod_col_s_f32.mlir │ │ │ │ ├── prod_multidim_d_f32.mlir │ │ │ │ ├── prod_row_d_f32.mlir │ │ │ │ ├── prod_row_p_f32.mlir │ │ │ │ ├── prod_row_s_f32.mlir │ │ │ │ ├── prod_s_i32.mlir │ │ │ │ ├── quantize_v2_d_int8_channel_scaled.mlir │ │ │ │ ├── quantize_v2_d_int8_scalar_min_first.mlir │ │ │ │ ├── quantize_v2_d_int8_scalar_scaled.mlir │ │ │ │ ├── quantize_v2_p_int8_channel_scaled.mlir │ │ │ │ ├── quantize_v2_p_int8_scalar_min_first.mlir │ │ │ │ ├── quantize_v2_p_int8_scalar_scaled.mlir │ │ │ │ ├── quantize_v2_s_int8_channel_scaled.mlir │ │ │ │ ├── quantize_v2_s_int8_scalar_min_first.mlir │ │ │ │ ├── quantize_v2_s_int8_scalar_scaled.mlir │ │ │ │ ├── quantized_conv2d_p_nhwc_i8_per_channel.mlir │ │ │ │ ├── quantized_conv2d_p_nhwc_i8_per_tensor.mlir │ │ │ │ ├── quantized_conv2d_s_nhwc_i8_per_channel.mlir │ │ │ │ ├── quantized_matmul_p_i8_per_channel.mlir │ │ │ │ ├── quantized_matmul_p_i8_per_tensor.mlir │ │ │ │ ├── quantized_matmul_s_i8_per_channel.mlir │ │ │ │ ├── random_uniform_d_mean.mlir │ │ │ │ ├── random_uniform_d_same_seed.mlir │ │ │ │ ├── random_uniform_d_var.mlir │ │ │ │ ├── random_uniform_s_same_seed.mlir │ │ │ │ ├── range_d_f32.mlir │ │ │ │ ├── range_s_f32.mlir │ │ │ │ ├── range_s_i64.mlir │ │ │ │ ├── real_div_d_f32.mlir │ │ │ │ ├── real_div_p_f32.mlir │ │ │ │ ├── real_div_s_f32.mlir │ │ │ │ ├── relu6_d_f32.mlir │ │ │ │ ├── relu6_p_f32.mlir │ │ │ │ ├── relu6_s_f32.mlir │ │ │ │ ├── relu_d_f32.mlir │ │ │ │ ├── relu_grad_d_f32.mlir │ │ │ │ ├── relu_grad_p_f32.mlir │ │ │ │ ├── relu_grad_s_f32.mlir │ │ │ │ ├── relu_p_f32.mlir │ │ │ │ ├── relu_s_f32.mlir │ │ │ │ ├── reshape_d_f32.mlir │ │ │ │ ├── reshape_p_f32.mlir │ │ │ │ ├── reshape_s_f32.mlir │ │ │ │ ├── reverse_d_f32.mlir │ │ │ │ ├── reverse_p_f32.mlir │ │ │ │ ├── reverse_s_f32.mlir │ │ │ │ ├── round_d_f32.mlir │ │ │ │ ├── round_p_f32.mlir │ │ │ │ ├── round_s_f32.mlir │ │ │ │ ├── rsqrt_d_f32.mlir │ │ │ │ ├── rsqrt_p_f32.mlir │ │ │ │ ├── rsqrt_s_f32.mlir │ │ │ │ ├── select_d_f32.mlir │ │ │ │ ├── select_p_f32.mlir │ │ │ │ ├── select_s_f32.mlir │ │ │ │ ├── select_v2_d_bcast_shape_f32.mlir │ │ │ │ ├── select_v2_d_same_shape_f32.mlir │ │ │ │ ├── select_v2_p_same_shape_f32.mlir │ │ │ │ ├── select_v2_s_same_shape_f32.mlir │ │ │ │ ├── shape_2d_d_i32.mlir │ │ │ │ ├── shape_2d_d_i64.mlir │ │ │ │ ├── shape_2d_p_i32.mlir │ │ │ │ ├── shape_2d_s_i32.mlir │ │ │ │ ├── shape_scalar_i32.mlir │ │ │ │ ├── shape_scalar_i64.mlir │ │ │ │ ├── sigmoid_d_f32.mlir │ │ │ │ ├── sigmoid_grad_d_f32.mlir │ │ │ │ ├── sigmoid_grad_p_f32.mlir │ │ │ │ ├── sigmoid_grad_s_f32.mlir │ │ │ │ ├── sigmoid_p_f32.mlir │ │ │ │ ├── sigmoid_s_f32.mlir │ │ │ │ ├── sign_d_f32.mlir │ │ │ │ ├── sign_p_f32.mlir │ │ │ │ ├── sign_s_f32.mlir │ │ │ │ ├── sin_d_f32.mlir │ │ │ │ ├── sin_p_f32.mlir │ │ │ │ ├── sin_s_f32.mlir │ │ │ │ ├── slice_d_f32.mlir │ │ │ │ ├── slice_p_f32.mlir │ │ │ │ ├── slice_p_f32_2.mlir │ │ │ │ ├── slice_s_f32.mlir │ │ │ │ ├── snapshot_d_f32.mlir │ │ │ │ ├── snapshot_p_f32.mlir │ │ │ │ ├── snapshot_s_f32.mlir │ │ │ │ ├── softmax_cross_entropy_with_logits_d_f32.mlir │ │ │ │ ├── softmax_cross_entropy_with_logits_p_f32.mlir │ │ │ │ ├── softmax_cross_entropy_with_logits_s_f32.mlir │ │ │ │ ├── softmax_d_f32.mlir │ │ │ │ ├── softmax_p_f32.mlir │ │ │ │ ├── softmax_s_f32.mlir │ │ │ │ ├── softplus_d_f32.mlir │ │ │ │ ├── softplus_p_f32.mlir │ │ │ │ ├── softplus_s_f32.mlir │ │ │ │ ├── sparse_fill_empty_rows_d_f32.mlir │ │ │ │ ├── sparse_fill_empty_rows_d_i64.mlir │ │ │ │ ├── sparse_fill_empty_rows_p_f32.mlir │ │ │ │ ├── sparse_reshape.mlir │ │ │ │ ├── sparse_segment_mean_d_f32_1d.mlir │ │ │ │ ├── sparse_segment_mean_d_f32_2d.mlir │ │ │ │ ├── sparse_segment_mean_d_f32_2d_index_i64.mlir │ │ │ │ ├── sparse_segment_mean_d_f32_3d.mlir │ │ │ │ ├── sparse_segment_mean_d_f32_4d.mlir │ │ │ │ ├── sparse_segment_mean_d_f32_5d.mlir │ │ │ │ ├── sparse_segment_mean_p_f32_1d.mlir │ │ │ │ ├── sparse_segment_mean_p_f64_2d.mlir │ │ │ │ ├── sparse_segment_mean_s_f32_1d.mlir │ │ │ │ ├── sparse_segment_mean_s_f32_2d.mlir │ │ │ │ ├── sparse_segment_sum_d_f32_2d.mlir │ │ │ │ ├── sparse_segment_sum_p_f64_2d.mlir │ │ │ │ ├── sparse_segment_sum_s_f32_2d.mlir │ │ │ │ ├── split_d_f32.mlir │ │ │ │ ├── split_p_f32.mlir │ │ │ │ ├── split_s_f32.mlir │ │ │ │ ├── sqrt_d_f32.mlir │ │ │ │ ├── sqrt_p_f32.mlir │ │ │ │ ├── sqrt_s_f32.mlir │ │ │ │ ├── squared_difference_d_f32.mlir │ │ │ │ ├── squared_difference_p_f32.mlir │ │ │ │ ├── squared_difference_s_f32.mlir │ │ │ │ ├── squeeze_d_f32.mlir │ │ │ │ ├── squeeze_d_f32_2.mlir │ │ │ │ ├── squeeze_d_f32_3.mlir │ │ │ │ ├── squeeze_p_f32.mlir │ │ │ │ ├── squeeze_s_f32.mlir │ │ │ │ ├── strided_slice_d_3d_f32.mlir │ │ │ │ ├── strided_slice_d_f32.mlir │ │ │ │ ├── strided_slice_d_f32_2.mlir │ │ │ │ ├── strided_slice_p_f32.mlir │ │ │ │ ├── strided_slice_p_i32.mlir │ │ │ │ ├── strided_slice_p_i32_2.mlir │ │ │ │ ├── strided_slice_s_f32.mlir │ │ │ │ ├── strided_slice_s_f32_2.mlir │ │ │ │ ├── strided_slice_with_newaxis_d_f32.mlir │ │ │ │ ├── sub_d_f32.mlir │ │ │ │ ├── sub_p_f32.mlir │ │ │ │ ├── sub_s_f32.mlir │ │ │ │ ├── sum_col_d_2d_f16.mlir │ │ │ │ ├── sum_col_d_2d_f32.mlir │ │ │ │ ├── sum_col_d_2d_f64.mlir │ │ │ │ ├── sum_col_d_2d_i8.mlir │ │ │ │ ├── sum_col_d_3d_f32.mlir │ │ │ │ ├── sum_col_p_2d_f32.mlir │ │ │ │ ├── sum_col_p_3d_f32.mlir │ │ │ │ ├── sum_col_s_2d_f32.mlir │ │ │ │ ├── sum_col_s_3d_f32.mlir │ │ │ │ ├── sum_row_d_2d_f32.mlir │ │ │ │ ├── sum_row_d_3d_f32.mlir │ │ │ │ ├── sum_row_d_3d_f64.mlir │ │ │ │ ├── sum_row_p_2d_f32.mlir │ │ │ │ ├── sum_row_p_3d_f32.mlir │ │ │ │ ├── sum_row_s_2d_f16.mlir │ │ │ │ ├── sum_row_s_2d_f32.mlir │ │ │ │ ├── sum_row_s_2d_i32.mlir │ │ │ │ ├── sum_row_s_2d_i64.mlir │ │ │ │ ├── sum_row_s_3d_f16.mlir │ │ │ │ ├── sum_row_s_3d_f32.mlir │ │ │ │ ├── sum_row_s_3d_i64.mlir │ │ │ │ ├── tanh_d_f32.mlir │ │ │ │ ├── tanh_p_f32.mlir │ │ │ │ ├── tanh_s_f32.mlir │ │ │ │ ├── tile_d_f32.mlir │ │ │ │ ├── tile_p_f32.mlir │ │ │ │ ├── tile_p_i32.mlir │ │ │ │ ├── tile_s_f32.mlir │ │ │ │ ├── topk_d_f32.mlir │ │ │ │ ├── topk_d_i32.mlir │ │ │ │ ├── topk_p_f32.mlir │ │ │ │ ├── topk_s_f32.mlir │ │ │ │ ├── transpose_2d_s_f32.mlir │ │ │ │ ├── transpose_3d_s_f32.mlir │ │ │ │ ├── transpose_d_f32.mlir │ │ │ │ ├── transpose_p_f32.mlir │ │ │ │ ├── transpose_s_f32.mlir │ │ │ │ ├── unpack_d_f32.mlir │ │ │ │ ├── unpack_p_f32.mlir │ │ │ │ ├── unpack_s_f32.mlir │ │ │ │ ├── where_d_bool_1d.mlir │ │ │ │ ├── where_d_bool_6d.mlir │ │ │ │ ├── where_d_f32_4d.mlir │ │ │ │ ├── where_p_bool_3d.mlir │ │ │ │ ├── where_p_f32_3d.mlir │ │ │ │ ├── where_p_f64_3d.mlir │ │ │ │ ├── where_p_i32_3d.mlir │ │ │ │ ├── where_p_i64_3d.mlir │ │ │ │ ├── where_p_i8_5d.mlir │ │ │ │ ├── where_s_bool_2d.mlir │ │ │ │ ├── zeros_like_d_f32.mlir │ │ │ │ ├── zeros_like_p_f32.mlir │ │ │ │ └── zeros_like_s_f32.mlir │ │ │ │ ├── depthwise_conv2d_native.cc │ │ │ │ ├── dequantize.cc │ │ │ │ ├── dynamic_stitch.cc │ │ │ │ ├── einsum.cc │ │ │ │ ├── equal.cc │ │ │ │ ├── erf.cc │ │ │ │ ├── exp.cc │ │ │ │ ├── expand_dims.cc │ │ │ │ ├── fill.cc │ │ │ │ ├── floor.cc │ │ │ │ ├── floor_div.cc │ │ │ │ ├── floor_mod.cc │ │ │ │ ├── gather_nd.cc │ │ │ │ ├── gather_v2.cc │ │ │ │ ├── greater.cc │ │ │ │ ├── greater_equal.cc │ │ │ │ ├── identity.cc │ │ │ │ ├── inline_h2d.cc │ │ │ │ ├── isfinite.cc │ │ │ │ ├── less.cc │ │ │ │ ├── less_equal.cc │ │ │ │ ├── log.cc │ │ │ │ ├── logical_and.cc │ │ │ │ ├── logical_not.cc │ │ │ │ ├── logical_or.cc │ │ │ │ ├── matmul.cc │ │ │ │ ├── max.cc │ │ │ │ ├── maximum.cc │ │ │ │ ├── mean.cc │ │ │ │ ├── min.cc │ │ │ │ ├── minimum.cc │ │ │ │ ├── mul.cc │ │ │ │ ├── neg.cc │ │ │ │ ├── not_equal.cc │ │ │ │ ├── pack.cc │ │ │ │ ├── pad.cc │ │ │ │ ├── pow.cc │ │ │ │ ├── prod.cc │ │ │ │ ├── quantize_v2.cc │ │ │ │ ├── quantized_conv2d.cc │ │ │ │ ├── quantized_matmul.cc │ │ │ │ ├── random_uniform.cc │ │ │ │ ├── range.cc │ │ │ │ ├── real_div.cc │ │ │ │ ├── relu.cc │ │ │ │ ├── relu6.cc │ │ │ │ ├── relu_grad.cc │ │ │ │ ├── reshape.cc │ │ │ │ ├── reverse.cc │ │ │ │ ├── round.cc │ │ │ │ ├── rsqrt.cc │ │ │ │ ├── select.cc │ │ │ │ ├── select_v2.cc │ │ │ │ ├── shape.cc │ │ │ │ ├── sigmoid.cc │ │ │ │ ├── sigmoid_grad.cc │ │ │ │ ├── sign.cc │ │ │ │ ├── sin.cc │ │ │ │ ├── slice.cc │ │ │ │ ├── snapshot.cc │ │ │ │ ├── softmax.cc │ │ │ │ ├── softmax_cross_entropy_with_logits.cc │ │ │ │ ├── softplus.cc │ │ │ │ ├── sparse_fill_empty_rows.cc │ │ │ │ ├── sparse_reshape.cc │ │ │ │ ├── sparse_segment_mean.cc │ │ │ │ ├── sparse_segment_sum.cc │ │ │ │ ├── split.cc │ │ │ │ ├── sqrt.cc │ │ │ │ ├── squared_difference.cc │ │ │ │ ├── squeeze.cc │ │ │ │ ├── strided_slice.cc │ │ │ │ ├── sub.cc │ │ │ │ ├── sum.cc │ │ │ │ ├── tanh.cc │ │ │ │ ├── tile.cc │ │ │ │ ├── topk.cc │ │ │ │ ├── transpose.cc │ │ │ │ ├── unpack.cc │ │ │ │ ├── where.cc │ │ │ │ └── zeros_like.cc │ │ ├── tools │ │ │ ├── BUILD │ │ │ ├── disc-opt │ │ │ │ └── disc-opt.cc │ │ │ ├── disc-pdll │ │ │ │ ├── README.md │ │ │ │ ├── disc-pdll.cc │ │ │ │ └── tests │ │ │ │ │ ├── BUILD │ │ │ │ │ ├── multi_outputs.mlir │ │ │ │ │ ├── multi_outputs.pdll │ │ │ │ │ ├── single_output.mlir │ │ │ │ │ └── single_output.pdll │ │ │ ├── disc-replay │ │ │ │ ├── BUILD │ │ │ │ ├── README.md │ │ │ │ ├── disc_interpreter.cc │ │ │ │ ├── disc_interpreter.h │ │ │ │ ├── disc_replay_main.cc │ │ │ │ ├── record.cc │ │ │ │ ├── record.h │ │ │ │ ├── replay_test.cc │ │ │ │ ├── tar_helper.h │ │ │ │ └── test_data │ │ │ │ │ ├── BUILD │ │ │ │ │ ├── data.tar │ │ │ │ │ └── program.pb │ │ │ ├── disc-source-emitter │ │ │ │ ├── disc-cuda-emitter.cc │ │ │ │ └── tests │ │ │ │ │ ├── BUILD │ │ │ │ │ └── element-wise.mlir │ │ │ └── disc-transform │ │ │ │ ├── BUILD │ │ │ │ ├── LinalgExt │ │ │ │ ├── LinalgExtBase.td │ │ │ │ ├── LinalgExtDialect.cc │ │ │ │ ├── LinalgExtDialect.h │ │ │ │ ├── LinalgExtEnums.td │ │ │ │ ├── LinalgExtInterfaces.cc │ │ │ │ ├── LinalgExtInterfaces.h │ │ │ │ ├── LinalgExtInterfaces.td │ │ │ │ ├── LinalgExtOps.cc │ │ │ │ ├── LinalgExtOps.h │ │ │ │ ├── LinalgExtOps.td │ │ │ │ └── tests │ │ │ │ │ ├── BUILD │ │ │ │ │ ├── canonicalize.mlir │ │ │ │ │ ├── invalid_ops.mlir │ │ │ │ │ └── ops.mlir │ │ │ │ ├── TransformOps │ │ │ │ ├── GPUPipeline.cc │ │ │ │ ├── OptimizeShareMemory.cc │ │ │ │ ├── TransformOpsExt.cc │ │ │ │ ├── TransformOpsExt.h │ │ │ │ └── TransformOpsExt.td │ │ │ │ ├── transforms │ │ │ │ ├── PassDetail.h │ │ │ │ ├── convert_forall_op_to_parallel_op.cc │ │ │ │ ├── legalize_lmhlo_fusion_to_linalg.cc │ │ │ │ ├── memref_copy_to_linalg.cc │ │ │ │ ├── passes.h │ │ │ │ ├── register_passes.h │ │ │ │ ├── rewrite_payload_ir_for_ral.cc │ │ │ │ ├── tests │ │ │ │ │ ├── BUILD │ │ │ │ │ ├── apply-patterns-canonicalization.mlir │ │ │ │ │ ├── cache-read.mlir │ │ │ │ │ ├── conditional-generic.mlir │ │ │ │ │ ├── convert-forall-to-parallel.mlir │ │ │ │ │ ├── convert-padding-placeholder-to-const.mlir │ │ │ │ │ ├── decompose-vectors.mlir │ │ │ │ │ ├── disc-bufferize.mlir │ │ │ │ │ ├── fold-producer-extract-slice.mlir │ │ │ │ │ ├── forall-to-gpu-ctas.mlir │ │ │ │ │ ├── forall-to-gpu-warps.mlir │ │ │ │ │ ├── fuse-into-containing-op.mlir │ │ │ │ │ ├── gmem-to-smem.mlir │ │ │ │ │ ├── inline-and-convert-gpu-ids.mlir │ │ │ │ │ ├── inline-reduction-initializer.mlir │ │ │ │ │ ├── legalize-lmhlo-fusion-to-linalg.mlir │ │ │ │ │ ├── linalg-eagerly-backward-init-tensor.mlir │ │ │ │ │ ├── linalg-fuse-operand.mlir │ │ │ │ │ ├── linalg-fuse-producers.mlir │ │ │ │ │ ├── lower-conditional-generic.mlir │ │ │ │ │ ├── lower-multi-level-pack-to-loop.mlir │ │ │ │ │ ├── memref-copy-to-linalg.mlir │ │ │ │ │ ├── metadata-only-transform-dialect-interpreter-standalone.mlir │ │ │ │ │ ├── promote-dot-operands.mlir │ │ │ │ │ ├── reduction-input-fuse.mlir │ │ │ │ │ ├── reduction-output-fuse.mlir │ │ │ │ │ ├── replace-const-padding-value.mlir │ │ │ │ │ ├── rewrite-payload-ir-for-ral.mlir │ │ │ │ │ ├── split-reduction-serial.mlir │ │ │ │ │ ├── transfer-write-zero-to-scf.mlir │ │ │ │ │ ├── transform-dialect-interpreter.mlir │ │ │ │ │ ├── vector-to-mma-conversion.mlir │ │ │ │ │ └── vectorize-conditional-generic.mlir │ │ │ │ ├── transform_dialect_interpreter.cc │ │ │ │ └── transform_passes.td │ │ │ │ ├── utils.cc │ │ │ │ └── utils.h │ │ ├── transforms │ │ │ ├── PassDetail.h │ │ │ ├── codegen_utils.cc │ │ │ ├── codegen_utils.h │ │ │ ├── conv_rewriter.cc │ │ │ ├── disc_algebraic_simplifier.cc │ │ │ ├── disc_argsmutation_expand.cc │ │ │ ├── disc_assign_kernel_name.cc │ │ │ ├── disc_assign_memory_space.cc │ │ │ ├── disc_bf16_expansion.cc │ │ │ ├── disc_buffer_deallocation.cc │ │ │ ├── disc_canonicalizer.cc │ │ │ ├── disc_collective_ops_rewriter.cc │ │ │ ├── disc_comp_intens_fusion_to_cuda_source.cc │ │ │ ├── disc_comp_intens_fusion_to_func.cc │ │ │ ├── disc_convert_const_to_ral.cc │ │ │ ├── disc_convert_fake_quant_op.cc │ │ │ ├── disc_cpu_map_parallel_loop.cc │ │ │ ├── disc_custom_call_rewriter.cc │ │ │ ├── disc_dense_to_sparse.cc │ │ │ ├── disc_dot_merge.cc │ │ │ ├── disc_duplicate_computation_after_fusion.cc │ │ │ ├── disc_duplicate_computation_for_fusion.cc │ │ │ ├── disc_dynamic_slice_converter.cc │ │ │ ├── disc_erase_buffer_deallocation.cc │ │ │ ├── disc_flatten_memref_access.cc │ │ │ ├── disc_for_loop_unroll_interleave.cc │ │ │ ├── disc_function_dead_argument_elimination.cc │ │ │ ├── disc_fuse_splat_const.cc │ │ │ ├── disc_gpu_kernel_to_blob.cc │ │ │ ├── disc_gpu_source_to_lib.cc │ │ │ ├── disc_hlo_legalize_to_lhlo.cc │ │ │ ├── disc_hlo_to_std.cc │ │ │ ├── disc_input_output_alias.cc │ │ │ ├── disc_lhlo_rewriter.cc │ │ │ ├── disc_llvm_insert_value_simplifier.cc │ │ │ ├── disc_lower_gpu_ops_common.cc │ │ │ ├── disc_lower_gpu_ops_common.h │ │ │ ├── disc_lower_gpu_ops_to_nvvm_ops.cc │ │ │ ├── disc_lower_gpu_ops_to_rocdl_ops.cc │ │ │ ├── disc_lower_quantize_and_dequantize.cc │ │ │ ├── disc_lower_to_library_call.cc │ │ │ ├── disc_map_chlo_to_hlo_op.h │ │ │ ├── disc_map_hlo_to_lhlo_op.h │ │ │ ├── disc_math_approximation.cc │ │ │ ├── disc_memref_canonicalizer.cc │ │ │ ├── disc_memref_cse.cc │ │ │ ├── disc_memref_load_store_simplifier.cc │ │ │ ├── disc_op_schedule.cc │ │ │ ├── disc_optimization_barrier_expand.cc │ │ │ ├── disc_outline_cpu_kernel.cc │ │ │ ├── disc_passes.td │ │ │ ├── disc_pdl_utils.cc │ │ │ ├── disc_pdl_utils.h │ │ │ ├── disc_quantized_dot_merge.cc │ │ │ ├── disc_reduce_buffer_live_range.cc │ │ │ ├── disc_remove_dead_buffer.cc │ │ │ ├── disc_shape_optimization.cc │ │ │ ├── disc_shape_optimization_utils.cc │ │ │ ├── disc_shape_optimization_utils.h │ │ │ ├── disc_shape_propagate.cc │ │ │ ├── disc_shape_simplifier.cc │ │ │ ├── disc_shape_to_std.cc │ │ │ ├── disc_side_effect_loop_invariant_code_motion.cc │ │ │ ├── disc_sparse_op_rewriter.cc │ │ │ ├── disc_specialize_fusion_with_speculation.cc │ │ │ ├── disc_std_bufferize.cc │ │ │ ├── disc_stitch_fusion.cc │ │ │ ├── disc_strip_shape_constraint_ops.cc │ │ │ ├── disc_supported_list.h.inc │ │ │ ├── disc_tensor_to_std.cc │ │ │ ├── disc_to_llvm.cc │ │ │ ├── disc_to_llvm_common.cc │ │ │ ├── disc_to_llvm_common.h │ │ │ ├── disc_transform_legalize_to_loop.cc │ │ │ ├── disc_transform_schedule.cc │ │ │ ├── disc_transform_schedule.h │ │ │ ├── disc_transform_weight_data_layout_for_weight_only_gemm.cc │ │ │ ├── disc_transpose_simplifier.cc │ │ │ ├── disc_unhandled_atomic_rmw_converter.cc │ │ │ ├── dot_rewriter.cc │ │ │ ├── element_type_converter.cc │ │ │ ├── fusion_utils.cc │ │ │ ├── fusion_utils.h │ │ │ ├── fusion_utils_dot_gpu.cc │ │ │ ├── fusion_utils_sparse_op_cpu.cc │ │ │ ├── fusion_utils_stitch_gpu.cc │ │ │ ├── fusion_utils_transform_based.cc │ │ │ ├── gpu_conv_padding.cc │ │ │ ├── input_inline_fusion_pass.cc │ │ │ ├── input_inline_fusion_pattern.cc │ │ │ ├── input_inline_fusion_pattern.h │ │ │ ├── legalize_to_cubin.cc │ │ │ ├── lhlo_elemental_utils.cc │ │ │ ├── lhlo_elemental_utils.h │ │ │ ├── lhlo_fusion.cc │ │ │ ├── lhlo_fusion_inliner.cc │ │ │ ├── lhlo_legalize_roots_to_loops.cc │ │ │ ├── lower_tf.cc │ │ │ ├── lower_tf.td │ │ │ ├── mhlo_decomp_rewriters.cc │ │ │ ├── mhlo_disc_passes.td │ │ │ ├── mhlo_mark_shape_calc.cc │ │ │ ├── mhlo_placer.cc │ │ │ ├── parallel_loop_collapsing.cc │ │ │ ├── parallel_loop_tiling.cc │ │ │ ├── passes.h │ │ │ ├── placement_utils.cc │ │ │ ├── placement_utils.h │ │ │ ├── quantized_dot_rewriter.cc │ │ │ ├── ral_inject_execution_context.cc │ │ │ ├── reduction_rewriters.cc │ │ │ ├── register_passes.h │ │ │ ├── remove_shape_constraints.cc │ │ │ ├── revise_args_for_static_rank.cc │ │ │ ├── revise_kernel_outlining.cc │ │ │ ├── rewriters.h │ │ │ ├── shape_utils.cc │ │ │ ├── shape_utils.h │ │ │ ├── split_large_ops.cc │ │ │ └── tests │ │ │ │ ├── BUILD │ │ │ │ ├── conv-rewrite.mlir │ │ │ │ ├── cpu-only-lmhlo-fusion.mlir │ │ │ │ ├── cpu-only-sparse-fill-empty-rows-lhlo-legalize-roots-to-loops.mlir │ │ │ │ ├── cpu-only-sparse-op-fusion.mlir │ │ │ │ ├── cpu-only-sparse-op-rewriter.mlir │ │ │ │ ├── cpu-only-sparse-reshape-lhlo-legalize-roots-to-loops.mlir │ │ │ │ ├── cpu-only-sparse-segment-reduction-lhlo-legalize-roots-to-loops.mlir │ │ │ │ ├── cpu-only-where.mlir │ │ │ │ ├── disc-algebraic-simplifier.mlir │ │ │ │ ├── disc-assign-kernel-name.mlir │ │ │ │ ├── disc-assign-memory-space.mlir │ │ │ │ ├── disc-async-collective-ops-rewriter.mlir │ │ │ │ ├── disc-bf16-expansion.mlir │ │ │ │ ├── disc-buffer-deallocation.mlir │ │ │ │ ├── disc-collective-ops-rewriter.mlir │ │ │ │ ├── disc-const-to-ral.mlir │ │ │ │ ├── disc-convert-fake-quant-op.mlir │ │ │ │ ├── disc-convert-tensor-to-std.mlir │ │ │ │ ├── disc-convert-weight-layout-for-weight-only-gemm.mlir │ │ │ │ ├── disc-custom-call-rewriter.mlir │ │ │ │ ├── disc-dense-to-sparse.mlir │ │ │ │ ├── disc-dot-merge.mlir │ │ │ │ ├── disc-duplicate-computation-after-fusion.mlir │ │ │ │ ├── disc-duplicate-computation-for-fusion.mlir │ │ │ │ ├── disc-flatten-memref-access.mlir │ │ │ │ ├── disc-fold-quantize.mlir │ │ │ │ ├── disc-function-dead-argument-elimination.mlir │ │ │ │ ├── disc-fuse-splat-const.mlir │ │ │ │ ├── disc-hlo-legalize-to-lhlo.mlir │ │ │ │ ├── disc-input-inline-fusion.mlir │ │ │ │ ├── disc-input-output-alias.mlir │ │ │ │ ├── disc-legalize-printf-to-llvm.mlir │ │ │ │ ├── disc-lhlo-rewrite.mlir │ │ │ │ ├── disc-llvm-insert-value-simplifier.mlir │ │ │ │ ├── disc-lower-gpu-quantize-and-dequantize.mlir │ │ │ │ ├── disc-lower-quantize-and-dequantize.mlir │ │ │ │ ├── disc-lower-to-library-call.mlir │ │ │ │ ├── disc-math-approximation.mlir │ │ │ │ ├── disc-memref-canonicalizer.mlir │ │ │ │ ├── disc-memref-load-store-simplifier.mlir │ │ │ │ ├── disc-optimization-barrier-expand.mlir │ │ │ │ ├── disc-quantized-dot-merge.mlir │ │ │ │ ├── disc-ral-inject_execution_context.mlir │ │ │ │ ├── disc-ral-legalize-alloc-dealloc-to-llvm.mlir │ │ │ │ ├── disc-remove-dead-buffer.mlir │ │ │ │ ├── disc-shape-optimization.mlir │ │ │ │ ├── disc-shape-propagate.mlir │ │ │ │ ├── disc-shape-simplifier-tie-shape.mlir │ │ │ │ ├── disc-shape-simplifier.mlir │ │ │ │ ├── disc-shape-to-std.mlir │ │ │ │ ├── disc-side-effect-loop-invariant-code-motion.mlir │ │ │ │ ├── disc-tf-fake-quant-invalid.mlir │ │ │ │ ├── disc-tf-fake-quant.mlir │ │ │ │ ├── disc-transpose-simplifier.mlir │ │ │ │ ├── disc_cse.mlir │ │ │ │ ├── dot_rewriter.mlir │ │ │ │ ├── dynamic-reshape-canonicalizer.mlir │ │ │ │ ├── element_type_converter.mlir │ │ │ │ ├── element_type_converter_conv.mlir │ │ │ │ ├── element_type_converter_gemm.mlir │ │ │ │ ├── gpu-only-lhlo-fusion-shape-constraint.mlir │ │ │ │ ├── gpu-only-lhlo-fusion.mlir │ │ │ │ ├── gpu-only-lhlo-legalize-roots-to-loops-shape-constraint.mlir │ │ │ │ ├── gpu-only-lhlo-legalize-roots-to-loops.mlir │ │ │ │ ├── gpu-only-unroll-interleave.mlir │ │ │ │ ├── gpu_conv_padding.mlir │ │ │ │ ├── input-mutation.mlir │ │ │ │ ├── lhlo-input-inline-fusion.mlir │ │ │ │ ├── memref-load-cse.mlir │ │ │ │ ├── mhlo-dynamic-slice-convert.mlir │ │ │ │ ├── mhlo_decomp_rewriter.mlir │ │ │ │ ├── mhlo_mark_shape_calc_op.mlir │ │ │ │ ├── mhlo_place_ops.mlir │ │ │ │ ├── parallel-loop-tiling-inbound-check.mlir │ │ │ │ ├── quantized-disc-dot-rewriter.mlir │ │ │ │ ├── reduction_rewriter.mlir │ │ │ │ ├── revise-kernel-outlining.mlir │ │ │ │ ├── revise_args.mlir │ │ │ │ ├── specialize_fusion_with_speculation.mlir │ │ │ │ ├── specialize_fusion_with_speculation_shape_constraint.mlir │ │ │ │ └── split_large_ops.mlir │ │ └── utils │ │ │ ├── cutlass_required_headers.cu │ │ │ ├── cycle_detector.cc │ │ │ ├── cycle_detector.h │ │ │ ├── cycle_detector_test.cc │ │ │ ├── gemm_fusion_linear_base_template_sm75.hpp │ │ │ ├── gemm_fusion_linear_base_template_sm80.hpp │ │ │ ├── preprocess_hdrs_to_rstr.sh │ │ │ ├── source_emitter.cc │ │ │ └── source_emitter.h │ ├── ral │ │ ├── BUILD │ │ ├── collective.cu.cc │ │ ├── collective.h │ │ ├── context │ │ │ ├── base │ │ │ │ ├── base_context.cc │ │ │ │ ├── base_context.h │ │ │ │ ├── cpu │ │ │ │ │ ├── cpu_context_impl.cc │ │ │ │ │ └── cpu_context_impl.h │ │ │ │ └── cuda │ │ │ │ │ ├── cuda_context_impl.cc │ │ │ │ │ ├── cuda_context_impl.h │ │ │ │ │ ├── cuda_stream.cc │ │ │ │ │ └── cuda_stream.h │ │ │ ├── common_context_impl.cc │ │ │ ├── common_context_impl.h │ │ │ ├── common_context_impl_acl.cc │ │ │ ├── common_context_impl_acl.h │ │ │ ├── common_context_impl_cuda.cc │ │ │ ├── common_context_impl_mkldnn.cc │ │ │ ├── common_context_impl_mkldnn.h │ │ │ ├── common_context_impl_pdll.cc │ │ │ ├── common_context_impl_quantization.cc │ │ │ ├── common_context_impl_quantization.h │ │ │ ├── context_util.h │ │ │ ├── cuda_impl_sparse.cc │ │ │ ├── init_stream_executor.cc │ │ │ ├── init_stream_executor.h │ │ │ ├── mkldnn │ │ │ │ └── ideep │ │ │ │ │ ├── ideep.hpp │ │ │ │ │ ├── ideep │ │ │ │ │ ├── abstract_types.hpp │ │ │ │ │ ├── allocators.hpp │ │ │ │ │ ├── attributes.hpp │ │ │ │ │ ├── computations.hpp │ │ │ │ │ ├── lru_cache.hpp │ │ │ │ │ ├── operators │ │ │ │ │ │ ├── conv.hpp │ │ │ │ │ │ ├── deconv.hpp │ │ │ │ │ │ └── matmul.hpp │ │ │ │ │ ├── tensor.hpp │ │ │ │ │ └── utils.hpp │ │ │ │ │ └── ideep_pin_singletons.hpp │ │ │ ├── pdll_util.cc │ │ │ ├── pdll_util.h │ │ │ ├── quantized_gpu_kernel_impl.cc │ │ │ ├── stream_executor_based_impl.cc │ │ │ ├── stream_executor_based_impl.h │ │ │ └── tensorflow │ │ │ │ ├── tf_context_impl.cc │ │ │ │ ├── tf_context_impl.h │ │ │ │ └── tf_kernel_impl.cc │ │ ├── context_version_scripts.lds │ │ ├── device │ │ │ ├── cpu │ │ │ │ ├── cpu_driver.cc │ │ │ │ └── cpu_driver.h │ │ │ └── gpu │ │ │ │ ├── gpu_driver.cc │ │ │ │ └── gpu_driver.h │ │ ├── ral_api.cc │ │ ├── ral_api.h │ │ ├── ral_base.h │ │ ├── ral_context.cc │ │ ├── ral_context.h │ │ ├── ral_driver.h │ │ ├── ral_helper.cc │ │ ├── ral_helper.h │ │ ├── ral_logging.cc │ │ ├── ral_logging.h │ │ ├── ral_md5.cc │ │ ├── ral_md5.h │ │ ├── ral_metadata.cc │ │ ├── ral_metadata.h │ │ ├── ral_metadata_test.cc │ │ └── test │ │ │ ├── bace.py │ │ │ ├── codgen_kernels.py │ │ │ ├── raw_cuda_test.cc │ │ │ ├── run.sh │ │ │ └── test.mlir │ └── util │ │ ├── BUILD │ │ └── util.bzl ├── tao └── third_party │ └── iree │ ├── BUILD │ └── StructuredTransformOpsExt.cpp.patch ├── tensorflow_blade ├── .bazelrc ├── .bazelversion ├── .flake8 ├── .isort.cfg ├── .mypy.ini ├── BUILD ├── README.md ├── WORKSPACE ├── build.py ├── build_defs.bzl ├── build_pip_package.sh ├── common_internal.py ├── docs │ ├── build_from_source.md │ └── tutorials │ │ └── tensorflow_blade_bert_inference.md ├── examples │ └── Inference │ │ └── CUDA │ │ └── BERT │ │ ├── README.md │ │ └── bert_inference_opt.py ├── pyproject.toml ├── requirement-common.txt ├── requirement-tf2.5.0-cpu.txt ├── requirement-tf2.5.0-cu113.txt ├── setup.py ├── src │ ├── BUILD │ ├── custom_ops │ │ ├── BUILD │ │ └── trt_engine_op │ │ │ ├── BUILD │ │ │ └── trt_engine_op.cc │ ├── pybind.cpp │ ├── tensorrt │ │ ├── BUILD │ │ ├── bridge │ │ │ ├── macros.h │ │ │ ├── tensorrt_common.cpp │ │ │ ├── tensorrt_common.h │ │ │ ├── tensorrt_flags.cpp │ │ │ ├── tensorrt_flags.h │ │ │ ├── tensorrt_logger.cpp │ │ │ ├── tensorrt_logger.h │ │ │ ├── tensorrt_onnx_parser.cpp │ │ │ ├── tensorrt_onnx_parser.h │ │ │ ├── tensorrt_tf_allocator.cc │ │ │ ├── tensorrt_tf_allocator.h │ │ │ ├── tensorrt_tf_resource_mgr.cc │ │ │ └── tensorrt_tf_resource_mgr.h │ │ ├── pybind_functions.cpp │ │ └── pybind_functions.h │ ├── tf_blade.lds │ ├── tf_compatible_version.h.in │ └── util │ │ ├── BUILD │ │ ├── logging.h │ │ ├── logging_test.cc │ │ ├── tf_allocator_util.cc │ │ ├── tf_allocator_util.h │ │ └── tf_allocator_util_test.cc ├── tests │ ├── __init__.py │ ├── gpu │ │ ├── __init__.py │ │ └── tf_to_trt_test.py │ ├── pytest.ini │ ├── tf_test_common.py │ └── util │ │ ├── __init__.py │ │ ├── simple_graph_test.py │ │ └── tf_util_test.py ├── tf_blade │ ├── __init__.py │ ├── common │ │ ├── __init__.py │ │ └── tf_grappler.py │ ├── gpu │ │ ├── __init__.py │ │ └── tf_to_trt.py │ ├── py.typed │ └── util │ │ ├── __init__.py │ │ ├── graph_transform.py │ │ ├── simple_graph.py │ │ ├── tf2onnx_import_helper.py │ │ ├── tf_conversion_util.py │ │ ├── tf_graph_transform_util.py │ │ ├── tf_hierarchy_pattern_match.py │ │ ├── tf_import_helper.py │ │ └── tf_util.py ├── version.py ├── workspace0.bzl ├── workspace1.bzl ├── workspace2.bzl └── workspace_platform_alibaba.bzl ├── third_party ├── .bazelversion ├── WORKSPACE └── bazel │ ├── BUILD │ ├── acl │ ├── BUILD │ ├── acl.BUILD │ ├── acl_gemm_hybrid_indirect.patch │ ├── acl_makefile.patch │ └── acl_yitian.patch │ ├── blade_disc_dnn_workspace.bzl │ ├── blade_disc_helper │ ├── BUILD │ ├── BUILD.tpl │ ├── blade_disc_helper_configure.bzl │ └── build_defs.bzl.tpl │ ├── blade_service_common │ ├── BUILD │ ├── BUILD.tpl │ ├── blade_service_common_configure.bzl │ └── blade_service_common_empty_workspace.bzl.tpl │ ├── common.bzl │ ├── cuda_supplement │ ├── BUILD │ ├── build_defs.bzl.tpl │ ├── cuda_supplement.BUILD.tpl │ ├── cuda_supplement_configure.bzl │ └── dummy.BUILD.tpl │ ├── mkl │ ├── BUILD │ ├── BUILD.tpl │ ├── build_defs.bzl.tpl │ └── mkl_configure.bzl │ ├── mkldnn │ ├── BUILD │ ├── mkl_include.BUILD │ └── mkl_static.BUILD │ ├── onednn │ ├── BUILD │ ├── BUILD.tpl │ ├── onednn.BUILD.tpl │ ├── onednn.bzl.tpl │ └── onednn_configure.bzl │ ├── tensorrt │ ├── BUILD │ ├── README.md │ ├── build_defs.bzl.tpl │ ├── repo.bzl │ └── trt.BUILD.tpl │ ├── tf │ ├── BUILD │ ├── BUILD.tpl │ ├── build_defs.bzl.tpl │ └── tf_configure.bzl │ ├── tf_protobuf │ ├── BUILD │ ├── BUILD.tpl │ ├── protobuf-3.8.0.BUILD.tpl │ ├── protobuf-3.8.0.bzl.tpl │ ├── protobuf-3.8.0.patch.tpl │ ├── protobuf-3.9.2.BUILD.tpl │ ├── protobuf-3.9.2.bzl.tpl │ ├── protobuf-3.9.2.patch.tpl │ ├── tf_protobuf_configure.bzl │ └── tf_protobuf_workspace.bzl.tpl │ └── third_party │ ├── BUILD │ ├── blade_gemm.BUILD │ └── cub.BUILD └── tools └── torch_quant ├── README.md ├── bert_ptq_demo.py ├── requirements-dev.txt ├── setup.py ├── test.sh ├── tests ├── __init__.py ├── models.py ├── test_amp_module.py ├── test_bias_releated_situations.py ├── test_graph_mod_context.py ├── test_graph_mod_helper.py ├── test_histogram_observer.py ├── test_lsq_observer.py ├── test_min_max_observer.py ├── test_module_copy_and_replace.py ├── test_module_fx_trace.py ├── test_pass_fuse_modules.py ├── test_pass_insert_act_observer.py ├── test_pass_quantizable_module_to_amp.py ├── test_pass_set_qconfig.py └── test_quantizer.py └── torch_quant ├── __init__.py ├── amp_module.py ├── graph.py ├── mnn ├── MNN_compression.proto ├── MNN_compression_pb2.py ├── export.py ├── onnx_passes.py └── onnx_utils.py ├── module.py ├── observed_module.py ├── observer.py ├── quantizer.py ├── utils.py └── version.py /.bazelversion: -------------------------------------------------------------------------------- 1 | 6.1.0 2 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | # Run manually to reformat a file: 2 | # clang-format -i --style=file 3 | BasedOnStyle: Google 4 | DerivePointerAlignment: false -------------------------------------------------------------------------------- /.github/workflows/auto_rebase.yml: -------------------------------------------------------------------------------- 1 | name: AutoRebase 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | AUTO-REBASE: 8 | runs-on: ubuntu-latest 9 | steps: 10 | # Runs a single command using the runners shell 11 | - name: Checkout 12 | uses: actions/checkout@v2.4.0 13 | - name: AutoRebase 14 | env: 15 | # GITHUB_TOKEN is used for this repo 16 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 17 | # BOT_GITHUB_TOKEN is used for other BladeDISC repo 18 | BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} 19 | run: bash scripts/ci/auto_rebase.sh 20 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: local 3 | hooks: 4 | - id: copyright_checker 5 | name: copyright_checker 6 | entry: python ./scripts/pre-commit/copyright.py 7 | language: system 8 | files: \.(cc|cpp|h|py|sh)$ 9 | - repo: https://github.com/pre-commit/mirrors-clang-format 10 | rev: v10.0.1 11 | hooks: 12 | - id: clang-format 13 | name: clang-format 14 | 15 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.23.01 2 | -------------------------------------------------------------------------------- /docker/cronjobs/Dockerfile.dummy: -------------------------------------------------------------------------------- 1 | ARG BASEIMAGE=nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04 2 | FROM ${BASEIMAGE} 3 | 4 | ENV DEBIAN_FRONTEND noninteractive 5 | -------------------------------------------------------------------------------- /docker/cronjobs/Dockerfile.torch.bench.aarch64: -------------------------------------------------------------------------------- 1 | ARG BASEIMAGE=bladedisc/bladedisc:latest-runtime-torch1.12.0-cu113 2 | FROM ${BASEIMAGE} 3 | 4 | RUN apt-get install -y git git-lfs libglib2.0-0 libsndfile1 libgl1 && \ 5 | rm -rf /var/lib/apt/lists/* 6 | 7 | RUN python3 -m pip install virtualenv 8 | -------------------------------------------------------------------------------- /docker/runtime/Dockerfile.pytorch.aarch64: -------------------------------------------------------------------------------- 1 | ARG BASEIMAGE=bladedisc:latest-devel-cpu-aarch64 2 | FROM ${BASEIMAGE} 3 | 4 | ARG WHEEL_FILE=torch_blade*.whl 5 | 6 | ADD ./build/${WHEEL_FILE} /install/python/ 7 | 8 | RUN . /opt/venv_disc/bin/activate && \ 9 | pip install /install/python/${WHEEL_FILE} 10 | -------------------------------------------------------------------------------- /docker/runtime/Dockerfile.tf: -------------------------------------------------------------------------------- 1 | ARG BASEIMAGE=nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04 2 | FROM ${BASEIMAGE} 3 | 4 | ARG WHEEL_FILE=blade_disc*.whl 5 | 6 | ADD ./docker/scripts /install/scripts 7 | RUN bash /install/scripts/find-fastest-apt.sh 8 | 9 | ADD ./build/${WHEEL_FILE} /install/python/ 10 | ADD ./build/disc-replay-main /usr/bin/disc-replay-main 11 | 12 | RUN apt-get install -y python3 python3-pip \ 13 | && pip3 install --upgrade pip \ 14 | && ln -s /usr/bin/python3.8 /usr/bin/python \ 15 | && pip install /install/python/${WHEEL_FILE} 16 | -------------------------------------------------------------------------------- /docker/runtime/Dockerfile.tf.aarch64: -------------------------------------------------------------------------------- 1 | ARG BASEIMAGE=bladedisc:latest-devel-cpu-aarch64 2 | FROM ${BASEIMAGE} 3 | 4 | ARG WHEEL_FILE=blade_disc*.whl 5 | 6 | ADD ./build/${WHEEL_FILE} /install/python/ 7 | ADD ./build/disc-replay-main /usr/bin/disc-replay-main 8 | 9 | RUN . /opt/venv_disc/bin/activate && \ 10 | pip install /install/python/${WHEEL_FILE} 11 | -------------------------------------------------------------------------------- /docker/runtime/Dockerfile.tf_blade: -------------------------------------------------------------------------------- 1 | ARG BASEIMAGE=nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04 2 | FROM ${BASEIMAGE} 3 | 4 | ADD ./docker/scripts /install/scripts 5 | RUN bash /install/scripts/find-fastest-apt.sh 6 | 7 | ARG DISC_WHEEL=blade_disc*.whl 8 | ARG TF_BLADE_WHEEL=tensorflow_blade*.whl 9 | 10 | ADD ./build/${DISC_WHEEL} /install/python/ 11 | ADD ./build/${TF_BLADE_WHEEL} /install/python/ 12 | 13 | RUN apt-get install -y python3 python3-pip \ 14 | && pip3 install --upgrade pip \ 15 | && ln -s /usr/bin/python3.8 /usr/bin/python \ 16 | && pip install /install/python/${DISC_WHEEL} \ 17 | && pip install /install/python/${TF_BLADE_WHEEL} 18 | -------------------------------------------------------------------------------- /docs/design/images/ltc_disc_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/design/images/ltc_disc_overview.png -------------------------------------------------------------------------------- /docs/design/images/shape-constraint-pass-workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/design/images/shape-constraint-pass-workflow.png -------------------------------------------------------------------------------- /docs/design/images/split_op_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/design/images/split_op_example.png -------------------------------------------------------------------------------- /docs/design/images/symbolic_shape_analysis_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/design/images/symbolic_shape_analysis_example.png -------------------------------------------------------------------------------- /docs/developers/pics/RAL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/developers/pics/RAL.png -------------------------------------------------------------------------------- /docs/developers/pics/Torch-MLIR-MHLO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/developers/pics/Torch-MLIR-MHLO.png -------------------------------------------------------------------------------- /docs/developers/pics/bladedisc_torch_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/developers/pics/bladedisc_torch_arch.png -------------------------------------------------------------------------------- /docs/developers/pics/bladedisc_torch_overview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/developers/pics/bladedisc_torch_overview.jpg -------------------------------------------------------------------------------- /docs/developers/pics/fusion_codegen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/developers/pics/fusion_codegen.png -------------------------------------------------------------------------------- /docs/developers/pics/pass_pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/developers/pics/pass_pipeline.png -------------------------------------------------------------------------------- /docs/html_docs/build/html/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/html_docs/build/html/.nojekyll -------------------------------------------------------------------------------- /docs/html_docs/requirements.txt: -------------------------------------------------------------------------------- 1 | jupyter 2 | sphinx 3 | sphinx-autobuild 4 | sphinx_copybutton 5 | sphinx-markdown-tables 6 | sphinx_rtd_theme 7 | recommonmark 8 | karma_sphinx_theme 9 | nbsphinx 10 | flake8-rst-docstrings 11 | -------------------------------------------------------------------------------- /docs/papers/asplos-22-zhenzheng.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/papers/asplos-22-zhenzheng.pdf -------------------------------------------------------------------------------- /docs/pics/dingtalk_support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/pics/dingtalk_support.png -------------------------------------------------------------------------------- /docs/pics/numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/pics/numbers.png -------------------------------------------------------------------------------- /docs/pics/v0.3.0_torch_benchmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/pics/v0.3.0_torch_benchmark.png -------------------------------------------------------------------------------- /docs/pics/v0.3.0_torch_mlir_commits.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/docs/pics/v0.3.0_torch_mlir_commits.jpeg -------------------------------------------------------------------------------- /docs/tutorials/index.rst: -------------------------------------------------------------------------------- 1 | .. cbh_test documentation master file, created by 2 | sphinx-quickstart on Mon Mar 15 19:12:40 2021. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Tutorials on Example Use Cases 7 | ==================================== 8 | 9 | .. toctree:: 10 | :maxdepth: 1 11 | 12 | Use case of TensorFlow Inference and Training 13 | Use case of PyTorch Inference 14 | -------------------------------------------------------------------------------- /examples/PyTorch/Inference/CPU/albert/requirements.txt: -------------------------------------------------------------------------------- 1 | transformers 2 | tabulate 3 | pandas 4 | onnxruntime 5 | -------------------------------------------------------------------------------- /examples/PyTorch/Inference/CUDA/AlphaFold/pics/foldacc_speed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/examples/PyTorch/Inference/CUDA/AlphaFold/pics/foldacc_speed.png -------------------------------------------------------------------------------- /examples/PyTorch/Inference/CUDA/AlphaFold/pics/unifold_foldacc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/examples/PyTorch/Inference/CUDA/AlphaFold/pics/unifold_foldacc.png -------------------------------------------------------------------------------- /examples/PyTorch/Inference/CUDA/BERT/requirements.txt: -------------------------------------------------------------------------------- 1 | transformers 2 | -------------------------------------------------------------------------------- /examples/PyTorch/Inference/CUDA/ResNet/requirements.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | argparse 3 | pandas 4 | tabulate 5 | -------------------------------------------------------------------------------- /examples/PyTorch/Inference/CUDA/S2T/requirements.txt: -------------------------------------------------------------------------------- 1 | transformers 2 | -------------------------------------------------------------------------------- /examples/PyTorch/Inference/CUDA/T5/requirements.txt: -------------------------------------------------------------------------------- 1 | transformers 2 | sentencepiece 3 | -------------------------------------------------------------------------------- /examples/PyTorch/Train/Dynamo/Bert/requirements.txt: -------------------------------------------------------------------------------- 1 | transformers==4.24.0 2 | pandas==1.5.1 3 | tabulate==0.9.0 4 | datasets==2.6.1 -------------------------------------------------------------------------------- /examples/PyTorch/Train/Dynamo/StableDiffusion/docs/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/examples/PyTorch/Train/Dynamo/StableDiffusion/docs/image.png -------------------------------------------------------------------------------- /examples/PyTorch/Train/Lazy/Bert/requirements.txt: -------------------------------------------------------------------------------- 1 | transformers 2 | pandas==1.5.1 3 | tabulate==0.9.0 4 | datasets==2.6.1 5 | -------------------------------------------------------------------------------- /pytorch_blade/.bazelversion: -------------------------------------------------------------------------------- 1 | 6.1.0 2 | -------------------------------------------------------------------------------- /pytorch_blade/.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | select = B,C,E,F,P,T4,W,B9 3 | max-line-length = 80 4 | # C408 ignored because we like the dict keyword argument syntax 5 | # E501 is not flexible enough, we're using B950 instead 6 | ignore = 7 | E203,E305,E402,E501,E721,E741,F403,F405,F821,F841,F999,W503,W504,C408,E302,W291,E303 8 | per-file-ignores = __init__.py: F401 9 | exclude = docs,third_party 10 | -------------------------------------------------------------------------------- /pytorch_blade/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | dist/ 3 | _build/ 4 | _generate/ 5 | *.so 6 | *.py[cod] 7 | *.egg-info 8 | /.vscode/ 9 | /*/__pycache__/ 10 | *.proto3.pb.* 11 | *.gz 12 | compile_commands.json 13 | *.pt 14 | core.* 15 | ci_build/venv/ 16 | .coverage 17 | .cache/ 18 | pytorch_blade/version.py 19 | cpp_test.sh 20 | *.tar 21 | pytorch_blade/lib* 22 | *.whl 23 | /aicompiler_venv/ 24 | /aicompiler_venv_cpu/ 25 | torch_blade/disc_compiler_main 26 | bazel-bin 27 | bazel-out 28 | bazel-pytorch_blade 29 | bazel-testlogs 30 | .bazel_pyenv 31 | debug_bazel.sh 32 | py_test.out 33 | cpp_test.out 34 | torch_blade/*.so.* 35 | disc_compiler_main 36 | -------------------------------------------------------------------------------- /pytorch_blade/.mdl_style.rb: -------------------------------------------------------------------------------- 1 | all 2 | # our changelog does this, by design 3 | exclude_rule 'MD024' 4 | # default in next version, remove then 5 | rule 'MD007', :indent => 3 6 | 7 | rule 'MD013', :ignore_code_blocks => true, :tables => false, :code_blocks => false 8 | -------------------------------------------------------------------------------- /pytorch_blade/.mdlrc: -------------------------------------------------------------------------------- 1 | style '.mdl_style.rb' 2 | -------------------------------------------------------------------------------- /pytorch_blade/bazel/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/pytorch_blade/bazel/BUILD -------------------------------------------------------------------------------- /pytorch_blade/bazel/platform_alibaba/workspace.bzl: -------------------------------------------------------------------------------- 1 | 2 | def alibaba_workspace(): 3 | pass 4 | -------------------------------------------------------------------------------- /pytorch_blade/bazel/tests/BUILD: -------------------------------------------------------------------------------- 1 | 2 | exports_files(["lit.cfg.py"]) 3 | -------------------------------------------------------------------------------- /pytorch_blade/bazel/torch/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/pytorch_blade/bazel/torch/BUILD -------------------------------------------------------------------------------- /pytorch_blade/bazel/torch_mlir/absl-build-path.patch: -------------------------------------------------------------------------------- 1 | diff --git a/BUILD b/BUILD 2 | index e4df40b5a..b478156ce 100644 3 | --- a/BUILD 4 | +++ b/BUILD 5 | @@ -1131,7 +1131,8 @@ cc_library( 6 | ":mlir_hlo", 7 | "//stablehlo:stablehlo_ops", 8 | "//stablehlo:stablehlo_ops_inc_gen", 9 | - "//third_party/absl/strings", 10 | + "@com_google_absl//absl/strings", 11 | + #"//third_party/absl/strings", 12 | "@llvm-project//llvm:Support", 13 | "@llvm-project//mlir:IR", 14 | "@llvm-project//mlir:Support", 15 | -------------------------------------------------------------------------------- /pytorch_blade/bazel/torch_mlir/disable-simplify-dynamic-gather-to-gather.patch: -------------------------------------------------------------------------------- 1 | diff --git a/mhlo/IR/hlo_ops.cc b/mhlo/IR/hlo_ops.cc 2 | index feb575f0..923b53e1 100644 3 | --- a/mhlo/IR/hlo_ops.cc 4 | +++ b/mhlo/IR/hlo_ops.cc 5 | @@ -1784,7 +1784,7 @@ LogicalResult simplifyDynamicGatherToGather(DynamicGatherOp op, 6 | 7 | void DynamicGatherOp::getCanonicalizationPatterns(RewritePatternSet& result, 8 | MLIRContext* context) { 9 | - result.add(simplifyDynamicGatherToGather); 10 | + // result.add(simplifyDynamicGatherToGather); 11 | } 12 | 13 | LogicalResult DynamicGatherOp::reifyReturnTypeShapes( 14 | -------------------------------------------------------------------------------- /pytorch_blade/benchmark/TorchBench/cpu-utils/requirements_aarch64_131.txt: -------------------------------------------------------------------------------- 1 | -f https://download.pytorch.org/whl/torch_stable.html 2 | pyyaml 3 | pandas 4 | librosa 5 | torchvision==0.14.1 6 | torchaudio==0.13.1 7 | torchtext==0.14.1 8 | onnx 9 | onnxruntime 10 | torchdynamo==1.13.0 11 | -------------------------------------------------------------------------------- /pytorch_blade/benchmark/TorchBench/cpu-utils/requirements_aarch64_200.txt: -------------------------------------------------------------------------------- 1 | -f https://download.pytorch.org/whl/torch_stable.html 2 | pyyaml 3 | pandas 4 | librosa 5 | torchvision==0.15.0 6 | torchaudio==2.0.1 7 | torchtext==0.15.0 8 | onnx 9 | onnxruntime 10 | psutil 11 | protobuf==3.20.2 12 | -------------------------------------------------------------------------------- /pytorch_blade/benchmark/TorchBench/cpu-utils/requirements_cpu_131.txt: -------------------------------------------------------------------------------- 1 | -f https://download.pytorch.org/whl/torch_stable.html 2 | pyyaml 3 | pandas 4 | librosa 5 | torchvision==0.14.1+cpu 6 | torchaudio==0.13.1+cpu 7 | torchtext==0.14.1 8 | onnx 9 | onnxruntime 10 | torchdynamo==1.13.0 11 | intel_extension_for_pytorch==1.13.0 12 | -------------------------------------------------------------------------------- /pytorch_blade/benchmark/TorchBench/cpu-utils/requirements_cpu_200.txt: -------------------------------------------------------------------------------- 1 | --pre --extra-index-url https://download.pytorch.org/whl/nightly/cpu 2 | pandas 3 | librosa 4 | torchaudio==2.0.0.dev20230219+cpu 5 | torchtext==0.15.1 6 | onnx 7 | onnxruntime 8 | pyyaml 9 | intel_extension_for_pytorch==2.0.0 10 | -------------------------------------------------------------------------------- /pytorch_blade/benchmark/TorchBench/cpu-utils/requirements_cpu_pre.txt: -------------------------------------------------------------------------------- 1 | --pre --extra-index-url https://download.pytorch.org/whl/nightly/cpu 2 | pandas 3 | librosa 4 | torchaudio==2.0.0.dev20230315+cpu 5 | # may depend on the same day or the previous day 6 | # better verify this dependency locally 7 | torchtext==0.15.0.dev20230316 8 | onnx 9 | onnxruntime 10 | pyyaml 11 | -------------------------------------------------------------------------------- /pytorch_blade/benchmark/TorchBench/cpu-utils/tiny_models.txt: -------------------------------------------------------------------------------- 1 | hf_Bert 2 | -------------------------------------------------------------------------------- /pytorch_blade/benchmark/TorchBench/requirements_cuda.txt: -------------------------------------------------------------------------------- 1 | --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu118 --extra-index-url https://download.pytorch.org/whl/nightly/cpu 2 | pandas 3 | librosa 4 | torchaudio==2.1.0.dev20230720+cu118 5 | # may depend on the same day or the previous day 6 | # better verify this dependency locally 7 | torchtext==0.16.0.dev20230720 8 | pyyaml 9 | -------------------------------------------------------------------------------- /pytorch_blade/benchmark/requirements.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | argparse 3 | pandas 4 | -------------------------------------------------------------------------------- /pytorch_blade/benchmark/torch-tensorrt/config/crnn.yml: -------------------------------------------------------------------------------- 1 | --- 2 | backend: 3 | - all 4 | input: 5 | input0: 6 | - 1 7 | - 1 8 | - 64 9 | - 320 10 | num_inputs: 1 11 | model: 12 | filename: models/crnn.jit.pt 13 | name: crnn 14 | runtime: 15 | device: 0 16 | precision: 17 | - fp32 18 | - fp16 19 | -------------------------------------------------------------------------------- /pytorch_blade/benchmark/torch-tensorrt/config/vgg16.yml: -------------------------------------------------------------------------------- 1 | --- 2 | backend: 3 | - all 4 | input: 5 | input0: 6 | - 1 7 | - 3 8 | - 224 9 | - 224 10 | num_inputs: 1 11 | model: 12 | filename: models/vgg16_traced.jit.pt 13 | name: vgg16 14 | runtime: 15 | device: 0 16 | precision: 17 | - fp32 18 | - fp16 19 | -------------------------------------------------------------------------------- /pytorch_blade/benchmark/torch-tensorrt/config/yolov5.yml: -------------------------------------------------------------------------------- 1 | --- 2 | backend: 3 | - all 4 | input: 5 | input0: 6 | - 1 7 | - 3 8 | - 640 9 | - 640 10 | num_inputs: 1 11 | model: 12 | filename: models/yolov5s.jit.pt 13 | name: yolov5s 14 | runtime: 15 | device: 0 16 | precision: 17 | - fp32 18 | - fp16 19 | -------------------------------------------------------------------------------- /pytorch_blade/benchmark/torch-tensorrt/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/pytorch_blade/benchmark/torch-tensorrt/models/.gitkeep -------------------------------------------------------------------------------- /pytorch_blade/common_setup.py: -------------------------------------------------------------------------------- 1 | ../scripts/python/common_setup.py -------------------------------------------------------------------------------- /pytorch_blade/distribution.cfg: -------------------------------------------------------------------------------- 1 | pytorch_blade/_torch_blade.so 2 | pytorch_blade/libtorch_blade.so 3 | external/org_disc_compiler/mlir/ral/libral_base_context.so 4 | external/org_disc_compiler/mlir/custom_ops/libdisc_custom_ops.so 5 | external/org_disc_compiler/mlir/disc/disc_compiler_main 6 | -------------------------------------------------------------------------------- /pytorch_blade/pytorch_blade/compiler/backends/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_library( 4 | name = "torch_blade_backends", 5 | srcs = [ 6 | "engine_class.cpp", 7 | "engine_interface.cpp", 8 | "backend_input_outputs.cpp", 9 | ], 10 | hdrs = [ 11 | "engine_class.h", 12 | "engine_interface.h", 13 | "backend_input_outputs.h", 14 | ], 15 | deps = [ 16 | "//pytorch_blade/common_utils:torch_blade_common", 17 | "//pytorch_blade/compiler/jit:torch_blade_jit", 18 | ], 19 | alwayslink = 1, 20 | ) 21 | 22 | -------------------------------------------------------------------------------- /pytorch_blade/pytorch_blade/compiler/jit/torch/README.md: -------------------------------------------------------------------------------- 1 | 2 | The source files located in this directory were borrowed from . 3 | We have done some miny modifications to these files so that they meet our needs. 4 | -------------------------------------------------------------------------------- /pytorch_blade/pytorch_blade/disc_ops/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_library( 4 | name = "attention_op", 5 | srcs = [ 6 | "attention_op.cpp", 7 | ], 8 | deps = [ 9 | "@local_org_torch//:libtorch", 10 | "//pytorch_blade/common_utils:torch_blade_common" 11 | ], 12 | alwayslink = True, 13 | ) 14 | -------------------------------------------------------------------------------- /pytorch_blade/pytorch_blade/ltc/include/README.md: -------------------------------------------------------------------------------- 1 | 2 | The header files located in this directory were borrowed from . 3 | 4 | -------------------------------------------------------------------------------- /pytorch_blade/pytorch_blade/torch_blade.lds: -------------------------------------------------------------------------------- 1 | VERS_1.0 { 2 | global: 3 | *blade*; 4 | local: 5 | *; 6 | }; 7 | -------------------------------------------------------------------------------- /pytorch_blade/release_version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | 12 | __version__ = '0.2.0' 13 | -------------------------------------------------------------------------------- /pytorch_blade/scripts/pip/requirements-dev-1.13.1+aarch64.txt: -------------------------------------------------------------------------------- 1 | pytest==5.0.0 2 | networkx 3 | onnx>=1.6.0 4 | torch==1.13.1 5 | torchvision==0.14.1 6 | py-cpuinfo 7 | torchaudio==0.13.1 8 | expecttest 9 | decorator -------------------------------------------------------------------------------- /pytorch_blade/scripts/pip/requirements-dev-1.13.1+cpu.txt: -------------------------------------------------------------------------------- 1 | pyyaml 2 | typing_extensions 3 | numpy 4 | pytest 5 | networkx 6 | py-cpuinfo 7 | protobuf==3.20.1 8 | onnx==1.12.0 9 | expecttest 10 | decorator 11 | torch==1.13.1+cpu 12 | torchvision==0.14.1+cpu 13 | -------------------------------------------------------------------------------- /pytorch_blade/scripts/pip/requirements-dev-1.13.1+cu116.txt: -------------------------------------------------------------------------------- 1 | pyyaml 2 | typing_extensions 3 | numpy 4 | pytest 5 | networkx 6 | py-cpuinfo 7 | protobuf==3.20.1 8 | onnx==1.12.0 9 | expecttest 10 | decorator 11 | torch==1.13.1+cu116 12 | torchvision==0.14.1+cu116 13 | -------------------------------------------------------------------------------- /pytorch_blade/scripts/pip/requirements-dev-2.0.0+aarch64.txt: -------------------------------------------------------------------------------- 1 | wget 2 | pytest==5.0.0 3 | networkx 4 | onnx==1.12.0 5 | hypothesis 6 | expecttest 7 | py-cpuinfo 8 | aliyun-log-python-sdk==0.6.48.6 9 | cryptography 10 | decorator 11 | torch==2.0.0 12 | torchvision==0.15.0 13 | -------------------------------------------------------------------------------- /pytorch_blade/scripts/pip/requirements-dev-2.0.0+cpu.txt: -------------------------------------------------------------------------------- 1 | wget 2 | pytest==5.0.0 3 | networkx 4 | onnx==1.12.0 5 | hypothesis 6 | expecttest 7 | py-cpuinfo 8 | aliyun-log-python-sdk==0.6.48.6 9 | cryptography 10 | decorator 11 | torch==2.0.0+cpu 12 | torchvision==0.15.0+cpu 13 | -------------------------------------------------------------------------------- /pytorch_blade/scripts/pip/requirements-dev-2.0.1+cu118.txt: -------------------------------------------------------------------------------- 1 | wget 2 | pytest==5.0.0 3 | networkx 4 | onnx==1.12.0 5 | hypothesis 6 | expecttest 7 | py-cpuinfo 8 | aliyun-log-python-sdk==0.6.48.6 9 | cryptography 10 | decorator 11 | torch==2.0.1+cu118 12 | torchvision==0.15.2+cu118 13 | -------------------------------------------------------------------------------- /pytorch_blade/scripts/pip/requirements-dev-ngc.txt: -------------------------------------------------------------------------------- 1 | pytest==5.0.0 2 | networkx 3 | onnx>=1.6.0 4 | -------------------------------------------------------------------------------- /pytorch_blade/tensorflow/tools/toolchains/java: -------------------------------------------------------------------------------- 1 | ../../../../tf_community/tensorflow/tools/toolchains/java/ -------------------------------------------------------------------------------- /pytorch_blade/tests/disc/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. -------------------------------------------------------------------------------- /pytorch_blade/tests/disc/ops/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /pytorch_blade/tests/disc/pdl/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /pytorch_blade/tests/disc/pdl/test_e2e/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /pytorch_blade/tests/disc/pdl/test_torchscipt_to_mhlo/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /pytorch_blade/tests/disc_mlir/disc_cse.mlir: -------------------------------------------------------------------------------- 1 | ../../../tao_compiler/mlir/disc/transforms/tests/disc_cse.mlir -------------------------------------------------------------------------------- /pytorch_blade/tests/ltc/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | 12 | -------------------------------------------------------------------------------- /pytorch_blade/tests/mhlo/ops.mlir: -------------------------------------------------------------------------------- 1 | // RUN: torch-mlir-opt <%s --torch-backend-to-mhlo-backend-pipeline -split-input-file -verify-diagnostics | FileCheck %s 2 | 3 | // CHECK-LABEL: func.func @torch.tensor_static_info_cast( 4 | // CHECK-SAME: %[[ARG0:.*]]: tensor<2x3x224x224xf32>) -> tensor<2x3x224x224xf32> { 5 | // CHECK: return %[[ARG0]] : tensor<2x3x224x224xf32> 6 | func.func @torch.tensor_static_info_cast(%arg0: !torch.vtensor<[?,?,?,?],f32>) -> !torch.vtensor<[2,3,224,224],f32> { 7 | %0 = torch.tensor_static_info_cast %arg0: !torch.vtensor<[?,?,?,?],f32> to !torch.vtensor<[2,3,224,224],f32> 8 | return %0 : !torch.vtensor<[2,3,224,224],f32> 9 | } 10 | 11 | -------------------------------------------------------------------------------- /pytorch_blade/tests/mhlo/torch-mlir-opt/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:defs.bzl", "cc_binary") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | cc_binary( 6 | name = "torch-mlir-opt", 7 | srcs = [ 8 | "torch-mlir-opt.cpp" 9 | ], 10 | deps = [ 11 | "//pytorch_blade/torch-mlir:DiscTorchMLIRTorchToMhlo", 12 | "@torch-mlir//:TorchMLIRInitAll", 13 | "@torch-mlir//:TorchMLIRTorchDialect", 14 | "@torch-mlir//:TorchMLIRTorchPasses", 15 | "@llvm-project//mlir:AllPassesAndDialects", 16 | "@llvm-project//mlir:MlirOptLib" 17 | ] 18 | ) 19 | -------------------------------------------------------------------------------- /pytorch_blade/tests/neural_engine/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /pytorch_blade/tests/torchscript/since_1_11.graph: -------------------------------------------------------------------------------- 1 | // RUN: shape_analysis_tool --since 1.11.0 -f %s | FileCheck %s 2 | 3 | // CHECK-LABEL: graph 4 | graph(%p1 : Float(8, 768, 512), %p2: Float(1, 768, 512)): 5 | %cst0: int = prim::Constant[value=0]() 6 | %cst1: int = prim::Constant[value=1]() 7 | %int_max: int = prim::Constant[value=9223372036854775807]() 8 | // CHECK: Float(8, 768, 512) = aten::slice_scatter 9 | %ret : Tensor = aten::slice_scatter(%p1, %p2, %cst0, %cst0, %int_max, %cst1) 10 | return (%ret) 11 | -------------------------------------------------------------------------------- /pytorch_blade/tests/torchscript/since_1_13.graph: -------------------------------------------------------------------------------- 1 | // RUN: shape_analysis_tool --since 1.13.0 -f %s | FileCheck %s 2 | 3 | // CHECK-LABEL: graph 4 | graph(%p1 : Float(*, *, *), %p2 : Float(*, *, *)): 5 | %cst0: int = prim::Constant[value=0]() 6 | %cst1: int = prim::Constant[value=1]() 7 | // CHECK: Float(*, *, *) = aten::select_scatter 8 | %select_scatter : Tensor = aten::select_scatter(%p1, %p2, %cst1, %cst0) 9 | return (%select_scatter) 10 | -------------------------------------------------------------------------------- /pytorch_blade/torch_blade/clustering/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /pytorch_blade/torch_blade/monkey_patch/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | 12 | -------------------------------------------------------------------------------- /pytorch_blade/torch_blade/onnx_backends/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /pytorch_blade/torch_blade/testing/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /scripts/ci/ossutil: -------------------------------------------------------------------------------- 1 | wget -nv https://gosspublic.alicdn.com/ossutil/1.7.13/ossutil64 -O ossutil && chmod +x ossutil 2 | ./ossutil -e ${OSS_ENDPOINT} -i ${OSS_AK} -k ${OSS_SK} $@ 3 | -------------------------------------------------------------------------------- /scripts/ci/ossutil-arm64: -------------------------------------------------------------------------------- 1 | wget -nv https://gosspublic.alicdn.com/ossutil/1.7.14/ossutilarm64 -O ossutil && chmod +x ossutil 2 | ./ossutil -e ${OSS_ENDPOINT} -i ${OSS_AK} -k ${OSS_SK} $@ 3 | -------------------------------------------------------------------------------- /tao/.bazelignore: -------------------------------------------------------------------------------- 1 | third_party/mkldnn -------------------------------------------------------------------------------- /tao/.bazelversion: -------------------------------------------------------------------------------- 1 | 6.1.0 -------------------------------------------------------------------------------- /tao/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.so 3 | *.pb.* 4 | *.d 5 | *.swp 6 | *.log 7 | build 8 | ci_build/.tao_ci_conf 9 | ci_build/tao_dev.Dockerfile 10 | test_dump_** 11 | tools/tao/tao/VERSION 12 | .eggs 13 | dist 14 | blade_disc_tf.egg-info -------------------------------------------------------------------------------- /tao/CMake/Googletest/CMakeLists.txt.in: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.2) 2 | 3 | project(googletest-download NONE) 4 | 5 | include(ExternalProject) 6 | ExternalProject_Add(googletest 7 | URL "${GTEST_TAR_URL}" 8 | DOWNLOAD_NO_PROGRESS true 9 | SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src" 10 | BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build" 11 | CONFIGURE_COMMAND "" 12 | BUILD_COMMAND "" 13 | INSTALL_COMMAND "" 14 | TEST_COMMAND "" 15 | ) 16 | 17 | -------------------------------------------------------------------------------- /tao/README.md: -------------------------------------------------------------------------------- 1 | # Blade DISC for TensorFlow 2 | 3 | Blade-DISC is a dynamic shape compiler (DISC) for machine learning workload. 4 | To make easier to use Blade-DISC for TensorFlow users, we build this TensorFlow 5 | wrapper Python package. A quick and easy example to enable Blade-DISC is as the following: 6 | 7 | ``` python 8 | import blade_disc_tf 9 | blade_disc_tf.enable() 10 | ``` 11 | -------------------------------------------------------------------------------- /tao/bridge_version_scripts.lds: -------------------------------------------------------------------------------- 1 | RalBaseContext { 2 | global: 3 | *tao*; 4 | local: 5 | *; 6 | }; 7 | -------------------------------------------------------------------------------- /tao/config.mk: -------------------------------------------------------------------------------- 1 | # pls set according to your envrionment setting, e.g.: 2 | # TF_CFLAGS = $(shell python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') 3 | # TF_LFLAGS = $(shell python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') 4 | 5 | TF_CFLAGS := -I/usr/lib/python2.7/site-packages/tensorflow/include -D_GLIBCXX_USE_CXX11_ABI=1 -DTF_1_12 6 | TF_LFLAGS := -L/usr/lib/python2.7/site-packages/tensorflow -ltensorflow_framework 7 | 8 | # Note that it should be the same version with the Tensorflow used. 9 | PROTO := /state/dev/xla/features/control_flow/tensorflow/bazel-out/host/bin/external/protobuf_archive/protoc 10 | -------------------------------------------------------------------------------- /tao/python/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | 12 | -------------------------------------------------------------------------------- /tao/tao_bridge/mlir/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | list(APPEND MLIR_HEADERS 2 | "mlir_executable.h" 3 | ) 4 | 5 | list(APPEND MLIR_SOURCES 6 | "mlir_executable.cc" 7 | ) 8 | 9 | add_library(mlir OBJECT ${MLIR_SOURCES}) 10 | -------------------------------------------------------------------------------- /tao/tao_bridge/ops/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | list(APPEND OPS_SOURCES "tao_ops.cc") 2 | 3 | add_library(ops OBJECT ${OPS_SOURCES}) 4 | -------------------------------------------------------------------------------- /tao/tao_bridge/ral/.gitignore: -------------------------------------------------------------------------------- 1 | tensorflow/ 2 | -------------------------------------------------------------------------------- /tao/tao_bridge/test/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | 12 | -------------------------------------------------------------------------------- /tao/tao_bridge/test/gpu/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | 12 | -------------------------------------------------------------------------------- /tao/tao_bridge/test/gpu/mlir/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | 12 | -------------------------------------------------------------------------------- /tao/tao_bridge/test/pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | junit_family = xunit1 3 | log_cli = True 4 | log_cli_level = ERROR -------------------------------------------------------------------------------- /tao/tao_bridge/version.h.in: -------------------------------------------------------------------------------- 1 | #cmakedefine TAO_BUILD_VERSION "@TAO_BUILD_VERSION@" 2 | #cmakedefine TAO_BUILD_GIT_BRANCH "@TAO_BUILD_GIT_BRANCH@" 3 | #cmakedefine TAO_BUILD_GIT_HEAD "@TAO_BUILD_GIT_HEAD@" 4 | #cmakedefine TAO_BUILD_HOST "@TAO_BUILD_HOST@" 5 | #cmakedefine TAO_BUILD_IP "@TAO_BUILD_IP@" 6 | #cmakedefine TAO_BUILD_TIME "@TAO_BUILD_TIME@" 7 | -------------------------------------------------------------------------------- /tao/third_party/ptxas/10.2/ptxas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/tao/third_party/ptxas/10.2/ptxas -------------------------------------------------------------------------------- /tao/workspace2.bzl: -------------------------------------------------------------------------------- 1 | def _tao_bridge_repositories(): 2 | native.local_repository( 3 | name = "org_tensorflow", 4 | path = "../tf_community/", 5 | ) 6 | native.local_repository( 7 | name = "org_third_party", 8 | path = "../third_party/", 9 | ) 10 | native.local_repository( 11 | name = "org_tao_compiler", 12 | path = "../tao_compiler/", 13 | ) 14 | 15 | def workspace(): 16 | _tao_bridge_repositories() 17 | 18 | # Alias so it can be loaded without assigning to a different symbol to prevent 19 | # shadowing previous loads and trigger a buildifier warning. 20 | tao_bridge_workspace2 = workspace 21 | -------------------------------------------------------------------------------- /tao_compiler/.bazelrc: -------------------------------------------------------------------------------- 1 | startup --host_jvm_args=-Djdk.http.auth.tunneling.disabledSchemes= 2 | 3 | try-import ../tf_community/.bazelrc 4 | try-import ../tf_community/.tf_configure.bazelrc 5 | try-import %workspace%/.bazelrc.user 6 | 7 | build --experimental_ui_max_stdouterr_bytes=-1 -------------------------------------------------------------------------------- /tao_compiler/.bazelversion: -------------------------------------------------------------------------------- 1 | 6.1.0 -------------------------------------------------------------------------------- /tao_compiler/.gitignore: -------------------------------------------------------------------------------- 1 | decoupling/tao_compiler_input.proto 2 | decoupling/tao_compilation_result.proto 3 | decoupling/version.h -------------------------------------------------------------------------------- /tao_compiler/build_tools/bazel/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/tao_compiler/build_tools/bazel/BUILD -------------------------------------------------------------------------------- /tao_compiler/ci_build/platforms/tao/cpu/env.conf: -------------------------------------------------------------------------------- 1 | TF_NEED_CUDA=0 2 | TF_NEED_ROCM=0 3 | TF_NEED_PAI_TRT=0 4 | TF_BUILD_CONTAINER_TYPE=CPU_NOAUDIT 5 | 6 | TF_NEED_OPENCL_SYCL=0 7 | TF_NEED_TRACING=0 8 | TF_SET_ANDROID_WORKSPACE=0 9 | TF_DOWNLOAD_CLANG=0 10 | -------------------------------------------------------------------------------- /tao_compiler/ci_build/platforms/tao/dcu/env.conf: -------------------------------------------------------------------------------- 1 | TF_NEED_CUDA=0 2 | TF_NEED_TENSORRT=0 3 | TF_NEED_ROCM=1 4 | TF_NEED_DCU=1 5 | TF_SET_ANDROID_WORKSPACE=0 6 | -------------------------------------------------------------------------------- /tao_compiler/ci_build/platforms/tao/gpu/env.conf.cuda10: -------------------------------------------------------------------------------- 1 | TF_NEED_CUDA=1 2 | TF_CUDA_CLANG=0 3 | TF_CUDA_VERSION=10 4 | TF_CUBLAS_VERSION=10 5 | TF_CUDNN_VERSION=7 6 | TF_CUDA_COMPUTE_CAPABILITIES="6.0,6.1,7.0,7.5" 7 | TF_NEED_TENSORRT=0 8 | TF_NEED_ROCM=0 9 | TF_SET_ANDROID_WORKSPACE=0 -------------------------------------------------------------------------------- /tao_compiler/ci_build/platforms/tao/gpu/env.conf.cuda10_2: -------------------------------------------------------------------------------- 1 | TF_NEED_CUDA=1 2 | TF_CUDA_CLANG=0 3 | TF_CUDA_VERSION=10.2 4 | TF_CUBLAS_VERSION=10.2 5 | TF_CUDNN_VERSION=8 6 | TF_CUDA_COMPUTE_CAPABILITIES="6.0,6.1,7.0,7.5" 7 | TF_NEED_TENSORRT=0 8 | TF_NEED_ROCM=0 9 | TF_SET_ANDROID_WORKSPACE=0 10 | -------------------------------------------------------------------------------- /tao_compiler/ci_build/platforms/tao/gpu/env.conf.cuda11: -------------------------------------------------------------------------------- 1 | TF_NEED_CUDA=1 2 | TF_CUDA_CLANG=0 3 | TF_CUDA_VERSION=11 4 | TF_CUDNN_VERSION=8 5 | TF_CUDA_COMPUTE_CAPABILITIES="6.0,6.1,7.0,7.5" 6 | TF_NEED_TENSORRT=0 7 | TF_NEED_ROCM=0 8 | TF_SET_ANDROID_WORKSPACE=0 -------------------------------------------------------------------------------- /tao_compiler/ci_build/platforms/tao/gpu/env.conf.cuda11_1: -------------------------------------------------------------------------------- 1 | TF_NEED_CUDA=1 2 | TF_CUDA_CLANG=0 3 | TF_CUDA_VERSION=11.1 4 | TF_CUDNN_VERSION=8 5 | TF_CUDA_COMPUTE_CAPABILITIES="6.0,6.1,7.0,7.5" 6 | TF_NEED_TENSORRT=0 7 | TF_NEED_ROCM=0 8 | TF_SET_ANDROID_WORKSPACE=0 9 | -------------------------------------------------------------------------------- /tao_compiler/ci_build/platforms/tao/gpu/env.conf.cuda11_2: -------------------------------------------------------------------------------- 1 | TF_NEED_CUDA=1 2 | TF_CUDA_CLANG=0 3 | TF_CUDA_VERSION=11.2 4 | TF_CUDNN_VERSION=8 5 | TF_CUDA_COMPUTE_CAPABILITIES="6.0,6.1,7.0,7.5,8.0,8.6" 6 | TF_NEED_TENSORRT=0 7 | TF_NEED_ROCM=0 8 | TF_SET_ANDROID_WORKSPACE=0 9 | -------------------------------------------------------------------------------- /tao_compiler/ci_build/platforms/tao/gpu/env.conf.cuda11_3: -------------------------------------------------------------------------------- 1 | TF_NEED_CUDA=1 2 | TF_CUDA_CLANG=0 3 | TF_CUDA_VERSION=11.3 4 | TF_CUDNN_VERSION=8 5 | TF_CUDA_COMPUTE_CAPABILITIES="6.0,6.1,7.0,7.5,8.0,8.6" 6 | TF_NEED_TENSORRT=0 7 | TF_NEED_ROCM=0 8 | TF_SET_ANDROID_WORKSPACE=0 9 | -------------------------------------------------------------------------------- /tao_compiler/ci_build/platforms/tao/gpu/env.conf.cuda11_4: -------------------------------------------------------------------------------- 1 | TF_NEED_CUDA=1 2 | TF_CUDA_CLANG=0 3 | TF_CUDA_VERSION=11.4 4 | TF_CUDNN_VERSION=8 5 | TF_CUDA_COMPUTE_CAPABILITIES="6.0,6.1,7.0,7.5,8.0,8.6" 6 | TF_NEED_TENSORRT=0 7 | TF_NEED_ROCM=0 8 | TF_SET_ANDROID_WORKSPACE=0 9 | -------------------------------------------------------------------------------- /tao_compiler/ci_build/platforms/tao/gpu/env.conf.cuda11_5: -------------------------------------------------------------------------------- 1 | TF_NEED_CUDA=1 2 | TF_CUDA_CLANG=0 3 | TF_CUDA_VERSION=11.5 4 | TF_CUDNN_VERSION=8 5 | TF_CUDA_COMPUTE_CAPABILITIES="6.0,6.1,7.0,7.5,8.0,8.6" 6 | TF_NEED_TENSORRT=0 7 | TF_NEED_ROCM=0 8 | TF_SET_ANDROID_WORKSPACE=0 9 | -------------------------------------------------------------------------------- /tao_compiler/ci_build/platforms/tao/gpu/env.conf.cuda11_6: -------------------------------------------------------------------------------- 1 | TF_NEED_CUDA=1 2 | TF_CUDA_CLANG=0 3 | TF_CUDA_VERSION=11.6 4 | TF_CUDNN_VERSION=8 5 | TF_CUDA_COMPUTE_CAPABILITIES="6.0,6.1,7.0,7.5,8.0,8.6" 6 | TF_NEED_TENSORRT=0 7 | TF_NEED_ROCM=0 8 | TF_SET_ANDROID_WORKSPACE=0 9 | -------------------------------------------------------------------------------- /tao_compiler/ci_build/platforms/tao/gpu/env.conf.cuda11_8: -------------------------------------------------------------------------------- 1 | TF_NEED_CUDA=1 2 | TF_CUDA_CLANG=0 3 | TF_CUDA_VERSION=11.8 4 | TF_CUDNN_VERSION=8 5 | TF_CUDA_COMPUTE_CAPABILITIES="6.0,6.1,7.0,7.5,8.0,8.6" 6 | TF_NEED_TENSORRT=0 7 | TF_NEED_ROCM=0 8 | TF_SET_ANDROID_WORKSPACE=0 9 | -------------------------------------------------------------------------------- /tao_compiler/ci_build/platforms/tao/rocm/env.conf: -------------------------------------------------------------------------------- 1 | TF_NEED_CUDA=0 2 | TF_NEED_TENSORRT=0 3 | TF_NEED_ROCM=1 4 | TF_NEED_DCU=0 5 | TF_SET_ANDROID_WORKSPACE=0 6 | -------------------------------------------------------------------------------- /tao_compiler/decoupling/README: -------------------------------------------------------------------------------- 1 | bazel build --config=cuda --define framework_shared_object=false //tensorflow/compiler/decoupling:tao_compiler_main 2 | -------------------------------------------------------------------------------- /tao_compiler/decoupling/fake_quant_op.cc: -------------------------------------------------------------------------------- 1 | ../../tao/tao_bridge/ops/fake_quant_op.cc -------------------------------------------------------------------------------- /tao_compiler/decoupling/tests_data/mlir_gpu.proto: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/tao_compiler/decoupling/tests_data/mlir_gpu.proto -------------------------------------------------------------------------------- /tao_compiler/file_map: -------------------------------------------------------------------------------- 1 | # relative path under tao_compiler, relative path under tf_community 2 | decoupling,tensorflow/compiler/decoupling 3 | mlir/disc,tensorflow/compiler/mlir/disc 4 | mlir/util,mlir/util 5 | mlir/ral,tensorflow/compiler/mlir/ral 6 | .bazelrc.user,tensorflow/../.bazelrc.user 7 | -------------------------------------------------------------------------------- /tao_compiler/mlir/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/tao_compiler/mlir/BUILD -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/IR/tests/BUILD: -------------------------------------------------------------------------------- 1 | load("@org_tensorflow//tensorflow:tensorflow.bzl", "filegroup") 2 | load("//mlir/disc:glob_lit_test.bzl", "glob_lit_tests") 3 | 4 | package(licenses = ["notice"]) 5 | 6 | glob_lit_tests( 7 | data = [":test_utilities"], 8 | driver = "@llvm-project//mlir:run_lit.sh", 9 | test_file_exts = ["mlir"], 10 | ) 11 | 12 | # Bundle together all of the test utilities that are used by tests. 13 | filegroup( 14 | name = "test_utilities", 15 | testonly = True, 16 | data = [ 17 | "//mlir/disc:disc-opt", 18 | "@llvm-project//llvm:FileCheck", 19 | ], 20 | ) -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/mhlo_disc_builder.lds: -------------------------------------------------------------------------------- 1 | VERS_1.0 { 2 | global: 3 | # Expose all symbols in mlir namespace and several in llvm namespace. 4 | # Exposing too many of llvm namespace 5 | extern "C++" { 6 | *mlir::*; 7 | *llvm::SmallVectorBase*; 8 | *llvm::detail::IEEEFloat*; 9 | *llvm::APFloatBase*; 10 | *llvm::detail::DoubleAPFloat*; 11 | *llvm::DisableABIBreakingChecks*; 12 | *llvm::raw_ostream*; 13 | *llvm::raw_string_ostream*; 14 | *llvm::report_fatal_error*; 15 | *llvm::APInt*; 16 | *llvm::deallocate_buffer*; 17 | }; 18 | 19 | local: 20 | *; 21 | }; 22 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/disc-transform/BUILD: -------------------------------------------------------------------------------- 1 | load("//mlir/disc/tests:glob_op_test.bzl", "glob_op_tests") 2 | 3 | glob_op_tests( 4 | data = [], 5 | driver = "@llvm-project//mlir:run_lit.sh", 6 | test_file_exts = ["cc"], 7 | ) 8 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/pdll/BUILD: -------------------------------------------------------------------------------- 1 | load("//mlir/disc/tests:glob_op_test.bzl", "glob_op_tests") 2 | 3 | glob_op_tests( 4 | data = [], 5 | driver = "@llvm-project//mlir:run_lit.sh", 6 | test_file_exts = ["cc"], 7 | ) 8 | 9 | 10 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/empty_tensor.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "input0,input1", outputs = "output0"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Add"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/int_arithmetic_add_d_i32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Add"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/int_arithmetic_add_d_i8.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Add"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/int_arithmetic_add_d_ui8.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Add"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/int_arithmetic_convert_d_ui8.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Cast"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/int_arithmetic_div_d_i8.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Div"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/int_arithmetic_div_d_ui8.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Div"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/int_arithmetic_mul_d_i8.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Mul"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/int_arithmetic_mul_d_ui8.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Mul"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/int_arithmetic_sub_d_i8.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sub"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/int_arithmetic_sub_d_ui8.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sub"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/multi_cc.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Softmax"(%arg0) : (tensor) -> tensor 4 | tf_executor.fetch %1 : tensor 5 | } 6 | return %graph : tensor 7 | } 8 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/multi_threading_cpu_2d.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Tanh"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/multi_threading_cpu_3d.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Tanh"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/multi_threading_cpu_4d.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Tanh"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/uint_cast.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "input0", outputs = "output0"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Cast"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/regression/data/use_expect_output.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "input0", outputs = "output0"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Cast"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/abs_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Abs"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/abs_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Abs"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/abs_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Abs"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/add_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Add"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/add_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Add"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/add_v2_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.AddV2"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/add_v2_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.AddV2"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/cast_d_f32tof16.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Cast"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/cast_p_f32tof16.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Cast"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/cast_s_f16tof32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf16>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Cast"(%arg0) : (tensor<100x100xf16>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/cast_s_f32tof16.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf16>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Cast"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf16>) 5 | tf_executor.fetch %0 : tensor<100x100xf16> 6 | } 7 | return %graph : tensor<100x100xf16> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/cast_s_f32toi32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xi32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Cast"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xi32>) 5 | tf_executor.fetch %0 : tensor<100x100xi32> 6 | } 7 | return %graph : tensor<100x100xi32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/cast_s_i32toi1.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xi32>) -> (tensor<100x100xi1>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Cast"(%arg0) : (tensor<100x100xi32>) -> (tensor<100x100xi1>) 5 | tf_executor.fetch %0 : tensor<100x100xi1> 6 | } 7 | return %graph : tensor<100x100xi1> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/ceil_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Ceil"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/ceil_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Ceil"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/ceil_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Ceil"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/const_2d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main() -> (tensor<101x99xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Const"() {device = "", value = dense<-1.000000e+00> : tensor<101x99xf32>} : () -> (tensor<101x99xf32>) 5 | tf_executor.fetch %0 : tensor<101x99xf32> 6 | } 7 | return %graph : tensor<101x99xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/const_2d_i32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main() -> (tensor<33x11xi32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Const"() {device = "", value = dense<2> : tensor<33x11xi32>} : () -> (tensor<33x11xi32>) 5 | tf_executor.fetch %0 : tensor<33x11xi32> 6 | } 7 | return %graph : tensor<33x11xi32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/const_scalar_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main() -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Const"() {device = "", value = dense<1.000000e+00> : tensor} : () -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/const_scalar_i32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main() -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Const"() {device = "", value = dense<-1> : tensor} : () -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/const_scalar_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i64, producer = 0 : i64}} { 2 | func.func @main() -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}}{ 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Const"() {device = "", value = dense<-1> : tensor} : () -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/cos_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Cos"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/cos_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x?xf32>) -> (tensor<100x?xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Cos"(%arg0) : (tensor<100x?xf32>) -> (tensor<100x?xf32>) 5 | tf_executor.fetch %0 : tensor<100x?xf32> 6 | } 7 | return %graph : tensor<100x?xf32> 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/cos_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x10xf32>) -> (tensor<100x10xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Cos"(%arg0) : (tensor<100x10xf32>) -> (tensor<100x10xf32>) 5 | tf_executor.fetch %0 : tensor<100x10xf32> 6 | } 7 | return %graph : tensor<100x10xf32> 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/equal_d_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Equal"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/equal_p_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<13x?xi64>, %arg1: tensor<13x?xi64>) -> (tensor<13x?xi1>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Equal"(%arg0, %arg1) : (tensor<13x?xi64>, tensor<13x?xi64>) -> (tensor<13x?xi1>) 5 | tf_executor.fetch %0 : tensor<13x?xi1> 6 | } 7 | return %graph : tensor<13x?xi1> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/equal_s_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<111x1xi64>, %arg1: tensor<111x1xi64>) -> (tensor<111x1xi1>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Equal"(%arg0, %arg1) : (tensor<111x1xi64>, tensor<111x1xi64>) -> (tensor<111x1xi1>) 5 | tf_executor.fetch %0 : tensor<111x1xi1> 6 | } 7 | return %graph : tensor<111x1xi1> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/erf_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Erf"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/erf_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x?xf32>) -> (tensor<100x?xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Erf"(%arg0) : (tensor<100x?xf32>) -> (tensor<100x?xf32>) 5 | tf_executor.fetch %0 : tensor<100x?xf32> 6 | } 7 | return %graph : tensor<100x?xf32> 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/erf_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Erf"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/erfc_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Erfc"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/erfc_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x?xf32>) -> (tensor<100x?xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Erfc"(%arg0) : (tensor<100x?xf32>) -> (tensor<100x?xf32>) 5 | tf_executor.fetch %0 : tensor<100x?xf32> 6 | } 7 | return %graph : tensor<100x?xf32> 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/erfc_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Erfc"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/exp_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Exp"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/exp_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Exp"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/exp_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x110xf32>) -> (tensor<100x110xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Exp"(%arg0) : (tensor<100x110xf32>) -> (tensor<100x110xf32>) 5 | tf_executor.fetch %0 : tensor<100x110xf32> 6 | } 7 | return %graph : tensor<100x110xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/fill_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<2xi32>, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Fill"(%arg0, %arg1) : (tensor<2xi32>, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/fill_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<2xi32>, %arg1: tensor) -> (tensor<10x?xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Fill"(%arg0, %arg1) : (tensor<2xi32>, tensor) -> (tensor<10x?xf32>) 5 | tf_executor.fetch %0 : tensor<10x?xf32> 6 | } 7 | return %graph : tensor<10x?xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/floor_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Floor"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/floor_div_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.FloorDiv"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/floor_mod_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.FloorMod"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/floor_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Floor"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/floor_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Floor"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/greater_d_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Greater"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/greater_equal_d_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.GreaterEqual"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/greater_p_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<13x?xi64>, %arg1: tensor<13x?xi64>) -> (tensor<13x?xi1>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Greater"(%arg0, %arg1) : (tensor<13x?xi64>, tensor<13x?xi64>) -> (tensor<13x?xi1>) 5 | tf_executor.fetch %0 : tensor<13x?xi1> 6 | } 7 | return %graph : tensor<13x?xi1> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/identity_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Identity"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/identity_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Identity"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/identity_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Identity"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/isfinite_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.IsFinite"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/isfinite_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.IsFinite"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/isfinite_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xi1>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.IsFinite"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xi1>) 5 | tf_executor.fetch %0 : tensor<100x100xi1> 6 | } 7 | return %graph : tensor<100x100xi1> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/less_d_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Less"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/less_equal_d_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.LessEqual"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/less_equal_p_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<13x?xi64>, %arg1: tensor<13x?xi64>) -> (tensor<13x?xi1>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.LessEqual"(%arg0, %arg1) : (tensor<13x?xi64>, tensor<13x?xi64>) -> (tensor<13x?xi1>) 5 | tf_executor.fetch %0 : tensor<13x?xi1> 6 | } 7 | return %graph : tensor<13x?xi1> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/less_p_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<13x?xi64>, %arg1: tensor<13x?xi64>) -> (tensor<13x?xi1>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Less"(%arg0, %arg1) : (tensor<13x?xi64>, tensor<13x?xi64>) -> (tensor<13x?xi1>) 5 | tf_executor.fetch %0 : tensor<13x?xi1> 6 | } 7 | return %graph : tensor<13x?xi1> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/less_s_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<111x1xi64>, %arg1: tensor<111x1xi64>) -> (tensor<111x1xi1>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Less"(%arg0, %arg1) : (tensor<111x1xi64>, tensor<111x1xi64>) -> (tensor<111x1xi1>) 5 | tf_executor.fetch %0 : tensor<111x1xi1> 6 | } 7 | return %graph : tensor<111x1xi1> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/log_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Log"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/log_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Log"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/log_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Log"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/logical_and_d_i1.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.LogicalAnd"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/logical_and_p_i1.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.LogicalAnd"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/logical_not_d_i1.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.LogicalNot"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/logical_not_p_i1.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<13x?xi1>) -> (tensor<13x?xi1>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.LogicalNot"(%arg0) : (tensor<13x?xi1>) -> (tensor<13x?xi1>) 5 | tf_executor.fetch %0 : tensor<13x?xi1> 6 | } 7 | return %graph : tensor<13x?xi1> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/logical_not_s_i1.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<123x11xi1>) -> (tensor<123x11xi1>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.LogicalNot"(%arg0) : (tensor<123x11xi1>) -> (tensor<123x11xi1>) 5 | tf_executor.fetch %0 : tensor<123x11xi1> 6 | } 7 | return %graph : tensor<123x11xi1> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/logical_or_d_i1.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.LogicalOr"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/logical_or_p_i1.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.LogicalOr"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/max_col_p_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x?xf32>) -> tensor<100x?xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[0]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Max"(%arg0, %1) {keep_dims = false} : (tensor<110x100x?xf32>, tensor<1xi32>) -> tensor<100x?xf32> 5 | tf_executor.fetch %2 : tensor<100x?xf32> 6 | } 7 | return %graph : tensor<100x?xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/max_col_s_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x13xf32>) -> tensor<100x13xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[0]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Max"(%arg0, %1) {keep_dims = false} : (tensor<110x100x13xf32>, tensor<1xi32>) -> tensor<100x13xf32> 5 | tf_executor.fetch %2 : tensor<100x13xf32> 6 | } 7 | return %graph : tensor<100x13xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/max_multidim_d_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[1,2]> : tensor<2xi32>} : () -> tensor<2xi32> 4 | %2:2 = tf_executor.island wraps "tf.Max"(%arg0, %1) : (tensor, tensor<2xi32>) -> tensor 5 | tf_executor.fetch %2 : tensor 6 | } 7 | return %graph : tensor 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/max_row_d_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[2]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Max"(%arg0, %1) {keep_dims = false} : (tensor, tensor<1xi32>) -> tensor 5 | tf_executor.fetch %2 : tensor 6 | } 7 | return %graph : tensor 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/max_row_p_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x?xf32>) -> tensor<110x100xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[2]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Max"(%arg0, %1) : (tensor<110x100x?xf32>, tensor<1xi32>) -> tensor<110x100xf32> 5 | tf_executor.fetch %2 : tensor<110x100xf32> 6 | } 7 | return %graph : tensor<110x100xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/max_row_s_2d_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<11000x123xf32>) -> tensor<11000xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[1]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Max"(%arg0, %1) : (tensor<11000x123xf32>, tensor<1xi32>) -> tensor<11000xf32> 5 | tf_executor.fetch %2 : tensor<11000xf32> 6 | } 7 | return %graph : tensor<11000xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/max_row_s_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x123xf32>) -> tensor<110x100xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[2]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Max"(%arg0, %1) : (tensor<110x100x123xf32>, tensor<1xi32>) -> tensor<110x100xf32> 5 | tf_executor.fetch %2 : tensor<110x100xf32> 6 | } 7 | return %graph : tensor<110x100xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/maximum_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Maximum"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/maximum_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Maximum"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/mean_col_p_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x?xf32>) -> tensor<100x?xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[0]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Mean"(%arg0, %1) {keep_dims = false} : (tensor<110x100x?xf32>, tensor<1xi32>) -> tensor<100x?xf32> 5 | tf_executor.fetch %2 : tensor<100x?xf32> 6 | } 7 | return %graph : tensor<100x?xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/mean_col_s_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x13xf32>) -> tensor<100x13xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[0]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Mean"(%arg0, %1) {keep_dims = false} : (tensor<110x100x13xf32>, tensor<1xi32>) -> tensor<100x13xf32> 5 | tf_executor.fetch %2 : tensor<100x13xf32> 6 | } 7 | return %graph : tensor<100x13xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/mean_multidim_d_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[1,2]> : tensor<2xi32>} : () -> tensor<2xi32> 4 | %2:2 = tf_executor.island wraps "tf.Mean"(%arg0, %1) : (tensor, tensor<2xi32>) -> tensor 5 | tf_executor.fetch %2 : tensor 6 | } 7 | return %graph : tensor 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/mean_row_d_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[2]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Mean"(%arg0, %1) {keep_dims = false} : (tensor, tensor<1xi32>) -> tensor 5 | tf_executor.fetch %2 : tensor 6 | } 7 | return %graph : tensor 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/mean_row_p_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x?xf32>) -> tensor<110x100xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[2]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Mean"(%arg0, %1) : (tensor<110x100x?xf32>, tensor<1xi32>) -> tensor<110x100xf32> 5 | tf_executor.fetch %2 : tensor<110x100xf32> 6 | } 7 | return %graph : tensor<110x100xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/mean_row_s_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x123xf32>) -> tensor<110x100xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[2]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Mean"(%arg0, %1) : (tensor<110x100x123xf32>, tensor<1xi32>) -> tensor<110x100xf32> 5 | tf_executor.fetch %2 : tensor<110x100xf32> 6 | } 7 | return %graph : tensor<110x100xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/min_col_p_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x?xf32>) -> tensor<100x?xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[0]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Min"(%arg0, %1) {keep_dims = false} : (tensor<110x100x?xf32>, tensor<1xi32>) -> tensor<100x?xf32> 5 | tf_executor.fetch %2 : tensor<100x?xf32> 6 | } 7 | return %graph : tensor<100x?xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/min_col_s_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x13xf32>) -> tensor<100x13xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[0]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Min"(%arg0, %1) {keep_dims = false} : (tensor<110x100x13xf32>, tensor<1xi32>) -> tensor<100x13xf32> 5 | tf_executor.fetch %2 : tensor<100x13xf32> 6 | } 7 | return %graph : tensor<100x13xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/min_multidim_d_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[1,2]> : tensor<2xi32>} : () -> tensor<2xi32> 4 | %2:2 = tf_executor.island wraps "tf.Min"(%arg0, %1) : (tensor, tensor<2xi32>) -> tensor 5 | tf_executor.fetch %2 : tensor 6 | } 7 | return %graph : tensor 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/min_row_d_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[2]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Min"(%arg0, %1) {keep_dims = false} : (tensor, tensor<1xi32>) -> tensor 5 | tf_executor.fetch %2 : tensor 6 | } 7 | return %graph : tensor 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/min_row_p_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x?xf32>) -> tensor<110x100xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[2]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Min"(%arg0, %1) : (tensor<110x100x?xf32>, tensor<1xi32>) -> tensor<110x100xf32> 5 | tf_executor.fetch %2 : tensor<110x100xf32> 6 | } 7 | return %graph : tensor<110x100xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/min_row_s_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x123xf32>) -> tensor<110x100xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[2]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Min"(%arg0, %1) : (tensor<110x100x123xf32>, tensor<1xi32>) -> tensor<110x100xf32> 5 | tf_executor.fetch %2 : tensor<110x100xf32> 6 | } 7 | return %graph : tensor<110x100xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/minimum_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Minimum"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/minimum_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Minimum"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/mul_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Mul"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/mul_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Mul"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/neg_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Neg"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/neg_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Neg"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/neg_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Neg"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/not_equal_d_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.NotEqual"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/not_equal_p_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<13x?xi64>, %arg1: tensor<13x?xi64>) -> (tensor<13x?xi1>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.NotEqual"(%arg0, %arg1) : (tensor<13x?xi64>, tensor<13x?xi64>) -> (tensor<13x?xi1>) 5 | tf_executor.fetch %0 : tensor<13x?xi1> 6 | } 7 | return %graph : tensor<13x?xi1> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/pow_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Pow"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/pow_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Pow"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/prod_col_p_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x?xf32>) -> tensor<100x?xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[0]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Prod"(%arg0, %1) {keep_dims = false} : (tensor<110x100x?xf32>, tensor<1xi32>) -> tensor<100x?xf32> 5 | tf_executor.fetch %2 : tensor<100x?xf32> 6 | } 7 | return %graph : tensor<100x?xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/prod_col_s_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x13xf32>) -> tensor<100x13xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[0]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Prod"(%arg0, %1) {keep_dims = false} : (tensor<110x100x13xf32>, tensor<1xi32>) -> tensor<100x13xf32> 5 | tf_executor.fetch %2 : tensor<100x13xf32> 6 | } 7 | return %graph : tensor<100x13xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/prod_multidim_d_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[1,2]> : tensor<2xi32>} : () -> tensor<2xi32> 4 | %2:2 = tf_executor.island wraps "tf.Prod"(%arg0, %1) : (tensor, tensor<2xi32>) -> tensor 5 | tf_executor.fetch %2 : tensor 6 | } 7 | return %graph : tensor 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/prod_row_d_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[2]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Prod"(%arg0, %1) {keep_dims = false} : (tensor, tensor<1xi32>) -> tensor 5 | tf_executor.fetch %2 : tensor 6 | } 7 | return %graph : tensor 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/prod_row_p_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x?xf32>) -> tensor<110x100xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[2]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Prod"(%arg0, %1) : (tensor<110x100x?xf32>, tensor<1xi32>) -> tensor<110x100xf32> 5 | tf_executor.fetch %2 : tensor<110x100xf32> 6 | } 7 | return %graph : tensor<110x100xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/prod_row_s_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<110x100x123xf32>) -> tensor<110x100xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Const"() {value = dense<[2]> : tensor<1xi32>} : () -> tensor<1xi32> 4 | %2:2 = tf_executor.island wraps "tf.Prod"(%arg0, %1) : (tensor<110x100x123xf32>, tensor<1xi32>) -> tensor<110x100xf32> 5 | tf_executor.fetch %2 : tensor<110x100xf32> 6 | } 7 | return %graph : tensor<110x100xf32> 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/range_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor, %arg2: tensor) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Range"(%arg0, %arg1, %arg2) : (tensor, tensor, tensor) -> tensor 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/range_s_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor, %arg2: tensor) -> tensor<2xi64> attributes {tf.entry_function = {inputs = "input0,input1,input2", 3 | outputs = "output0"}} { 4 | %graph = tf_executor.graph { 5 | %0:2 = tf_executor.island wraps "tf.Range"(%arg0, %arg1, %arg2) : (tensor, tensor, tensor) -> tensor<2xi64> 6 | tf_executor.fetch %0 : tensor<2xi64> 7 | } 8 | return %graph : tensor<2xi64> 9 | } 10 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/real_div_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.RealDiv"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/relu6_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Relu6"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/relu6_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Relu6"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/relu6_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Relu6"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/relu_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Relu"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/relu_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Relu"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/relu_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Relu"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/round_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Round"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/round_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Round"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/round_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Round"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/rsqrt_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Rsqrt"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/rsqrt_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Rsqrt"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/rsqrt_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Rsqrt"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/shape_2d_d_i32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor<2xi32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Shape"(%arg0) {device = ""} : (tensor) -> (tensor<2xi32>) 5 | tf_executor.fetch %0 : tensor<2xi32> 6 | } 7 | return %graph : tensor<2xi32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/shape_2d_d_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor<2xi64>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Shape"(%arg0) {device = ""} : (tensor) -> (tensor<2xi64>) 5 | tf_executor.fetch %0 : tensor<2xi64> 6 | } 7 | return %graph : tensor<2xi64> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/shape_2d_p_i32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<13x?xf32>) -> (tensor<2xi32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Shape"(%arg0) {device = ""} : (tensor<13x?xf32>) -> (tensor<2xi32>) 5 | tf_executor.fetch %0 : tensor<2xi32> 6 | } 7 | return %graph : tensor<2xi32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/shape_2d_s_i32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<13x14xf32>) -> (tensor<2xi32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Shape"(%arg0) {device = ""} : (tensor<13x14xf32>) -> (tensor<2xi32>) 5 | tf_executor.fetch %0 : tensor<2xi32> 6 | } 7 | return %graph : tensor<2xi32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/shape_scalar_i32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor<0xi32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Shape"(%arg0) {device = ""} : (tensor) -> (tensor<0xi32>) 5 | tf_executor.fetch %0 : tensor<0xi32> 6 | } 7 | return %graph : tensor<0xi32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/shape_scalar_i64.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor<0xi64>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Shape"(%arg0) {device = ""} : (tensor) -> (tensor<0xi64>) 5 | tf_executor.fetch %0 : tensor<0xi64> 6 | } 7 | return %graph : tensor<0xi64> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/sigmoid_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sigmoid"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/sigmoid_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x?xf32>) -> (tensor<100x?xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sigmoid"(%arg0) : (tensor<100x?xf32>) -> (tensor<100x?xf32>) 5 | tf_executor.fetch %0 : tensor<100x?xf32> 6 | } 7 | return %graph : tensor<100x?xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/sigmoid_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sigmoid"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/sign_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sign"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/sign_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x?xf32>) -> (tensor<100x?xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sign"(%arg0) : (tensor<100x?xf32>) -> (tensor<100x?xf32>) 5 | tf_executor.fetch %0 : tensor<100x?xf32> 6 | } 7 | return %graph : tensor<100x?xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/sign_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sign"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/sin_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sin"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/sin_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x?xf32>) -> (tensor<100x?xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sin"(%arg0) : (tensor<100x?xf32>) -> (tensor<100x?xf32>) 5 | tf_executor.fetch %0 : tensor<100x?xf32> 6 | } 7 | return %graph : tensor<100x?xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/sin_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x10xf32>) -> (tensor<100x10xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sin"(%arg0) : (tensor<100x10xf32>) -> (tensor<100x10xf32>) 5 | tf_executor.fetch %0 : tensor<100x10xf32> 6 | } 7 | return %graph : tensor<100x10xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/snapshot_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Snapshot"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/snapshot_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Snapshot"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/snapshot_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Snapshot"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/softmax_d_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Softmax"(%arg0) : (tensor) -> tensor 4 | tf_executor.fetch %1 : tensor 5 | } 6 | return %graph : tensor 7 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/softmax_p_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<13x21x?xf32>) -> tensor<13x21x?xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Softmax"(%arg0) : (tensor<13x21x?xf32>) -> tensor<13x21x?xf32> 4 | tf_executor.fetch %1 : tensor <13x21x?xf32> 5 | } 6 | return %graph : tensor<13x21x?xf32> 7 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/softmax_s_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<13x21x100xf32>) -> tensor<13x21x100xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Softmax"(%arg0) : (tensor<13x21x100xf32>) -> tensor<13x21x100xf32> 4 | tf_executor.fetch %1 : tensor <13x21x100xf32> 5 | } 6 | return %graph : tensor<13x21x100xf32> 7 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/softplus_d_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Softplus"(%arg0) : (tensor) -> tensor 4 | tf_executor.fetch %1 : tensor 5 | } 6 | return %graph : tensor 7 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/softplus_p_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Softplus"(%arg0) : (tensor) -> tensor 4 | tf_executor.fetch %1 : tensor 5 | } 6 | return %graph : tensor 7 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/softplus_s_f32.mlir: -------------------------------------------------------------------------------- 1 | func.func @main(%arg0: tensor<13x21x100xf32>) -> tensor<13x21x100xf32> attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 2 | %graph = tf_executor.graph { 3 | %1:2 = tf_executor.island wraps "tf.Softplus"(%arg0) : (tensor<13x21x100xf32>) -> tensor<13x21x100xf32> 4 | tf_executor.fetch %1 : tensor <13x21x100xf32> 5 | } 6 | return %graph : tensor<13x21x100xf32> 7 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/sqrt_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sqrt"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/sqrt_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sqrt"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/sqrt_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sqrt"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/sub_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sub"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/sub_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Sub"(%arg0, %arg1) : (tensor, tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/tanh_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Tanh"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/tanh_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Tanh"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/tanh_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.Tanh"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/tile_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor<2xi32>) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %2:2 = tf_executor.island wraps "tf.Tile"(%arg0, %arg1) : (tensor, tensor<2xi32>) -> tensor 5 | tf_executor.fetch %2 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/tile_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<20x?xf32>, %arg1: tensor<2xi32>) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %2:2 = tf_executor.island wraps "tf.Tile"(%arg0, %arg1) : (tensor<20x?xf32>, tensor<2xi32>) -> tensor 5 | tf_executor.fetch %2 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/tile_p_i32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<1xi32>, %arg1: tensor<1xi32>) -> tensor attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %2:2 = tf_executor.island wraps "tf.Tile"(%arg0, %arg1) : (tensor<1xi32>, tensor<1xi32>) -> tensor 5 | tf_executor.fetch %2 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/zeros_like_d_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.ZerosLike"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/zeros_like_p_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor) -> (tensor) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.ZerosLike"(%arg0) : (tensor) -> (tensor) 5 | tf_executor.fetch %0 : tensor 6 | } 7 | return %graph : tensor 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tests/tensorflow_ops/data/zeros_like_s_f32.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 0 : i32}} { 2 | func.func @main(%arg0: tensor<100x100xf32>) -> (tensor<100x100xf32>) attributes {tf.entry_function = {inputs = "{{INPUTS}}", outputs = "{{OUTPUTS}}", input_placements="{{INPUT_PLACEMENTS}}", output_placements="{{OUTPUT_PLACEMENTS}}"}} { 3 | %graph = tf_executor.graph { 4 | %0:2 = tf_executor.island wraps "tf.ZerosLike"(%arg0) : (tensor<100x100xf32>) -> (tensor<100x100xf32>) 5 | tf_executor.fetch %0 : tensor<100x100xf32> 6 | } 7 | return %graph : tensor<100x100xf32> 8 | } 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tools/BUILD: -------------------------------------------------------------------------------- 1 | exports_files([ 2 | "disc-opt/disc-opt.cc", 3 | "disc-source-emitter/disc-cuda-emitter.cc", 4 | "disc-pdll/disc-pdll.cc" 5 | ]) -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tools/disc-pdll/README.md: -------------------------------------------------------------------------------- 1 | ## Introduction 2 | DISC Custom call plugin based on MLIR PDLL. 3 | 4 | ### Run Tests 5 | 6 | ``` 7 | python scripts/python/tao_build.py /opt/venv_disc/ [--cpu_only] -s test_tao_compiler 8 | ``` 9 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tools/disc-replay/test_data/BUILD: -------------------------------------------------------------------------------- 1 | exports_files(["data.tar", "program.pb"]) -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tools/disc-replay/test_data/data.tar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/tao_compiler/mlir/disc/tools/disc-replay/test_data/data.tar -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tools/disc-replay/test_data/program.pb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/tao_compiler/mlir/disc/tools/disc-replay/test_data/program.pb -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tools/disc-source-emitter/tests/BUILD: -------------------------------------------------------------------------------- 1 | load("@org_tensorflow//tensorflow:tensorflow.bzl", "filegroup") 2 | load("//mlir/disc:glob_lit_test.bzl", "glob_lit_tests") 3 | 4 | package(licenses = ["notice"]) 5 | 6 | glob_lit_tests( 7 | data = [":test_utilities"], 8 | driver = "@llvm-project//mlir:run_lit.sh", 9 | test_file_exts = ["mlir"], 10 | ) 11 | 12 | # Bundle together all of the test utilities that are used by tests. 13 | filegroup( 14 | name = "test_utilities", 15 | testonly = True, 16 | data = [ 17 | "//mlir/disc:disc-source-emitter", 18 | "@llvm-project//llvm:FileCheck", 19 | ], 20 | ) -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tools/disc-transform/LinalgExt/tests/BUILD: -------------------------------------------------------------------------------- 1 | load("@org_tensorflow//tensorflow:tensorflow.bzl", "filegroup") 2 | load("//mlir/disc:glob_lit_test.bzl", "glob_lit_tests") 3 | 4 | package(licenses = ["notice"]) 5 | 6 | glob_lit_tests( 7 | data = [":test_utilities"], 8 | driver = "@llvm-project//mlir:run_lit.sh", 9 | test_file_exts = ["mlir"], 10 | ) 11 | 12 | # Bundle together all of the test utilities that are used by tests. 13 | filegroup( 14 | name = "test_utilities", 15 | testonly = True, 16 | data = [ 17 | "//mlir/disc:disc-opt", 18 | "@llvm-project//llvm:FileCheck", 19 | ], 20 | ) -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tools/disc-transform/transforms/tests/memref-copy-to-linalg.mlir: -------------------------------------------------------------------------------- 1 | // RUN: disc-opt --disc-memref-copy-to-linalg -split-input-file %s | FileCheck %s 2 | 3 | // CHECK-LABEL: @copy 4 | func.func @copy(%arg1: memref, %arg2: memref) -> memref { 5 | // CHECK-NOT: memref.copy 6 | // CHECK: linalg.generic 7 | memref.copy %arg1, %arg2 : memref to memref 8 | return %arg2 : memref 9 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/tools/disc-transform/transforms/tests/metadata-only-transform-dialect-interpreter-standalone.mlir: -------------------------------------------------------------------------------- 1 | transform.sequence failures(propagate) { 2 | ^bb0(%arg1: !transform.any_op): 3 | %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op 4 | %1, %loops:3 = transform.structured.tile %0 [2, 3, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op) 5 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/transforms/tests/BUILD: -------------------------------------------------------------------------------- 1 | load("@org_tensorflow//tensorflow:tensorflow.bzl", "filegroup") 2 | load("//mlir/disc:glob_lit_test.bzl", "glob_lit_tests") 3 | 4 | package(licenses = ["notice"]) 5 | 6 | glob_lit_tests( 7 | data = [":test_utilities"], 8 | driver = "@llvm-project//mlir:run_lit.sh", 9 | test_file_exts = ["mlir"], 10 | ) 11 | 12 | # Bundle together all of the test utilities that are used by tests. 13 | filegroup( 14 | name = "test_utilities", 15 | testonly = True, 16 | data = [ 17 | "//mlir/disc:disc-opt", 18 | "@llvm-project//llvm:FileCheck", 19 | ], 20 | ) -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/transforms/tests/input-mutation.mlir: -------------------------------------------------------------------------------- 1 | // RUN: disc-opt %s -disc-hlo-legalize-to-lhlo -hlo-legalize-to-lhlo -canonicalize -disc-lhlo-rewriter -disc-argsmutation-expand -split-input-file | FileCheck %s 2 | 3 | func.func @input_mutation(%arg0: tensor<8x32xf32>, %arg1: tensor<8x32xf32>) -> tensor<8x32xf32> { 4 | // CHECK: "lmhlo.add"(%arg0, %arg1, %arg0) : (memref<8x32xf32>, memref<8x32xf32>, memref<8x32xf32>) -> () 5 | %1 = mhlo.add %arg0, %arg1 : (tensor<8x32xf32>, tensor<8x32xf32>) -> tensor<8x32xf32> 6 | "mhlo_disc.args_mutation"(%1, %arg0) : (tensor<8x32xf32>, tensor<8x32xf32>) -> () 7 | "func.return"(%1) : (tensor<8x32xf32>) -> () 8 | } -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/transforms/tests/split_large_ops.mlir: -------------------------------------------------------------------------------- 1 | // RUN: disc-opt -split-input-file -split-large-ops=max-num-operands-per-op=2 %s | FileCheck %s 2 | 3 | // CHECK-LABEL: func.func @test 4 | func.func @test(%arg0: tensor, %arg1: tensor, %arg2: tensor, %arg3: tensor) -> (tensor) { 5 | %0 = "mhlo.concatenate"(%arg0, %arg1, %arg2, %arg3) { dimension = 0 : i64 } : (tensor, tensor, tensor, tensor) -> tensor 6 | // CHECK-COUNT-3: concatenate 7 | return %0 : tensor 8 | } 9 | -------------------------------------------------------------------------------- /tao_compiler/mlir/disc/utils/cutlass_required_headers.cu: -------------------------------------------------------------------------------- 1 | #include // Only for debugging purpose. 2 | #include 3 | 4 | #include "cutlass/gemm/device/gemm_universal.h" 5 | #include "cutlass/util/device_memory.h" 6 | 7 | // This file maintains the headers required by the schedule of CUTLASS-based 8 | // compute-intensive op code generation. The headers will be preprocessed 9 | // separated with the main body of codegen schedules. -------------------------------------------------------------------------------- /tao_compiler/mlir/ral/context/mkldnn/ideep/ideep/computations.hpp: -------------------------------------------------------------------------------- 1 | #ifndef IDEEP_COMPUTATIONS_HPP 2 | #define IDEEP_COMPUTATIONS_HPP 3 | 4 | #include "lru_cache.hpp" 5 | #include "operators/conv.hpp" 6 | #include "operators/deconv.hpp" 7 | #include "operators/matmul.hpp" 8 | #endif 9 | -------------------------------------------------------------------------------- /tao_compiler/mlir/ral/context_version_scripts.lds: -------------------------------------------------------------------------------- 1 | RalBaseContext { 2 | global: 3 | *tao*; 4 | *kMlirLoweredEntry*; 5 | local: 6 | *; 7 | }; 8 | -------------------------------------------------------------------------------- /tao_compiler/mlir/ral/test/test.mlir: -------------------------------------------------------------------------------- 1 | module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 175 : i32}} { 2 | func.func @main(%arg0: tensor, %arg1: tensor) -> tensor attributes {tf.entry_function = {inputs = "arg_x_0_0_0_arg,arg_z_0_2_0_arg", outputs = "add_4:0"}} { 3 | %0 = xla_hlo.add %arg0, %arg1 : tensor 4 | %1 = xla_hlo.add %0, %0 : tensor 5 | return %1 : tensor 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tao_compiler/tao: -------------------------------------------------------------------------------- 1 | /workspace/BladeDISC/tao -------------------------------------------------------------------------------- /tao_compiler/third_party/iree/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/tao_compiler/third_party/iree/BUILD -------------------------------------------------------------------------------- /tensorflow_blade/.bazelversion: -------------------------------------------------------------------------------- 1 | 6.1.0 -------------------------------------------------------------------------------- /tensorflow_blade/.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = E501,W503,E203 3 | exclude = .git,__pycache__,build,dist 4 | max-complexity = 10 5 | -------------------------------------------------------------------------------- /tensorflow_blade/.isort.cfg: -------------------------------------------------------------------------------- 1 | [settings] 2 | line_length=88 3 | multi_line_output=3 4 | include_trailing_comma=True 5 | use_parentheses=True 6 | known_third_party=tensorflow 7 | known_first_party=tf_blade 8 | -------------------------------------------------------------------------------- /tensorflow_blade/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.black] 2 | line-length = 88 3 | target-version = ['py36'] 4 | skip-string-normalization = true 5 | -------------------------------------------------------------------------------- /tensorflow_blade/requirement-common.txt: -------------------------------------------------------------------------------- 1 | # for testing 2 | pytest==6.2.5 3 | pytest-forked==1.4.0 4 | pytest-html==3.1.1 5 | parameterized==0.8.1 6 | 7 | # for packaging 8 | cython==0.29.23 9 | 10 | # for linting 11 | click==8.0.4 12 | black==19.10b0 13 | flake8==3.9.2 14 | flake8-isort==4.0.0 15 | isort==5.8.0 16 | mypy==0.782 17 | 18 | # common deps 19 | py-cpuinfo==8.0.0 20 | six~=1.15.0 21 | tf2onnx==1.9.1 22 | -------------------------------------------------------------------------------- /tensorflow_blade/requirement-tf2.5.0-cpu.txt: -------------------------------------------------------------------------------- 1 | -r requirement-common.txt 2 | tensorflow==2.5.0 3 | -------------------------------------------------------------------------------- /tensorflow_blade/requirement-tf2.5.0-cu113.txt: -------------------------------------------------------------------------------- 1 | -r requirement-common.txt 2 | tensorflow-gpu==2.5.0 3 | -------------------------------------------------------------------------------- /tensorflow_blade/src/custom_ops/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/tensorflow_blade/src/custom_ops/BUILD -------------------------------------------------------------------------------- /tensorflow_blade/src/custom_ops/trt_engine_op/BUILD: -------------------------------------------------------------------------------- 1 | load("//:build_defs.bzl", "tf_blade_library") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | tf_blade_library( 6 | name = "trt_engine_op", 7 | srcs = ["trt_engine_op.cc"], 8 | deps = [ 9 | "//src/tensorrt:tensorrt_bridge_impl", 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /tensorflow_blade/src/tf_blade.lds: -------------------------------------------------------------------------------- 1 | VERS_1.0 { 2 | global: 3 | *blade*; 4 | local: 5 | *; 6 | }; 7 | -------------------------------------------------------------------------------- /tensorflow_blade/src/tf_compatible_version.h.in: -------------------------------------------------------------------------------- 1 | #ifndef SRC_TF_VERSION_H 2 | #define SRC_TF_VERSION_H 3 | #pragma once 4 | 5 | #include 6 | 7 | std::string compatible_tf_version() { 8 | return std::string("TF_COMPATIBLE_STRING"); 9 | } 10 | 11 | #endif // SRC_TF_VERSION_H 12 | -------------------------------------------------------------------------------- /tensorflow_blade/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /tensorflow_blade/tests/gpu/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /tensorflow_blade/tests/pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | markers = 3 | cpu_only: CPU-only test case. 4 | gpu_only: GPU-only test case. 5 | tf1_only: TF1-only test case. 6 | tf2_only: TF2-only test case. 7 | render_collapsed = True 8 | 9 | -------------------------------------------------------------------------------- /tensorflow_blade/tests/util/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /tensorflow_blade/tf_blade/common/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /tensorflow_blade/tf_blade/gpu/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /tensorflow_blade/tf_blade/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/tensorflow_blade/tf_blade/py.typed -------------------------------------------------------------------------------- /tensorflow_blade/tf_blade/util/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /tensorflow_blade/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | 12 | __version__ = "0.2.0" 13 | -------------------------------------------------------------------------------- /tensorflow_blade/workspace_platform_alibaba.bzl: -------------------------------------------------------------------------------- 1 | load("@org_third_party//bazel/blade_service_common:blade_service_common_configure.bzl", "blade_service_common_configure") 2 | 3 | def workspace_platform_alibaba(): 4 | blade_service_common_configure(name = "local_config_blade_service_common") 5 | 6 | native.new_local_repository( 7 | name = "hie", 8 | build_file = "//bazel/platform_alibaba:hie.BUILD", 9 | path = "../../platform_alibaba/third_party/HIE", 10 | ) 11 | -------------------------------------------------------------------------------- /third_party/.bazelversion: -------------------------------------------------------------------------------- 1 | 6.1.0 -------------------------------------------------------------------------------- /third_party/WORKSPACE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/WORKSPACE -------------------------------------------------------------------------------- /third_party/bazel/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/bazel/BUILD -------------------------------------------------------------------------------- /third_party/bazel/acl/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/bazel/acl/BUILD -------------------------------------------------------------------------------- /third_party/bazel/blade_disc_helper/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/bazel/blade_disc_helper/BUILD -------------------------------------------------------------------------------- /third_party/bazel/blade_service_common/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/bazel/blade_service_common/BUILD -------------------------------------------------------------------------------- /third_party/bazel/blade_service_common/BUILD.tpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/bazel/blade_service_common/BUILD.tpl -------------------------------------------------------------------------------- /third_party/bazel/blade_service_common/blade_service_common_empty_workspace.bzl.tpl: -------------------------------------------------------------------------------- 1 | def _blade_service_common_repositories(): 2 | pass 3 | 4 | def workspace(): 5 | _blade_service_common_repositories() 6 | 7 | blade_service_common_workspace = workspace 8 | -------------------------------------------------------------------------------- /third_party/bazel/cuda_supplement/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/bazel/cuda_supplement/BUILD -------------------------------------------------------------------------------- /third_party/bazel/cuda_supplement/build_defs.bzl.tpl: -------------------------------------------------------------------------------- 1 | def if_has_cublaslt(if_true, if_false = []): 2 | if %{IF_HAS_CUBLASLT}: 3 | return if_true 4 | return if_false 5 | 6 | def if_has_cudnn_static(if_true, if_false = []): 7 | if %{IF_HAS_CUDNN_STATIC}: 8 | return if_true 9 | return if_false 10 | -------------------------------------------------------------------------------- /third_party/bazel/cuda_supplement/dummy.BUILD.tpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/bazel/cuda_supplement/dummy.BUILD.tpl -------------------------------------------------------------------------------- /third_party/bazel/mkl/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/bazel/mkl/BUILD -------------------------------------------------------------------------------- /third_party/bazel/mkl/BUILD.tpl: -------------------------------------------------------------------------------- 1 | # MKL 2 | 3 | licenses(["notice"]) 4 | 5 | package(default_visibility = ["//visibility:public"]) 6 | 7 | %{mkl_static_lib_imports} 8 | 9 | cc_library( 10 | name = "mkl_headers", 11 | hdrs = glob(["include/*.h"]), 12 | includes = ["include"], 13 | ) 14 | 15 | cc_library( 16 | name = "mkl_static", 17 | linkstatic = 1, 18 | alwayslink = 1, 19 | deps = [ 20 | ":mkl_headers", 21 | %{mkl_static_lib_targets} 22 | ], 23 | ) 24 | 25 | exports_files(["%{mkl_iomp_dynamic_lib_target}"]) 26 | -------------------------------------------------------------------------------- /third_party/bazel/mkl/build_defs.bzl.tpl: -------------------------------------------------------------------------------- 1 | # Build configurations for MKL. 2 | 3 | def if_mkl_enabled(if_true, if_false=[]): 4 | """Tests whether MKL was enabled during the configure process.""" 5 | return %{if_mkl} 6 | 7 | def mkl_copts(): 8 | return if_mkl_enabled([ 9 | "-DUSE_AVX512", 10 | "-DMKL_ILP64", 11 | "-mfma", 12 | "-mavx", 13 | "-mavx2", 14 | "-mavx512f", 15 | "-fopenmp", 16 | "-m64", 17 | ]) 18 | -------------------------------------------------------------------------------- /third_party/bazel/mkldnn/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/bazel/mkldnn/BUILD -------------------------------------------------------------------------------- /third_party/bazel/mkldnn/mkl_include.BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_library( 4 | name = "mkl_include", 5 | hdrs = glob(["include/**"]), 6 | includes = ["include"], 7 | alwayslink = 1, # targets depending on it should carry all symbols in its children. 8 | linkstatic = 1, 9 | ) 10 | -------------------------------------------------------------------------------- /third_party/bazel/mkldnn/mkl_static.BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | exports_files(["lib"]) 4 | 5 | cc_library( 6 | name = "mkl_static_lib", 7 | srcs = glob(["lib/libmkl*.a"]), 8 | alwayslink = 1, # targets depending on it should carry all symbols in its children. 9 | linkstatic = 1, 10 | ) 11 | -------------------------------------------------------------------------------- /third_party/bazel/onednn/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/bazel/onednn/BUILD -------------------------------------------------------------------------------- /third_party/bazel/onednn/BUILD.tpl: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | exports_files([ 4 | "onednn.BUILD", 5 | ]) 6 | -------------------------------------------------------------------------------- /third_party/bazel/onednn/onednn.bzl.tpl: -------------------------------------------------------------------------------- 1 | def _filter_static_lib_impl(ctx): 2 | return DefaultInfo(files=depset([f for f in ctx.files.srcs if f.basename.endswith(".a")])) 3 | 4 | filter_static_lib = rule( 5 | implementation = _filter_static_lib_impl, 6 | attrs = { 7 | "srcs": attr.label_list(), 8 | }, 9 | ) 10 | -------------------------------------------------------------------------------- /third_party/bazel/tensorrt/BUILD: -------------------------------------------------------------------------------- 1 | 2 | exports_files(["repo.bzl", "trt.BUILD.bzl"]) 3 | -------------------------------------------------------------------------------- /third_party/bazel/tensorrt/README.md: -------------------------------------------------------------------------------- 1 | These `trt.BUILD.tpl` files are copied and modified from Torch-TensorRT. 2 | 3 | Thanks to https://github.com/NVIDIA/Torch-TensorRT. 4 | -------------------------------------------------------------------------------- /third_party/bazel/tensorrt/build_defs.bzl.tpl: -------------------------------------------------------------------------------- 1 | def if_has_myelin(if_true, if_false = []): 2 | if %{IF_HAS_MYELIN}: 3 | return if_true 4 | return if_false 5 | -------------------------------------------------------------------------------- /third_party/bazel/tf/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/bazel/tf/BUILD -------------------------------------------------------------------------------- /third_party/bazel/tf/BUILD.tpl: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_library( 4 | name = "tf_header_lib", 5 | hdrs = glob(["include/*.h"]), 6 | includes = ["include"], 7 | ) 8 | 9 | cc_library( 10 | name = "libtensorflow_framework", 11 | srcs = glob(["lib/libtensorflow_framework.so.*"]), 12 | linkstatic=1, 13 | ) 14 | -------------------------------------------------------------------------------- /third_party/bazel/tf_protobuf/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/bazel/tf_protobuf/BUILD -------------------------------------------------------------------------------- /third_party/bazel/tf_protobuf/BUILD.tpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/bazel/tf_protobuf/BUILD.tpl -------------------------------------------------------------------------------- /third_party/bazel/third_party/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/BladeDISC/58efe1a138cf32b11380710b51593642a0db18a4/third_party/bazel/third_party/BUILD -------------------------------------------------------------------------------- /third_party/bazel/third_party/cub.BUILD: -------------------------------------------------------------------------------- 1 | # Description: CUB library which is a set of primitives for GPU programming. 2 | 3 | package( 4 | default_visibility = ["//visibility:public"], 5 | ) 6 | 7 | licenses(["notice"]) # BSD 8 | 9 | cc_library( 10 | name = "cub", 11 | hdrs = glob(["cub/**"]), 12 | deps = ["@local_config_cuda//cuda:cuda_headers"], 13 | ) 14 | -------------------------------------------------------------------------------- /tools/torch_quant/requirements-dev.txt: -------------------------------------------------------------------------------- 1 | parameterized 2 | more_itertools 3 | onnx 4 | -------------------------------------------------------------------------------- /tools/torch_quant/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The BladeDISC Authors. All rights reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | --------------------------------------------------------------------------------