| 86 | using json = nlohmann::json; |
| 87 | |
| 88 | json LoadTimeDataset() { |
| 89 | json j; |
| 90 | if (const char* c = std::getenv("ONEFLOW_REMAT_OP_TIME_DATASET")) { |
| 91 | std::ifstream i(c); |
| 92 | i >> j; |
| 93 | i.close(); |
| 94 | } |
| 95 | json new_j; |
| 96 | |
| 97 | for (json::iterator iter = j.begin(); iter != j.end(); ++iter) { |
| 98 | new_j[SortKey(iter.key())] = iter.value(); |
| 99 | } |
| 100 | return new_j; |
| 101 | } |
| 102 | |
| 103 | Maybe<double> GetDatasetComputeTime(const json& j, const vm::OpCallInstructionPolicy& operand) { |
| 104 | const std::vector<std::string> zero_time_list{ |