diff --git a/onnxruntime/python/tools/tensorrt/perf/post.py b/onnxruntime/python/tools/tensorrt/perf/post.py index 0f5614bd51..363fa3a96d 100644 --- a/onnxruntime/python/tools/tensorrt/perf/post.py +++ b/onnxruntime/python/tools/tensorrt/perf/post.py @@ -56,6 +56,7 @@ def parse_arguments(): 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("--use_tensorrt_oss_parser", help="Use TensorRT OSS parser", required=False) parser.add_argument( "-d", "--commit_datetime", @@ -370,7 +371,7 @@ def write_table( ingest_client.ingest_from_dataframe(table, ingestion_properties=ingestion_props) -def get_identifier(commit_datetime, commit_hash, trt_version, branch): +def get_identifier(commit_datetime, commit_hash, trt_version, branch, use_tensorrt_oss_parser): """ Returns an identifier that associates uploaded data with an ORT commit/date/branch and a TensorRT version. @@ -383,7 +384,23 @@ def get_identifier(commit_datetime, commit_hash, trt_version, branch): """ date = str(commit_datetime.date()) # extract date only - return date + "_" + commit_hash + "_" + trt_version + "_" + branch + if use_tensorrt_oss_parser: + current_dir = os.path.dirname(os.path.abspath(__file__)) + root_dir = os.path.abspath(os.path.join(current_dir, "../../../../..")) + deps_txt_path = os.path.join(root_dir, "cmake", "deps.txt") + commit_head = "" + with open(deps_txt_path) as file: + for line in file: + parts = line.split(";") + if parts[0] == "onnx_tensorrt": + url = parts[1] + commit = url.split("/")[-1] + commit_head = commit[:6] + break + parser = f"oss_{commit_head}" + else: + parser = "builtin" + return "_".join([date, commit_hash, trt_version, parser, branch]) def main(): @@ -396,7 +413,9 @@ def main(): # connect to database 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) + identifier = get_identifier( + args.commit_datetime, args.commit_hash, args.trt_version, args.branch, args.use_tensorrt_oss_parser + ) upload_time = datetime.datetime.now(tz=datetime.timezone.utc).replace(microsecond=0) try: 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 eaadc6ad72..9f3a127262 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 @@ -76,6 +76,10 @@ jobs: - name: image value: ort-image-$(Build.BuildId) + + - name: parser + ${{ if eq(parameters.UseTensorrtOssParser, true) }}: + value: --use_tensorrt_oss_parser $(parameters.UseTensorrtOssParser) }} steps: - ${{ if and(eq(parameters.TrtVersion, 'BIN'), eq(parameters.UseTensorrtOssParser, false)) }}: @@ -155,7 +159,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 $(trtVersion) -b $(branchName) --kusto_conn $(kustoConn) --database $(database) + 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 $(trtVersion) -b $(branchName) --kusto_conn $(kustoConn) --database $(database) $(parser) - template: templates/component-governance-component-detection-steps.yml parameters :