From aef53e2b0d168d714cb49ab48db221f7edb5b62c Mon Sep 17 00:00:00 2001 From: Adrian Lizarraga Date: Mon, 13 Jun 2022 14:06:50 -0700 Subject: [PATCH] Support uploading EP perf data to a configurable database. (#11819) --- onnxruntime/python/tools/tensorrt/perf/post.py | 13 ++++++------- .../linux-gpu-tensorrt-daily-perf-pipeline.yml | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/onnxruntime/python/tools/tensorrt/perf/post.py b/onnxruntime/python/tools/tensorrt/perf/post.py index 312409e822..7766fe8312 100644 --- a/onnxruntime/python/tools/tensorrt/perf/post.py +++ b/onnxruntime/python/tools/tensorrt/perf/post.py @@ -36,10 +36,6 @@ from perf_utils import ( trt_fp16, ) -# database connection strings -CLUSTER_INGEST = "https://ingest-onnxruntimedashboarddb.southcentralus.kusto.windows.net" -DATABASE_NAME = "ep_perf_dashboard" - def parse_arguments(): """ @@ -54,6 +50,8 @@ def parse_arguments(): parser.add_argument("-u", "--report_url", help="Report Url", required=True) parser.add_argument("-t", "--trt_version", help="Tensorrt Version", required=True) parser.add_argument("-b", "--branch", help="Branch", required=True) + parser.add_argument("--kusto_conn", help="Kusto connection URL", required=True) + parser.add_argument("--database", help="Database name", required=True) parser.add_argument( "-d", "--commit_datetime", @@ -234,7 +232,7 @@ def get_session(session, model_group): return session -def write_table(ingest_client, table, table_name, upload_time, identifier): +def write_table(ingest_client, database_name, table, table_name, upload_time, identifier): """ Uploads the provided table to the database. This function also appends the upload time and unique run identifier to the table. @@ -253,7 +251,7 @@ def write_table(ingest_client, table, table_name, upload_time, identifier): table = table.assign(UploadTime=str(upload_time)) table = table.assign(Identifier=identifier) ingestion_props = IngestionProperties( - database=DATABASE_NAME, + database=database_name, table=table_name, data_format=DataFormat.CSV, report_level=ReportLevel.FailuresAndSuccesses, @@ -286,7 +284,7 @@ def main(): args = parse_arguments() # connect to database - kcsb_ingest = KustoConnectionStringBuilder.with_az_cli_authentication(CLUSTER_INGEST) + kcsb_ingest = KustoConnectionStringBuilder.with_az_cli_authentication(args.kusto_conn) ingest_client = QueuedIngestClient(kcsb_ingest) identifier = get_identifier(args.commit_datetime, args.commit_hash, args.trt_version, args.branch) upload_time = datetime.datetime.now(tz=datetime.timezone.utc).replace(microsecond=0) @@ -355,6 +353,7 @@ def main(): db_table_name = "ep_model_" + table write_table( ingest_client, + args.database, table_results[table], db_table_name, upload_time, diff --git a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml index 6912684923..276b2724e3 100644 --- a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml @@ -182,7 +182,7 @@ jobs: inlineScript: | short_hash=$(git rev-parse --short HEAD) && commit_date=$(git log -1 --date=iso-strict --pretty=format:%cd) && - python3 $(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/post.py -r $(Build.SourcesDirectory)/Artifact/result -c $short_hash -d $commit_date -u "$(reportUrl)?buildId=$(Build.BuildId)" -t ${{ parameters.TrtVersion }} -b $(branch) + python3 $(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/post.py -r $(Build.SourcesDirectory)/Artifact/result -c $short_hash -d $commit_date -u "$(reportUrl)?buildId=$(Build.BuildId)" -t ${{ parameters.TrtVersion }} -b $(branch) --kusto_conn $(kustoConn) --database $(database) - template: templates/component-governance-component-detection-steps.yml parameters :