| 78 | } |
| 79 | |
| 80 | static PyObject *eager_api_run_program(PyObject *self, |
| 81 | PyObject *args, |
| 82 | PyObject *kwargs) { |
| 83 | PyThreadState *tstate = nullptr; |
| 84 | try { |
| 85 | auto X_info = GetPyArgumentInfo("run_program", "X", args, 0, true); |
| 86 | TensorListBufferAllocator X_allocator(X_info.second); |
| 87 | auto &X = GetTensorListFromArgsWithBuffer("run_program", |
| 88 | "X", |
| 89 | 0, |
| 90 | nullptr, |
| 91 | X_info.first, |
| 92 | X_info.second, |
| 93 | X_allocator); |
| 94 | |
| 95 | auto Params_info = |
| 96 | GetPyArgumentInfo("run_program", "Params", args, 1, true); |
| 97 | TensorListBufferAllocator Params_allocator(Params_info.second); |
| 98 | auto &Params = GetTensorListFromArgsWithBuffer("run_program", |
| 99 | "Params", |
| 100 | 0, |
| 101 | nullptr, |
| 102 | Params_info.first, |
| 103 | Params_info.second, |
| 104 | Params_allocator); |
| 105 | |
| 106 | auto OutScope = |
| 107 | GetScopePtrListFromArgs("run_program", "OutScope", args, 2, false); |
| 108 | const phi::distributed::ProcessMesh *mesh = nullptr; |
| 109 | if (InputsContainDistTensor(&mesh, X, Params)) { |
| 110 | X = GetTensorListFromArgsWithBuffer("run_program", |
| 111 | "X", |
| 112 | 0, |
| 113 | nullptr, |
| 114 | X_info.first, |
| 115 | X_info.second, |
| 116 | X_allocator); |
| 117 | Params = GetTensorListFromArgsWithBuffer("run_program", |
| 118 | "Params", |
| 119 | 0, |
| 120 | nullptr, |
| 121 | Params_info.first, |
| 122 | Params_info.second, |
| 123 | Params_allocator); |
| 124 | } |
| 125 | VLOG(6) << "Start PIR GetProgramAttributesMapPtrFromPyArgs"; |
| 126 | auto prog_attrs_ptr = |
| 127 | GetProgramAttributesMapPtrFromPyArgs("run_program", args, 3); |
| 128 | VLOG(6) << "Finish PIR GetProgramAttributesMapPtrFromPyArgs"; |
| 129 | |
| 130 | VLOG(6) << "Start PIR ConstructCudaGraphAttrMapForRunProgram"; |
| 131 | paddle::framework::AttributeMap cuda_graph_attrs; |
| 132 | ConstructCudaGraphAttrMapForRunProgram( |
| 133 | "run_program", args, 4, cuda_graph_attrs); |
| 134 | VLOG(6) << "Finish PIR ConstructCudaGraphAttrMapForRunProgram"; |
| 135 | tstate = PyEval_SaveThread(); |
| 136 | auto out = egr::to_static::run_program_ad_func( |
| 137 | X, Params, OutScope, *prog_attrs_ptr, cuda_graph_attrs); |
nothing calls this directly
no test coverage detected