diff --git a/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/configuration.h b/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/configuration.h index b482cef5377e0f879b43f06a7ebbfbe01b39be09..14dc8f20f2111e85e82630cdbcc0c695a39c5ecd 100644 --- a/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/configuration.h +++ b/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/configuration.h @@ -72,7 +72,9 @@ public: FP32, FP16, PERFORATION, -// INPUT_SAMPLING, + INPUT_SAMPLING, + REDUCTION_SAMPLING, +// ADDITIONAL_APPROXIMATION_METHOD APPROX_END }; @@ -91,6 +93,15 @@ public: POOL_MEAN, POOL_MIN, SOFTMAX, + FFT, + REDUCE, + PROJECTIVE_T, + MAP1, + MAP2, + MAP3, +// STENCIL, +// COSINE_T, +// ADDITIONAL_TENSOR_OPERATION TENSOR_OP_END }; @@ -269,6 +280,24 @@ void GPUNodeConfiguration::print() { case TENSOR_OP::SOFTMAX : DEBUG("softmax"); break; + case TENSOR_OP::FFT : + DEBUG("fft"); + break; + case TENSOR_OP::REDUCE : + DEBUG("reduce"); + break; + case TENSOR_OP::PROJECTIVE_T : + DEBUG("projectiveT"); + break; + case TENSOR_OP::MAP1 : + DEBUG("map1"); + break; + case TENSOR_OP::MAP2 : + DEBUG("map2"); + break; + case TENSOR_OP::MAP3 : + DEBUG("map3"); + break; default : ERROR("Unknown tensor operation."); break; @@ -288,6 +317,12 @@ void GPUNodeConfiguration::print() { case APPROX::PERFORATION : DEBUG("perf"); break; + case APPROX::INPUT_SAMPLING : + DEBUG("input_samp"); + break; + case APPROX::REDUCTION_SAMPLING : + DEBUG("red_samp"); + break; default: ERROR("Unknown approximation option"); break; diff --git a/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/hpvm-rt-controller.h b/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/hpvm-rt-controller.h index 911f42b955a72cb756aadc1fc78231187ef3394e..21c6df7f1749e891dba257bbb1933c3beefb8c4f 100644 --- a/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/hpvm-rt-controller.h +++ b/llvm/projects/hpvm-tensor-rt/tensor_runtime/include/hpvm-rt-controller.h @@ -735,6 +735,30 @@ void RuntimeController::readConfigurationFile(const char *str) { DEBUG ("Found softmax operation\n"); NodeConf->pushNewTensorOperation(GPUNodeConfiguration::TENSOR_OP::SOFTMAX); idx++; + } else if (tokens[idx] == "fft") { + DEBUG ("Found fft operation\n"); + NodeConf->pushNewTensorOperation(GPUNodeConfiguration::TENSOR_OP::FFT); + idx++; + } else if (tokens[idx] == "reduce") { + DEBUG ("Found reduce operation\n"); + NodeConf->pushNewTensorOperation(GPUNodeConfiguration::TENSOR_OP::REDUCE); + idx++; + } else if (tokens[idx] == "projectiveT") { + DEBUG ("Found projectiveT operation\n"); + NodeConf->pushNewTensorOperation(GPUNodeConfiguration::TENSOR_OP::PROJECTIVE_T); + idx++; + } else if (tokens[idx] == "map1") { + DEBUG ("Found map1 operation\n"); + NodeConf->pushNewTensorOperation(GPUNodeConfiguration::TENSOR_OP::MAP1); + idx++; + } else if (tokens[idx] == "map2") { + DEBUG ("Found map2 operation\n"); + NodeConf->pushNewTensorOperation(GPUNodeConfiguration::TENSOR_OP::MAP2); + idx++; + } else if (tokens[idx] == "map3") { + DEBUG ("Found map3 operation\n"); + NodeConf->pushNewTensorOperation(GPUNodeConfiguration::TENSOR_OP::MAP3); + idx++; } else /*Not a new operation. This means an approximation option*/ if (tokens[idx] == "fp32") { DEBUG("Found fp32 option\n"); @@ -756,6 +780,18 @@ void RuntimeController::readConfigurationFile(const char *str) { DEBUG("perf parameter: %d\n", perf); NodeConf->pushNewApproximationChoiceForOperation(GPUNodeConfiguration::APPROX::PERFORATION, perf); idx += 2; + } else if (tokens[idx] == "input_samp") { + DEBUG("Found input_samp option\n"); + int input_samp = std::stoi(tokens[idx+1]); + DEBUG("input_samp parameter: %d\n", input_samp); + NodeConf->pushNewApproximationChoiceForOperation(GPUNodeConfiguration::APPROX::INPUT_SAMPLING, input_samp); + idx += 2; + } else if (tokens[idx] == "red_samp") { + DEBUG("Found red_samp option\n"); + int red_samp = std::stoi(tokens[idx+1]); + DEBUG("red_samp parameter: %d\n", red_samp); + NodeConf->pushNewApproximationChoiceForOperation(GPUNodeConfiguration::APPROX::REDUCTION_SAMPLING, red_samp); + idx += 2; } // TODO: other approximation options handled here