From de932dcdef7e3881992d3214ac0416f6b656d6d9 Mon Sep 17 00:00:00 2001 From: akashk4 <hashim.sharif91@gmail.com> Date: Sat, 30 Jan 2021 16:15:11 -0600 Subject: [PATCH] Add description of HPVM passes which deal with tensor operations --- .../lib/Transforms/DFG2LLVM_CUDNN/DFG2LLVM_CUDNN.cpp | 10 +++++++++- .../DFG2LLVM_WrapperAPI/DFG2LLVM_WrapperAPI.cpp | 11 ++++++++++- .../FuseHPVMTensorNodes/FuseHPVMTensorNodes.cpp | 12 +++++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/hpvm/lib/Transforms/DFG2LLVM_CUDNN/DFG2LLVM_CUDNN.cpp b/hpvm/lib/Transforms/DFG2LLVM_CUDNN/DFG2LLVM_CUDNN.cpp index bd26a92fd3..4653ad0f8a 100644 --- a/hpvm/lib/Transforms/DFG2LLVM_CUDNN/DFG2LLVM_CUDNN.cpp +++ b/hpvm/lib/Transforms/DFG2LLVM_CUDNN/DFG2LLVM_CUDNN.cpp @@ -1,4 +1,4 @@ -//=== DFG2LLVM_CUDNN.cpp ===// +//===------------------------- DFG2LLVM_CUDNN.cpp ------------------------ ===// // // The LLVM Compiler Infrastructure // @@ -6,6 +6,14 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// +// This pass replaces the tensor operations in HPVM with appropriate API to +// the runtime, which leverages CuDNN library for implementing the supported +// tensor operations. +// +//===----------------------------------------------------------------------===// + + #define ENABLE_ASSERTS #define DEBUG_TYPE "DFG2LLVM_CUDNN" diff --git a/hpvm/lib/Transforms/DFG2LLVM_WrapperAPI/DFG2LLVM_WrapperAPI.cpp b/hpvm/lib/Transforms/DFG2LLVM_WrapperAPI/DFG2LLVM_WrapperAPI.cpp index b400c12021..3fa6860b9c 100644 --- a/hpvm/lib/Transforms/DFG2LLVM_WrapperAPI/DFG2LLVM_WrapperAPI.cpp +++ b/hpvm/lib/Transforms/DFG2LLVM_WrapperAPI/DFG2LLVM_WrapperAPI.cpp @@ -1,4 +1,4 @@ -//=== DFG2LLVM_WrapperAPI.cpp ===// +//===------------------------- DFG2LLVM_Wrapper.cpp --------------------- ===// // // The LLVM Compiler Infrastructure // @@ -6,6 +6,15 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// +// This pass is responsible for "fusing" multiple tensor operations in HPVM +// nodes so that the appropriate set of operations are replaced with a single +// call to a runtime routine. This allows the HPVM IR to represent a graph +// with tensor operations in a target-agnostic manner. +// +//===----------------------------------------------------------------------===// + + #define ENABLE_ASSERTS #define DEBUG_TYPE "DFG2LLVM_WrapperAPI" diff --git a/hpvm/lib/Transforms/FuseHPVMTensorNodes/FuseHPVMTensorNodes.cpp b/hpvm/lib/Transforms/FuseHPVMTensorNodes/FuseHPVMTensorNodes.cpp index bb793dab6e..6b51d731fe 100644 --- a/hpvm/lib/Transforms/FuseHPVMTensorNodes/FuseHPVMTensorNodes.cpp +++ b/hpvm/lib/Transforms/FuseHPVMTensorNodes/FuseHPVMTensorNodes.cpp @@ -1,4 +1,4 @@ -//=== FuseHPVMTensorNodes.cpp ===// +//===------------------------- FuseHPVMTensorNodes.cpp ------------------- ===// // // The LLVM Compiler Infrastructure // @@ -6,6 +6,16 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// +// This pass is uses fuses HPVM nodes based on the tensor operations contained +// the nodes. This helps create the groundwork for indicating to the compiler +// that a set of tensor operations in a node are fusionable and it can have +// implications on performance and energy consumption of set of tensor +// operations in question. +// +//===----------------------------------------------------------------------===// + + #define DEBUG_TYPE "FuseTensorNodes" -- GitLab