MLPerf Inference LoadGen python bindings
Project description
Overview {#mainpage}
Introduction
- The LoadGen is a reusable module that efficiently and fairly measures the performance of inference systems.
- It generates traffic for scenarios as formulated by a diverse set of experts in the MLCommons working group.
- The scenarios emulate the workloads seen in mobile devices, autonomous vehicles, robotics, and cloud-based setups.
- Although the LoadGen is not model or dataset aware, its strength is in its reusability with logic that is.
Integration Example and Flow
The following is an diagram of how the LoadGen can be integrated into an inference system, resembling how some of the MLPerf reference models are implemented.
- Benchmark knows the model, dataset, and preprocessing.
- Benchmark hands dataset sample IDs to LoadGen.
- LoadGen starts generating queries of sample IDs.
- Benchmark creates requests to backend.
- Result is post processed and forwarded to LoadGen.
- LoadGen outputs logs for analysis.
Useful Links
- FAQ
- LoadGen Build Instructions
- LoadGen API
- Test Settings - A good description of available scenarios, modes, and knobs.
- MLPerf Inference Code - Includes source for the LoadGen and reference models that use the LoadGen.
- MLPerf Inference Rules - Any mismatch with this is a bug in the LoadGen.
Scope of the LoadGen's Responsibilities
In Scope
- Provide a reusable C++ library with python bindings.
- Implement the traffic patterns of the MLPerf Inference scenarios and modes.
- Record all traffic generated and received for later analysis and verification.
- Summarize the results and whether performance constraints were met.
- Target high-performance systems with efficient multi-thread friendly logging utilities.
- Generate trust via a shared, well-tested, and community-hardened code base.
Out of Scope
The LoadGen is:
- NOT aware of the ML model it is running against.
- NOT aware of the data formats of the model's inputs and outputs.
- NOT aware of how to score the accuracy of a model's outputs.
- NOT aware of MLPerf rules regarding scenario-specific constraints.
Limitting the scope of the LoadGen in this way keeps it reusable across different models and datasets without modification. Using composition and dependency injection, the user can define their own model, datasets, and metrics.
Additionally, not hardcoding MLPerf-specific test constraints, like test duration and performance targets, allows users to use the LoadGen unmodified for custom testing and continuous integration purposes.
Submission Considerations
Upstream all local modifications
- As a rule, no local modifications to the LoadGen's C++ library are allowed for submission.
- Please upstream early and often to keep the playing field level.
Choose your TestSettings carefully!
- Since the LoadGen is oblivious to the model, it can't enforce the MLPerf requirements for submission. e.g.: target percentiles and latencies.
- For verification, the values in TestSettings are logged.
- To help make sure your settings are spec compliant, use TestSettings::FromConfig in conjunction with the relevant config file provided with the reference models.
Responsibilities of a LoadGen User
Implement the Interfaces
- Implement the SystemUnderTest and QuerySampleLibrary interfaces and pass them to the StartTest function.
- Call QuerySampleComplete for every sample received by SystemUnderTest::IssueQuery.
Assess Accuracy
- Process the mlperf_log_accuracy.json output by the LoadGen to determine the accuracy of your system.
- For the official models, Python scripts will be provided by the MLPerf model owners for you to do this automatically.
For templates of how to do the above in detail, refer to code for the demos, tests, and reference models.
LoadGen over the Network
For reference, on a high level a submission looks like this:
The LoadGen implementation is common to all submissions, while the QSL (“Query Sample Library”) and SUT (“System Under Test”) are implemented by submitters. QSL is responsible for loading the data and includes untimed preprocessing.
A submission over the network introduces a new component “QDL” (query dispatch library) that is added to the system as presented in the following diagram:
QDL is a proxy for a load-balancer, that dispatches queries to SUT over a physical network, receives the responses and passes them back to LoadGen. It is implemented by the submitter. The interface of the QDL is the same as the API to SUT.
In scenarios using QDL, data may be compressed in QSL at the choice of the submitter in order to reduce network transmission time. Decompression is part of the timed processing in SUT. A set of approved standard compression schemes will be specified for each benchmark; additional compression schemes must be approved in advance by the Working Group.
All communication between LoadGen/QSL and SUT is via QDL, and all communication between QDL and SUT must pass over a physical network.
QDL implements the protocol to transmit queries over the network and receive responses. It also implements decompression of any response returned by the SUT, where compression of responses is allowed. Performing any part of the timed preprocessing or inference in QDL is specifically disallowed. Currently no batching is allowed in QDL, although this may be revisited in future.
The MLperf over the Network will run in Server mode and Offline mode. All LoadGen modes are expected to work as is with insignificant changes. These include running the test in performance mode, accuracy mode, find peak performance mode and compliance mode. The same applies for power measurements.
QDL details
The Query Dispatch Library is implemented by the submitter and interfaces with LoadGen using the same SUT API. All MLPerf Inference SUTs implement the mlperf::SystemUnderTest
class which is defined in system_under_test.h. The QDL implements mlperf::QueryDispatchLibrary
class which inherits the mlperf::SystemUnderTest
class and has the same API and support all existing mlperf::SystemUnderTest
methods. It has a separate header file query_dispatch_library.h. Using sut with mlperf::SystemUnderTest
class in LoadGen StartTest is natively upcasting mlperf::QueryDispatchLibrary
class.
QDL Query issue and response over the network
The QDL gets the queries from the LoadGen through
void IssueQuery(const std::vector<QuerySample>& samples)
The QDL dispatches the queries to the SUT over the physical media. The exact method and implementation for it are submitter specific and would not be specified at MLCommons. Submitter implementation includes all methods required to serialize the query, load balance, drive it to the Operating system and network interface card and send to the SUT.
The QDL receives the query responses over the network from the SUT. The exact method and implementation for it are submitter specific and would not be specified at MLCommons. The submitter implementation includes all methods required to receive the network data from the Network Interface card, go through the Operating system, deserialize the query response, and provide it back to the LoadGen through query completion by:
struct QuerySampleResponse {
ResponseId id;
uintptr_t data;
size_t size;
};
void QuerySamplesComplete(QuerySampleResponse* responses,
size_t response_count);
QDL Additional Methods
In addition to that the QDL needs to implement the following methods that are provided by the SUT interface to the LoadGen:
const std::string& Name();
The Name
function returns a known string for over the Network SUTs to identify it as over the network benchmark.
void FlushQueries();
It is not specified here how the QDL would query and configure the SUT to execute the above methods. The QDL responds to the LoadGen after receiving its own response from the SUT.
Example
Refer to LON demo for a reference example illustrating usage of Loadgen over the network.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for mlcommons_loadgen-4.1.2-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a329a7f5db41128fd8a14e4c0f200fc8b8be1dcfccf33d8b16740d488c16a23 |
|
MD5 | 04b8f764d5589c4da0a4e1bb4cb6eeb4 |
|
BLAKE2b-256 | a55b82616a51bebbaadb6f2668306f26716e3857c704641b07f4a12e2d6b046f |
Hashes for mlcommons_loadgen-4.1.2-cp313-cp313-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5db49420ea42aa0d4003ac073ad75fdd4fbf7fac1aacb3c7afc2ebfa7b555941 |
|
MD5 | be4c8ab3c343b02c6b81551c6b5ef08a |
|
BLAKE2b-256 | 77beb7c29a9a0e8310efa1e473d1da6e2f7733fc1242f6180ac57296f51eeba1 |
Hashes for mlcommons_loadgen-4.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 606d8b4cb57113657cfd65738866ba4f6ac43290c8883eea51d647234c4701d9 |
|
MD5 | bb08b8b5b4de15cb623417c0af336760 |
|
BLAKE2b-256 | b6368a9e88c5a50388813e761fb3341610b7bc8e343b30057483410099e8d55c |
Hashes for mlcommons_loadgen-4.1.2-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2053d3bf393d0b340b2a4dba026bbc2bcdd86338a4f2ec0ee95150aa996fab9 |
|
MD5 | 62ef9cb209c3c50991dfdb64d351eead |
|
BLAKE2b-256 | 51a8b5ba15df1a02387f1c834d0655c61f8072c12b2d09e87d1c4be48ab53a18 |
Hashes for mlcommons_loadgen-4.1.2-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1095f82afd4b8b70c919df0c1ff20db1c66f560b0ac8f4f971d7f8d21fb38dc9 |
|
MD5 | 83b568c9939ea213750e2e8108303ef4 |
|
BLAKE2b-256 | f0f8c18b438f199d85e3ef9df6b97f25434a7442175f35fcba51c1f46f2e9399 |
Hashes for mlcommons_loadgen-4.1.2-cp312-cp312-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 771e23f463e6032338404a78050ee219b08f9461c8a41e3e7a3c6b136404467d |
|
MD5 | 35ff1d42bc8f3a491fdcd6515ba94bb9 |
|
BLAKE2b-256 | 1630bef27f4185bce938591dcea32c6114060263060e61732017b3b86e40d214 |
Hashes for mlcommons_loadgen-4.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de3d8c47a4b3abc2e67da45a38c820c049e47baeb199ebf28e9088958de708d9 |
|
MD5 | 65405023855350c85f81a3a77aa401b5 |
|
BLAKE2b-256 | e075433dbead949280c4c4a42ab21fb6bdc3343c25ff5e673897355589b68bfb |
Hashes for mlcommons_loadgen-4.1.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 377b7e33f8b2c50d1c00c6721268b500385f4634c18cce94a004684d391e8e21 |
|
MD5 | d1956aa74b44fe715663531da6719a7d |
|
BLAKE2b-256 | f5fb9dec4f7cf6f53a0f680f6299c6819594f8e1910217d83d34f4e8b4723623 |
Hashes for mlcommons_loadgen-4.1.2-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0e4674ab58ad9426caf720bd852921c27e26c30b0423b68bf375f5165182b95 |
|
MD5 | 517e6960ebf8b2734d51fdea1abe86a0 |
|
BLAKE2b-256 | 734b8ce9dda956223f40c66a0bc047259b120aa2fa5ac282d29e5e29be1976e5 |
Hashes for mlcommons_loadgen-4.1.2-cp311-cp311-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a408f111a5b4ff657755cf2e3bf377364b1db738811d8603b37c0e6fe7dbf903 |
|
MD5 | 6e411f916fed9fc32a05624d4aedfa69 |
|
BLAKE2b-256 | 242bc94ec8132e26e82fac30bd3715d6c7d6704dc0ea8820f1eb0f225bb64090 |
Hashes for mlcommons_loadgen-4.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80fb48aaea4c6998587455531c0cbf1aa7050a82270a6287a9aa11ebf8d7070d |
|
MD5 | 9639e33029f53c52eb9b57a4267c115d |
|
BLAKE2b-256 | 2bf82111038030e2c3f16c089953ee56c306d8a26d654057402e633daf7b7f46 |
Hashes for mlcommons_loadgen-4.1.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81043b180b21f3736ccf3d31d3f8b23b6e20dc71147f3aac485a4d3e659b1b86 |
|
MD5 | a1d4e943dfb8ddee08b11641fbbfac03 |
|
BLAKE2b-256 | 0b51dd477d61b2a714ffd78a572ddbdeedbfc791218ddb6152108bc1b9e603d3 |
Hashes for mlcommons_loadgen-4.1.2-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 615f0a4a454c0fb43d6caeb0b89158dbfaaf1a6dfd5da09809db6b36b007e2f5 |
|
MD5 | b0b9a6c4baf9caaa6f3d3e2a4ead2488 |
|
BLAKE2b-256 | 05a9c6e068037f7db052703b821dd31d2efb3f8ba9042509bc68bab04db7273a |
Hashes for mlcommons_loadgen-4.1.2-cp310-cp310-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fd05e639b7593b9b5ec6f85e031b3ef6e7149393526557bf5444711bb41926e |
|
MD5 | 29a979e48b7d67f70aa309152350d8bb |
|
BLAKE2b-256 | ec226f1a75769a0c07882defd17c9aa2b1f2c1d17a03124c025d788f304fe255 |
Hashes for mlcommons_loadgen-4.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45be0b11b96e67e1238ae98fd303e275c2c60f03a2334f14a8278cbb6f893e5e |
|
MD5 | e352f7ccbe01737f3cf653802d9045db |
|
BLAKE2b-256 | 1f886f22e718da10121f6e3e74f05145d393799cd7cee54ca339a8c767f5f286 |
Hashes for mlcommons_loadgen-4.1.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20ff8ac4f7ed57645d7aed1ad3c9e6834d643a660d6777b5e52873d57115c562 |
|
MD5 | 77266009d92f6d0323ef15b77bf72c33 |
|
BLAKE2b-256 | 64aa9cf10f3e4b33b570af5ad1edef53fe80035201feee640711c1377f0649ad |
Hashes for mlcommons_loadgen-4.1.2-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 642e2618335c83ff4b15cc24ae4235f8b960440b11a6b9cc2095907af2295eb9 |
|
MD5 | 0d339d830466f7b8f3ec26cc95623744 |
|
BLAKE2b-256 | 4b93e705d22eb9ba051449debaf0bca57e368010d36669cf0b002eb11a20d356 |
Hashes for mlcommons_loadgen-4.1.2-cp39-cp39-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 937ae1d46eb7da700bb808ad95b4f4c722767ffd88eeb61e5befaf227c4598f3 |
|
MD5 | 7ca4a82caa6a447c6df133853297a880 |
|
BLAKE2b-256 | 18c26da1cff2e8deafe0ca1a0c6c01c8a83ba74aba5b68b07536c2ebe43a5e8f |
Hashes for mlcommons_loadgen-4.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab22da08b374f3d4349d05187269a29e330addc6e260e2205dcecca1e1d32c5f |
|
MD5 | f637272750c64167de8503f27d713dc0 |
|
BLAKE2b-256 | bbfdc671ecdddf296b4dcf2e154b7be8a87074bf7239d91712ccb2f74bf349a5 |
Hashes for mlcommons_loadgen-4.1.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78596f5cfe10111e5931912814ddfc655f29dac491931d439dedfb6bc4fb6bab |
|
MD5 | a679a3240520ec281769e329b79330c2 |
|
BLAKE2b-256 | 5882f4b85181aac3be6d272771333193b44db421475bdb37c23ff1f8ca5c18c9 |
Hashes for mlcommons_loadgen-4.1.2-cp38-cp38-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 391eaa5a9f60c776da179532af54f0fa68b4be94a05e8716613e632f79c49f13 |
|
MD5 | 0930cdcb736082e9c7f21bb21a206613 |
|
BLAKE2b-256 | 5b8703ee3801fe74783b8a059f1d6ba2aa5eb11374d6205b71d775a1665baf35 |
Hashes for mlcommons_loadgen-4.1.2-cp38-cp38-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a3495acde082a9b79bc558a35705e21f14f101e4c85c8aa5e6ffef369c2295c |
|
MD5 | 7fee862229d08e998bb7c93f4e02595a |
|
BLAKE2b-256 | ba812d119de1599a6e1d0767062ecd027d11816d083e97474e04cbd7ff0a669d |
Hashes for mlcommons_loadgen-4.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5744da66573154517e33235c83378d559dea66a665cd4a01a53f8036bd5eb4a |
|
MD5 | 04e2dbcec9f0d7a4d68338d3ad26dcc8 |
|
BLAKE2b-256 | d9628bb7346d92089196b2d19c64dc57f8ddfe7505772bc12730635363628d37 |
Hashes for mlcommons_loadgen-4.1.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 350e6f6dc3b84913827497161bc87b06bafc1212b08e78958de3aeb436986c66 |
|
MD5 | 2fa8cb098499b0d9602147704131f847 |
|
BLAKE2b-256 | ac820e20c03e2beab58119a55f7628b68b15fda751f323c637e246e0aa19a978 |
Hashes for mlcommons_loadgen-4.1.2-cp37-cp37m-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 823bd6206dfe2f179ff81dd2d177c9f58adb0203a5cbd60e8c6b4f35b5d1f89f |
|
MD5 | 6727ad2f96e919aadc81c78df405bc6e |
|
BLAKE2b-256 | 21482781b1b1907d23bd0eb39cdf8f6ddb15d9fcb4798adee2bd70183485ee58 |
Hashes for mlcommons_loadgen-4.1.2-cp37-cp37m-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6856e1529b5090fd3e9e9cec3a2a1a6175043ae38478af3b9c73796670af0b9b |
|
MD5 | 560eef6f5de43ad42e1970726c2a3874 |
|
BLAKE2b-256 | 08c314658c85904b3adca69091d42cc199eb1317c5e635b07d50d6fd0cb233be |
Hashes for mlcommons_loadgen-4.1.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9b5985419394c1f1c2cc04d50aa68ff76338bdc4252169946c2dcce5b7bac96 |
|
MD5 | be063895d8bb3154457f55f0ad851dc2 |
|
BLAKE2b-256 | 37c67e7af56c8dea170eb2c18b55826179d3f36bb67a098dbc42ed66f08b03f4 |
Hashes for mlcommons_loadgen-4.1.2-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30bffae7c465a41192a46f237e45d65829a5925b347bda7326ad02c2c61eedfe |
|
MD5 | a9b9547675bd63930b3c83d47e132e62 |
|
BLAKE2b-256 | 7d2d0bf150e1d4e19b304966c24ba3a20dfa5976b70b38bfca0f17e669742354 |