Skip to content

Commit 9deda13

Browse files
authored
Add FlagGems Integration Test
Runs multiple PyTorch Benchmark models to verify successful FlagGems injection and functionality, testing the models' eval accuracy on a CUDA device.
1 parent f701914 commit 9deda13

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: ci-temp-test-model
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
ci-temp-test-model:
11+
runs-on: self-hosted
12+
concurrency:
13+
group: ci-temp-test-model-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
steps:
16+
- name: Checkout accelerator-integration-wg
17+
uses: actions/checkout@v4
18+
19+
- name: Checkout flaggems
20+
uses: actions/checkout@v4
21+
with:
22+
repository: FlagOpen/FlagGems
23+
path: flag_gems
24+
25+
- name: Checkout benchmark
26+
uses: actions/checkout@v4
27+
with:
28+
repository: pytorch/benchmark
29+
path: benchmark
30+
31+
- name: Install and run benchmark
32+
shell: bash
33+
run: |
34+
# source tools/run_command.sh
35+
set -e
36+
source "/root/miniconda3/etc/profile.d/conda.sh"
37+
conda init bash
38+
conda activate new-torchbenchmark
39+
pip install -e flag_gems/
40+
sed -i '/self\.worker\.run("import torch")/a\ self.worker.run(\
41+
"""\
42+
import flag_gems\
43+
flag_gems.enable(record=False, once=True, path='"'"'benchmark/oplist.log'"'"')""")' benchmark/torchbenchmark/__init__.py
44+
python benchmark/install.py models BERT_pytorch dcgan fastNLP_Bert hf_Bert hf_GPT2 hf_T5 resnet50 pytorch_unet
45+
python benchmark/run_benchmark.py test_bench --accuracy --device cuda --test eval --output output.json --models BERT_pytorch,dcgan,fastNLP_Bert,hf_Bert,hf_GPT2,hf_T5,resnet50,pytorch_unet
46+
sed -i '/self\.worker\.run($/,/^[[:space:]]*flag_gems\.enable.*oplist\.log.*""")/d' benchmark/torchbenchmark/__init__.py

0 commit comments

Comments
 (0)