Skip to content

Commit

Permalink
Remove levit model from ptq conformance tests (#3200)
Browse files Browse the repository at this point in the history
### Changes

- Remove levit model_128 
- Fix: no catching exception without message
 
### Reason for changes

```
  File "/home/jenkins/agent/workspace/NNCF/manual/Daemons/PTQ/ptq_single_model/venv/lib/python3.10/site-packages/timm/models/_builder.py", line 393, in build_model_with_cfg
    load_pretrained(
  File "/home/jenkins/agent/workspace/NNCF/manual/Daemons/PTQ/ptq_single_model/venv/lib/python3.10/site-packages/timm/models/_builder.py", line 193, in load_pretrained
    state_dict = filter_fn(state_dict, model)
  File "/home/jenkins/agent/workspace/NNCF/manual/Daemons/PTQ/ptq_single_model/venv/lib/python3.10/site-packages/timm/models/levit.py", line 707, in checkpoint_filter_fn
    assert 'head' in ka or 'stem.conv1.linear' in ka
AssertionError

```
  • Loading branch information
AlexanderDokuchaev authored Jan 22, 2025
1 parent 62ce790 commit bfac8cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
10 changes: 0 additions & 10 deletions tests/post_training/data/ptq_reference_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,6 @@ timm/inception_resnet_v2_backend_OV:
metric_value: 0.80422
timm/inception_resnet_v2_backend_TORCH:
metric_value: 0.80334
timm/levit_128_backend_CUDA_TORCH:
metric_value: 0.77812
timm/levit_128_backend_FP32:
metric_value: 0.78474
timm/levit_128_backend_ONNX:
metric_value: 0.7762
timm/levit_128_backend_OV:
metric_value: 0.77644
timm/levit_128_backend_TORCH:
metric_value: 0.77814
timm/mobilenetv2_050_BC_backend_FP32:
metric_value: 0.6594
timm/mobilenetv2_050_BC_backend_ONNX:
Expand Down
13 changes: 0 additions & 13 deletions tests/post_training/model_scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,19 +229,6 @@
"backends": NNCF_PTQ_BACKENDS,
"batch_size": 64,
},
{
"reported_name": "timm/levit_128",
"model_id": "levit_128",
"pipeline_cls": ImageClassificationTimm,
"compression_params": {
"preset": QuantizationPreset.MIXED,
"model_type": ModelType.TRANSFORMER,
"advanced_parameters": AdvancedQuantizationParameters(
smooth_quant_alphas=AdvancedSmoothQuantParameters(matmul=0.05)
),
},
"backends": NNCF_PTQ_BACKENDS,
},
{
"reported_name": "timm/mobilenetv2_050",
"model_id": "mobilenetv2_050",
Expand Down
4 changes: 4 additions & 0 deletions tests/post_training/test_quantize_conformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ def test_ptq_quantization(
pipeline.run()
except Exception as e:
err_msg = str(e)
if not err_msg:
err_msg = "Unknown exception"
traceback.print_exc()

if pipeline is not None:
Expand Down Expand Up @@ -380,6 +382,8 @@ def test_weight_compression(
pipeline.run()
except Exception as e:
err_msg = str(e)
if not err_msg:
err_msg = "Unknown exception"
traceback.print_exc()

if pipeline is not None:
Expand Down

0 comments on commit bfac8cf

Please sign in to comment.