-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
58 lines (50 loc) · 1.6 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
pr:
- main
pool:
vmImage: ubuntu-latest
variables:
PYTHON: 'python3.8'
INC_VER: '1.12'
IMAGE_NAME: 'neural-compressor'
IMAGE_TAG: '1.12'
INC_BRANCH: 'master'
stages:
- stage: Build
displayName: 'Build and push stage'
jobs:
- job: Build
displayName: 'Build'
steps:
- task: Docker@2
displayName: 'Login to repo'
inputs:
command: login
containerRegistry: inc-internal
- script: docker build --build-arg PYTHON=${PYTHON} --build-arg INC_BRANCH=${INC_BRANCH} -f docker/Dockerfile.devel -t ${IMAGE_NAME}:${IMAGE_TAG} .
displayName: 'Build Container'
- stage: Tuning
dependsOn: Build
displayName: Tuning Pytorch Model
jobs:
- job: Quantization
displayName: Run Tuning
steps:
- script:
pip install transformers==4.10.0
pip install -r neural-compressor/examples/pytorch/nlp/huggingface_models/text-classification/quantization/ptq_static/fx/requirements.txt
pip install torch
displayName: 'Install requirements'
- script:
python -u neural-compressor/examples/pytorch/nlp/huggingface_models/text-classification/quantization/ptq_static/fx/run_qa.py
--model_name_or_path "bert-large-uncased-whole-word-masking-finetuned-squad"
--dataset_name "squad"
--do_eval
--do_train
--max_seq_length 128
--per_device_eval_batch_size ${batch_size}
--no_cuda
--output_dir /path/to/checkpoint/dir
--tune
--overwrite_output_dir
--dataloader_drop_last
displayName: 'Tuning'