| 135 | } |
| 136 | |
| 137 | int threadForward(std::unique_ptr<AbstractTransformerModelInstance>* model_instance, |
| 138 | std::shared_ptr<std::unordered_map<std::string, triton::Tensor>> request, |
| 139 | std::shared_ptr<std::unordered_map<std::string, triton::Tensor>>* output_tensors, |
| 140 | const int device_id) |
| 141 | { |
| 142 | ft::check_cuda_error(cudaSetDevice(device_id)); |
| 143 | *output_tensors = (*model_instance)->forward(request); |
| 144 | return 0; |
| 145 | } |
| 146 | |
| 147 | template<typename T> |
| 148 | int bert_triton_example(int argc, char* argv[]) |