pytorch
2ba5c1d7 - Inductor cpp wrapper: change inputs args from tuple to vector (#90754)

Commit
2 years ago
Inductor cpp wrapper: change inputs args from tuple to vector (#90754) ## Pitch Change input args type from `std::tuple` to `std::vector` to reduce the compilation time. ## Description `std::tie()` takes quite a long time during the compilation when the input args number grows. For example, for a graph from the `PegasusForConditionalGeneration` model with 318 input args, the compilation of `std::tie` for the args is about 10s. By changing to std::vector, the compilation time of arg assignment is reduced to less than 1s. ### Code before: ```cpp at::Tensor call_0(std::tuple<at::Tensor&, at::Tensor&> args) { at::Tensor arg0_1, arg1_1; std::tie(arg0_1, arg1_1) = args; ... return buf0; } ``` ### Code after: ```cpp at::Tensor call_0(std::vector<at::Tensor> args) { at::Tensor arg0_1, arg1_1; arg0_1 = args[0]; arg1_1 = args[1]; ... return buf0; } ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/90754 Approved by: https://github.com/jgong5, https://github.com/jansel
Author
Committer
Parents
Loading