(self, args)
| 102 | ) |
| 103 | |
| 104 | def benchmark(self, args): |
| 105 | flush() |
| 106 | |
| 107 | print(f"[INFO] {self.pipe.__class__.__name__}: Running benchmark with: {vars(args)}\n") |
| 108 | |
| 109 | time = benchmark_fn(self.run_inference, self.pipe, args) # in seconds. |
| 110 | memory = bytes_to_giga_bytes(torch.cuda.max_memory_allocated()) # in GBs. |
| 111 | benchmark_info = BenchmarkInfo(time=time, memory=memory) |
| 112 | |
| 113 | pipeline_class_name = str(self.pipe.__class__.__name__) |
| 114 | flush() |
| 115 | csv_dict = generate_csv_dict( |
| 116 | pipeline_cls=pipeline_class_name, ckpt=args.ckpt, args=args, benchmark_info=benchmark_info |
| 117 | ) |
| 118 | filepath = self.get_result_filepath(args) |
| 119 | write_to_csv(filepath, csv_dict) |
| 120 | print(f"Logs written to: {filepath}") |
| 121 | flush() |
| 122 | |
| 123 | |
| 124 | class TurboTextToImageBenchmark(TextToImageBenchmark): |
nothing calls this directly
no test coverage detected