Skip to content

Conversation

@DimaBir
Copy link
Owner

@DimaBir DimaBir commented Oct 16, 2023

Description:

This pull request introduces several improvements to the inference benchmarking code. The primary changes include:

  • Updated the benchmarking function to handle batches of images instead of a single image.
  • Introduced throughput measurement alongside inference time.
  • Fixed issues related to TensorRT precision modes (FP16 and FP32).
  • Enhanced the plotting function to visualize both inference time and throughput.

Changes:

  1. Modified the TensorRTInference class to handle precision-specific input data.
  2. Updated the plot_benchmark_results function to display two side-by-side plots for inference time and throughput.
  3. Addressed various bugs and errors encountered during the benchmarking process.

plot_new_gpu

- Introduced object-oriented design for inference:
  - Created base inference class `InferenceBase`.
  - Derived classes for different inference modes: `ONNXInference`, `OVInference`, `PyTorchCPUInference`, `PyTorchCUDAInference`, and `TensorRTInference`.

- Integrated `ModelLoader` to handle model loading and caching:
  - Models are now loaded once and saved locally under the `common/model` directory.
  - Checks for the existence of the model locally before loading to avoid redundant loads.

- Enhanced benchmarking:
  - Integrated benchmarking logic into each inference class.
  - Added a `benchmark` method to each inference class to handle model-specific benchmarking.
  - Collected benchmark results for all models when `args.mode` is set to "all" and plotted the results using the `plot_benchmark_results` function.

- Updated `main.py`:
  - Integrated the new inference classes and their methods.
  - Modified argument parsing to support different inference modes and other options.
  - Added logic to collect and plot benchmark results for all models when `args.mode` is set to "all".

- Removed post-processing logic as prediction methods in inference classes now handle result printing.

- Updated file hierarchy to better organize the codebase and support the new classes.
@DimaBir DimaBir merged commit 2fd7dfe into master Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants