-
Notifications
You must be signed in to change notification settings - Fork 2
Enhancements to Inference Benchmarking #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This pull request introduces several improvements to the inference benchmarking code. The primary changes include:
Changes:
TensorRTInferenceclass to handle precision-specific input data.plot_benchmark_resultsfunction to display two side-by-side plots for inference time and throughput.