Remove ignored options from quant_options

Rename quant.yaml to quantizer.yaml.
This commit is contained in:
Chris Lovett 2023-04-04 19:46:31 -07:00
Родитель 0b30fa121b
Коммит a2c7a89735
5 изменённых файлов: 15 добавлений и 15 удалений

Просмотреть файл

@ -82,7 +82,7 @@ RUN cd Olive && pip install -e .
RUN pip list
# This container starts running immediately so that the kubernetes cluster simply scales
# automatically based on how busy this script is (see HorizontalPodAutoscaler in quant.yaml).
# automatically based on how busy this script is (see HorizontalPodAutoscaler in quantizer.yaml).
COPY run.sh /home/archai/run.sh
RUN ls -al /home/archai
RUN cat run.sh

Просмотреть файл

@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: snpe-quantizer
image: snpecontainerregistry001.azurecr.io/quantizer:1.22
image: snpecontainerregistry001.azurecr.io/quantizer:1.23
resources:
limits:
cpu: 4

Просмотреть файл

@ -39,9 +39,9 @@ The `Setup.ps1` script shows what docker commands to run to build the image, how
azure docker container registry, how to take your image for that container registry and push it
to Azure. So you do not need to use the public docker.org container registry. You will decide
what version number to attach to your image here and the same version needs to be specified in the
following `quant.yaml`.
following `quantizer.yaml`.
## quant.yaml
## quantizer.yaml
Once the docker image is published you can configure your Azure Kubernetes cluster. First
you need to connect your local docker to this cloud service. The Azure Portal has a connect
@ -52,7 +52,7 @@ az aks get-credentials --resource-group snpe-quantizaton-rg --name snpe-quantize
```
Run that locally and then you can push docker images to this registry.
Then you can use `kubectl apply -f quant.yaml` to configure the AKS custer. Note that the version
Then you can use `kubectl apply -f quantizer.yaml` to configure the AKS custer. Note that the version
of the image to use is specified in this file so you may need to edit the file and change the
version `1.13` to whatever you just tagged and pushed to the azure container registry.

Просмотреть файл

@ -2,13 +2,15 @@
# also assumes you have run "az aks install-cli"
$resource_group = "snpe-quantizaton-rg"
$registry_name = "snpecontainerregistry001"
$storage_account_name = "nasfacemodels"
$plan_location = "westus2"
$aks_cluster = "snpe-quantizer-aks"
$aks_node_vm = "Standard_D16s_v3"
$aks_namespace = "snpe"
# This registry name is also referenced in quantizer.yaml
$registry_name = "snpecontainerregistry001"
function Check-Provisioning($result) {
$rc = Join-String -Separator "`n" -InputObject $rc
$x = ConvertFrom-Json $rc
@ -202,8 +204,8 @@ Write-Host " docker tag ... $registry_name.azurecr.io/quantizer:1.1"
Write-Host " docker push $registry_name.azurecr.io/quantizer:1.1"
Write-Host " az acr repository delete --name $registry_name --image <previous_version> -u $registry_name -p <get password>"
Write-Host ""
Write-Host "### Make sure the mtaching image version is mentioned in quant.yaml..."
Write-Host " kubectl apply -f quant.yaml"
Write-Host "### Make sure the mtaching image version is mentioned in quantizer.yaml..."
Write-Host " kubectl apply -f quantizer.yaml"
Write-Host ""
Write-Host "### To run the runner script locally please set the following environment variable: "

Просмотреть файл

@ -223,15 +223,13 @@ def quantize_model(model, onnx_model, snpe_model_dir):
if config is None:
return [None, "### SNPE Configuration file could not be loaded"]
# snpe_quantizer_config = SNPEQuantizationConfig(output_model, data_loader, **config["quantize_options"])
# assert snpe_quantizer_config.validate()
snpe_model = SNPEModel(model_path=full_dlc_path, name=basename, **config["io_config"])
quant_options = config['io_config']
quant_options["use_enhanced_quantizer"] = True
quant_options["data_dir"] = data_dir
quant_options["dataloader_func"] = create_quant_dataloader
quant_options = {
"use_enhanced_quantizer": True,
"data_dir": data_dir,
"dataloader_func": create_quant_dataloader
}
# tbd: what is "enable_htp": True
snpe_quantization = SNPEQuantization(quant_options, disable_search=True)