2020-10-28 09:13:23 +08:00
|
|
|
#!/bin/bash
|
|
|
|
# Updates the ATen dialect generated code from the PyTorch op registry.
|
|
|
|
# Requires that the project has been built and that PyTorch support is enabled.
|
|
|
|
set -e
|
|
|
|
|
|
|
|
src_dir="$(realpath $(dirname $0)/..)"
|
|
|
|
build_dir="$(realpath "${NPCOMP_BUILD_DIR:-$src_dir/build}")"
|
|
|
|
aten_dir="${src_dir}/include/npcomp/Dialect/ATen/IR"
|
|
|
|
|
|
|
|
export PYTHONPATH="${build_dir}/python"
|
|
|
|
|
|
|
|
python -m torch_mlir_utils.codegen.torch_signature_ods_gen \
|
|
|
|
--ods_td_file="${aten_dir}/GeneratedATenOps.td" \
|
Add a number of kernels and new patterns.
* convolution, convolution_backward, _log_softmax, _log_softmax_backward_data, nll_loss_forward, nll_loss_backward, nll_loss2d_forward, nll_loss2d_backward, copy_
* Extends the recognition logic and metadata for handling inplace transformations, optional tensors, ints, lists and dropped args.
* The kernel_calls generated by test_conv_nllloss_grads.py now convert to ATen.
* The result *almost* comes out as a pure tensor program with the exception of the copy_ op, which I will do some followup work to deal with.
* More progress on #97
2020-11-04 11:24:28 +08:00
|
|
|
--ods_impl_file="${aten_dir}/GeneratedATenOps.cpp.inc" \
|
|
|
|
--debug_op_reg_file="${aten_dir}/ATenOpRegistrations.txt"
|