(program: paddle.pir.Program)
| 190 | |
| 191 | |
| 192 | def analysis_io(program: paddle.pir.Program): |
| 193 | # 1. don't support control flow now |
| 194 | # 2. each op is consider read all inputs and write all outputs once. |
| 195 | # 3. unit is "GByte" |
| 196 | total_io = 0.0 |
| 197 | for op in program.global_block().ops: |
| 198 | for operand in op.operands(): |
| 199 | value = operand.source() |
| 200 | total_io += get_memory(value) |
| 201 | |
| 202 | for value in op.results(): |
| 203 | total_io += get_memory(value) |
| 204 | |
| 205 | return total_io / 1024 / 1024 / 1024 |
| 206 | |
| 207 | |
| 208 | def append_activation_in_pir(input, act=None, use_cudnn=None): |
nothing calls this directly
no test coverage detected