Skip to content

Commit e301562

Browse files
authored
Merge pull request #3189 from NVIDIA/release/8.6
Merge release/8.6 to main
2 parents ba459b4 + a167852 commit e301562

File tree

6 files changed

+1434
-4
lines changed

6 files changed

+1434
-4
lines changed

.github/workflows/blossom-ci.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# A workflow to trigger ci on hybrid infra (github + self hosted runner)
16+
name: Blossom-CI
17+
on:
18+
issue_comment:
19+
types: [created]
20+
workflow_dispatch:
21+
inputs:
22+
platform:
23+
description: 'runs-on argument'
24+
required: false
25+
args:
26+
description: 'argument'
27+
required: false
28+
jobs:
29+
Authorization:
30+
name: Authorization
31+
runs-on: blossom
32+
outputs:
33+
args: ${{ env.args }}
34+
35+
# This job only runs for pull request comments
36+
if: |
37+
contains( 'rajeevsrao,kevinch-nv,ttyio,samurdhikaru,zerollzeng,nvpohanh', format('{0},', github.actor)) &&
38+
github.event.comment.body == '/blossom-ci'
39+
steps:
40+
- name: Check if comment is issued by authorized person
41+
run: blossom-ci
42+
env:
43+
OPERATION: 'AUTH'
44+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
46+
47+
Vulnerability-scan:
48+
name: Vulnerability scan
49+
needs: [Authorization]
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Checkout code
53+
uses: actions/checkout@v2
54+
with:
55+
repository: ${{ fromJson(needs.Authorization.outputs.args).repo }}
56+
ref: ${{ fromJson(needs.Authorization.outputs.args).ref }}
57+
lfs: 'true'
58+
59+
# repo specific steps
60+
#- name: Setup java
61+
# uses: actions/setup-java@v1
62+
# with:
63+
# java-version: 1.8
64+
65+
# add blackduck properties https://synopsys.atlassian.net/wiki/spaces/INTDOCS/pages/631308372/Methods+for+Configuring+Analysis#Using-a-configuration-file
66+
#- name: Setup blackduck properties
67+
# run: |
68+
# PROJECTS=$(mvn -am dependency:tree | grep maven-dependency-plugin | awk '{ out="com.nvidia:"$(NF-1);print out }' | grep rapids | xargs | sed -e 's/ /,/g')
69+
# echo detect.maven.build.command="-pl=$PROJECTS -am" >> application.properties
70+
# echo detect.maven.included.scopes=compile >> application.properties
71+
72+
- name: Run blossom action
73+
uses: NVIDIA/blossom-action@main
74+
env:
75+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
77+
with:
78+
args1: ${{ fromJson(needs.Authorization.outputs.args).args1 }}
79+
args2: ${{ fromJson(needs.Authorization.outputs.args).args2 }}
80+
args3: ${{ fromJson(needs.Authorization.outputs.args).args3 }}
81+
82+
Job-trigger:
83+
name: Start ci job
84+
needs: [Vulnerability-scan]
85+
runs-on: blossom
86+
steps:
87+
- name: Start ci job
88+
run: blossom-ci
89+
env:
90+
OPERATION: 'START-CI-JOB'
91+
CI_SERVER: ${{ secrets.CI_SERVER }}
92+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
94+
Upload-Log:
95+
name: Upload log
96+
runs-on: blossom
97+
if : github.event_name == 'workflow_dispatch'
98+
steps:
99+
- name: Jenkins log for pull request ${{ fromJson(github.event.inputs.args).pr }} (click here)
100+
run: blossom-ci
101+
env:
102+
OPERATION: 'POST-PROCESSING'
103+
CI_SERVER: ${{ secrets.CI_SERVER }}
104+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

demo/Diffusion/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ diffusers 0.14.0
4848
onnx 1.13.1
4949
onnx-graphsurgeon 0.3.26
5050
onnxruntime 1.14.1
51-
polygraphy 0.44.2
52-
tensorrt 8.6.0.10
51+
polygraphy 0.47.1
52+
tensorrt 8.6.1.6
5353
tokenizers 0.13.2
5454
torch 1.13.0
5555
transformers 4.26.1

demo/Diffusion/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ onnx==1.13.1
99
onnxruntime==1.14.1
1010
--extra-index-url https://pypi.ngc.nvidia.com
1111
onnx-graphsurgeon==0.3.26
12-
polygraphy==0.44.2
12+
polygraphy==0.47.1
1313
scipy
1414
torch<2.0.0
1515
transformers==4.26.1

demo/Diffusion/utilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def build(self, onnx_path, fp16, input_profile=None, enable_refit=False, enable_
210210
config_kwargs['tactic_sources'] = []
211211

212212
engine = engine_from_network(
213-
network_from_onnx_path(onnx_path),
213+
network_from_onnx_path(onnx_path, flags=[trt.OnnxParserFlag.NATIVE_INSTANCENORM]),
214214
config=CreateConfig(fp16=fp16,
215215
refittable=enable_refit,
216216
profiles=[p],
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Introduction
2+
3+
This demo notebook showcases the acceleration of Stable Diffusion pipeline using TensorRT through HuggingFace pipelines.
4+
5+
# Setup
6+
7+
### Clone the TensorRT OSS repository
8+
9+
```bash
10+
git clone [email protected]:NVIDIA/TensorRT.git -b release/8.6 --single-branch
11+
cd TensorRT/demo/experimental/HuggingFace-Diffusers
12+
```
13+
14+
### Launch TensorRT NGC container
15+
16+
Install nvidia-docker using [these intructions](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker). Launch the docker container with the following command:
17+
18+
```bash
19+
docker run --rm -it --gpus all -p 8888:8888 -v $PWD:/workspace nvcr.io/nvidia/tensorrt:23.04-py3 /bin/bash
20+
```
21+
22+
### Run Jupyter Notebook
23+
24+
Install `jupyter` with:
25+
26+
```bash
27+
pip install jupyter
28+
```
29+
30+
Launch the notebook within the container with:
31+
32+
```bash
33+
jupyter notebook --ip 0.0.0.0 TensorRT-diffusers-txt2img.ipynb --allow-root --no-browser
34+
```
35+
36+
Follow the console output for the link to run the notebook on your host machine.

0 commit comments

Comments
 (0)