(self, args)
| 164 | ) |
| 165 | |
| 166 | def benchmark(self, args): |
| 167 | flush() |
| 168 | |
| 169 | print(f"[INFO] {self.pipe.__class__.__name__}: Running benchmark with: {vars(args)}\n") |
| 170 | |
| 171 | time = benchmark_fn(self.run_inference, self.pipe, args) # in seconds. |
| 172 | memory = bytes_to_giga_bytes(torch.cuda.max_memory_allocated()) # in GBs. |
| 173 | benchmark_info = BenchmarkInfo(time=time, memory=memory) |
| 174 | |
| 175 | pipeline_class_name = str(self.pipe.__class__.__name__) |
| 176 | flush() |
| 177 | csv_dict = generate_csv_dict( |
| 178 | pipeline_cls=pipeline_class_name, ckpt=self.lora_id, args=args, benchmark_info=benchmark_info |
| 179 | ) |
| 180 | filepath = self.get_result_filepath(args) |
| 181 | write_to_csv(filepath, csv_dict) |
| 182 | print(f"Logs written to: {filepath}") |
| 183 | flush() |
| 184 | |
| 185 | |
| 186 | class ImageToImageBenchmark(TextToImageBenchmark): |
nothing calls this directly
no test coverage detected