| 785 | } |
| 786 | |
| 787 | std::map<string, std::shared_ptr<Parameter>> Model::CollectEssentialParallelism( |
| 788 | std::shared_ptr<Node> node) { |
| 789 | // Parallelism parameter is considered to be essential if the coressponding |
| 790 | // transformations's processing time is greater than essential rate times the |
| 791 | // average transformation self processing time. |
| 792 | constexpr double kEssentialRate = 0.3L; |
| 793 | |
| 794 | std::map<string, std::shared_ptr<Parameter>> parameters; |
| 795 | node->CollectTunableParameters(¶meters); |
| 796 | std::map<string, double> processing_times; |
| 797 | double processing_time = node->TotalProcessingTime(&processing_times); |
| 798 | double uniform_share = |
| 799 | processing_time / static_cast<double>(processing_times.size()); |
| 800 | std::map<string, std::shared_ptr<Parameter>> essential_parameters; |
| 801 | for (auto& pair : parameters) { |
| 802 | if (pair.second->name == kParallelism && |
| 803 | processing_times[pair.first] > kEssentialRate * uniform_share) { |
| 804 | essential_parameters.insert(pair); |
| 805 | } |
| 806 | } |
| 807 | return essential_parameters; |
| 808 | } |
| 809 | |
| 810 | void Model::OptimizeGradientDescent(int64 cpu_budget, int64 ram_budget) { |
| 811 | std::shared_ptr<Node> snapshot; |
nothing calls this directly
no test coverage detected