-
Notifications
You must be signed in to change notification settings - Fork 54
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
How to use optimum-benchmark for custom testing of my model #116
Comments
optimum-benchmark was built for cli usage, but using it as an api should be possible (I'm currently working on a refactorization for that). right now some features are easier to use than others (like trackers and generators). |
@WCSY-YG I just discovered that IPEX is being integrated directly in If it's not exactly what you're looking for, once #118 is merged, you'll be able to do things like creating your own custom backend by subclassing backend_config = IPEXBackendConfig(model="gpt2", no_weights=True)
launcher_config = ProcessConfig(device_isolation=True)
benchmark_config = InferenceConfig(memory=True)
experiment_config = ExperimentConfig(
experiment_name="ipex-experiment",
benchmark=benchmark_config,
launcher=launcher_config,
backend=backend_config,
)
report = launch(experiment_config) You can also patch a backend with your custom model, for example: backend_config = PyTorchConfig(model="gpt2", no_weights=True, device="cuda")
backend = PytorchBackend(backend_config)
backend.pretrained_model = your_custom_gpt2_like_model
benchmark.run(backend) but this solution can't use the launchers feature, as the backend need to be created in an isolated process. |
thankyou |
I am currently using Intel® Extension for Transformers to quantize a model, and I wonder if it is possible to utilize optimum-benchmark for testing the model. Alternatively, if there are other methods to load large models, could I conduct tests using optimum-benchmark after loading the model? Many thanks; this has been a real challenge for me, as I'm unsure how to properly test an optimized large-scale model.
The text was updated successfully, but these errors were encountered: