Skip to content

Commit

Permalink
[Torch Fx] Add test for quantized model graph (#2860)
Browse files Browse the repository at this point in the history
### Changes

Added a test in tests/torch/fx/test_models.py to include a test for
quantized graph which compares the quantized graph with a reference
quantized graph.

### Reason for changes

To check if the graph was quantized correctly

### Ticket
#2766 

### Tests

test_quantized_model() was added in tests/torch/fx/test_models.py
  • Loading branch information
anzr299 authored Aug 5, 2024
1 parent 587374f commit 63fcb15
Show file tree
Hide file tree
Showing 6 changed files with 2,751 additions and 1 deletion.
1,116 changes: 1,116 additions & 0 deletions tests/torch/data/reference_graphs/fx/quantized/mobilenet_v3_small.dot

Large diffs are not rendered by default.

539 changes: 539 additions & 0 deletions tests/torch/data/reference_graphs/fx/quantized/resnet18.dot

Large diffs are not rendered by default.

521 changes: 521 additions & 0 deletions tests/torch/data/reference_graphs/fx/quantized/unet.dot

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"arg0_1": "input_noop", "_param_constant0": "const_noop", "_param_constant1": "const_noop", "conv2d": "Conv2DOp", "empty": "unknown", "_param_constant2": "const_noop", "_param_constant3": "const_noop", "_tensor_constant0": "const_noop", "_tensor_constant1": "const_noop", "_native_batch_norm_legit_no_training": "BatchNormOp", "getitem": "GatherOp", "getitem_1": "GatherOp", "getitem_2": "GatherOp", "relu": "ReluOp", "_param_constant4": "const_noop", "_param_constant5": "const_noop", "conv2d_1": "Conv2DOp", "empty_1": "unknown", "_param_constant6": "const_noop", "_param_constant7": "const_noop", "_tensor_constant2": "const_noop", "_tensor_constant3": "const_noop", "_native_batch_norm_legit_no_training_1": "BatchNormOp", "getitem_3": "GatherOp", "getitem_4": "GatherOp", "getitem_5": "GatherOp", "relu_1": "ReluOp", "max_pool2d": "MaxPool2DOp", "_param_constant8": "const_noop", "_param_constant9": "const_noop", "conv2d_2": "Conv2DOp", "empty_2": "unknown", "_param_constant10": "const_noop", "_param_constant11": "const_noop", "_tensor_constant4": "const_noop", "_tensor_constant5": "const_noop", "_native_batch_norm_legit_no_training_2": "BatchNormOp", "getitem_6": "GatherOp", "getitem_7": "GatherOp", "getitem_8": "GatherOp", "relu_2": "ReluOp", "_param_constant12": "const_noop", "_param_constant13": "const_noop", "conv2d_3": "Conv2DOp", "empty_3": "unknown", "_param_constant14": "const_noop", "_param_constant15": "const_noop", "_tensor_constant6": "const_noop", "_tensor_constant7": "const_noop", "_native_batch_norm_legit_no_training_3": "BatchNormOp", "getitem_9": "GatherOp", "getitem_10": "GatherOp", "getitem_11": "GatherOp", "relu_3": "ReluOp", "max_pool2d_1": "MaxPool2DOp", "_param_constant16": "const_noop", "_param_constant17": "const_noop", "conv2d_4": "Conv2DOp", "empty_4": "unknown", "_param_constant18": "const_noop", "_param_constant19": "const_noop", "_tensor_constant8": "const_noop", "_tensor_constant9": "const_noop", "_native_batch_norm_legit_no_training_4": "BatchNormOp", "getitem_12": "GatherOp", "getitem_13": "GatherOp", "getitem_14": "GatherOp", "relu_4": "ReluOp", "_param_constant20": "const_noop", "_param_constant21": "const_noop", "conv2d_5": "Conv2DOp", "empty_5": "unknown", "_param_constant22": "const_noop", "_param_constant23": "const_noop", "_tensor_constant10": "const_noop", "_tensor_constant11": "const_noop", "_native_batch_norm_legit_no_training_5": "BatchNormOp", "getitem_15": "GatherOp", "getitem_16": "GatherOp", "getitem_17": "GatherOp", "relu_5": "ReluOp", "max_pool2d_2": "MaxPool2DOp", "_param_constant24": "const_noop", "_param_constant25": "const_noop", "conv2d_6": "Conv2DOp", "empty_6": "unknown", "_param_constant26": "const_noop", "_param_constant27": "const_noop", "_tensor_constant12": "const_noop", "_tensor_constant13": "const_noop", "_native_batch_norm_legit_no_training_6": "BatchNormOp", "getitem_18": "GatherOp", "getitem_19": "GatherOp", "getitem_20": "GatherOp", "relu_6": "ReluOp", "_param_constant28": "const_noop", "_param_constant29": "const_noop", "conv2d_7": "Conv2DOp", "empty_7": "unknown", "_param_constant30": "const_noop", "_param_constant31": "const_noop", "_tensor_constant14": "const_noop", "_tensor_constant15": "const_noop", "_native_batch_norm_legit_no_training_7": "BatchNormOp", "getitem_21": "GatherOp", "getitem_22": "GatherOp", "getitem_23": "GatherOp", "relu_7": "ReluOp", "max_pool2d_3": "MaxPool2DOp", "_param_constant32": "const_noop", "_param_constant33": "const_noop", "conv2d_8": "Conv2DOp", "empty_8": "unknown", "_param_constant34": "const_noop", "_param_constant35": "const_noop", "_tensor_constant16": "const_noop", "_tensor_constant17": "const_noop", "_native_batch_norm_legit_no_training_8": "BatchNormOp", "getitem_24": "GatherOp", "getitem_25": "GatherOp", "getitem_26": "GatherOp", "relu_8": "ReluOp", "_param_constant36": "const_noop", "_param_constant37": "const_noop", "conv2d_9": "Conv2DOp", "empty_9": "unknown", "_param_constant38": "const_noop", "_param_constant39": "const_noop", "_tensor_constant18": "const_noop", "_tensor_constant19": "const_noop", "_native_batch_norm_legit_no_training_9": "BatchNormOp", "getitem_27": "GatherOp", "getitem_28": "GatherOp", "getitem_29": "GatherOp", "relu_9": "ReluOp", "_param_constant40": "const_noop", "_param_constant41": "const_noop", "conv_transpose2d": "ConvTranspose2DOp", "slice_1": "GatherOp", "slice_2": "GatherOp", "slice_3": "GatherOp", "slice_4": "GatherOp", "cat": "CatOp", "_param_constant42": "const_noop", "_param_constant43": "const_noop", "conv2d_10": "Conv2DOp", "empty_10": "unknown", "_param_constant44": "const_noop", "_param_constant45": "const_noop", "_tensor_constant20": "const_noop", "_tensor_constant21": "const_noop", "_native_batch_norm_legit_no_training_10": "BatchNormOp", "getitem_30": "GatherOp", "getitem_31": "GatherOp", "getitem_32": "GatherOp", "relu_10": "ReluOp", "_param_constant46": "const_noop", "_param_constant47": "const_noop", "conv2d_11": "Conv2DOp", "empty_11": "unknown", "_param_constant48": "const_noop", "_param_constant49": "const_noop", "_tensor_constant22": "const_noop", "_tensor_constant23": "const_noop", "_native_batch_norm_legit_no_training_11": "BatchNormOp", "getitem_33": "GatherOp", "getitem_34": "GatherOp", "getitem_35": "GatherOp", "relu_11": "ReluOp", "_param_constant50": "const_noop", "_param_constant51": "const_noop", "conv_transpose2d_1": "ConvTranspose2DOp", "slice_5": "GatherOp", "slice_6": "GatherOp", "slice_7": "GatherOp", "slice_8": "GatherOp", "cat_1": "CatOp", "_param_constant52": "const_noop", "_param_constant53": "const_noop", "conv2d_12": "Conv2DOp", "empty_12": "unknown", "_param_constant54": "const_noop", "_param_constant55": "const_noop", "_tensor_constant24": "const_noop", "_tensor_constant25": "const_noop", "_native_batch_norm_legit_no_training_12": "BatchNormOp", "getitem_36": "GatherOp", "getitem_37": "GatherOp", "getitem_38": "GatherOp", "relu_12": "ReluOp", "_param_constant56": "const_noop", "_param_constant57": "const_noop", "conv2d_13": "Conv2DOp", "empty_13": "unknown", "_param_constant58": "const_noop", "_param_constant59": "const_noop", "_tensor_constant26": "const_noop", "_tensor_constant27": "const_noop", "_native_batch_norm_legit_no_training_13": "BatchNormOp", "getitem_39": "GatherOp", "getitem_40": "GatherOp", "getitem_41": "GatherOp", "relu_13": "ReluOp", "_param_constant60": "const_noop", "_param_constant61": "const_noop", "conv_transpose2d_2": "ConvTranspose2DOp", "slice_9": "GatherOp", "slice_10": "GatherOp", "slice_11": "GatherOp", "slice_12": "GatherOp", "cat_2": "CatOp", "_param_constant62": "const_noop", "_param_constant63": "const_noop", "conv2d_14": "Conv2DOp", "empty_14": "unknown", "_param_constant64": "const_noop", "_param_constant65": "const_noop", "_tensor_constant28": "const_noop", "_tensor_constant29": "const_noop", "_native_batch_norm_legit_no_training_14": "BatchNormOp", "getitem_42": "GatherOp", "getitem_43": "GatherOp", "getitem_44": "GatherOp", "relu_14": "ReluOp", "_param_constant66": "const_noop", "_param_constant67": "const_noop", "conv2d_15": "Conv2DOp", "empty_15": "unknown", "_param_constant68": "const_noop", "_param_constant69": "const_noop", "_tensor_constant30": "const_noop", "_tensor_constant31": "const_noop", "_native_batch_norm_legit_no_training_15": "BatchNormOp", "getitem_45": "GatherOp", "getitem_46": "GatherOp", "getitem_47": "GatherOp", "relu_15": "ReluOp", "_param_constant70": "const_noop", "_param_constant71": "const_noop", "conv_transpose2d_3": "ConvTranspose2DOp", "slice_13": "GatherOp", "slice_14": "GatherOp", "slice_15": "GatherOp", "slice_16": "GatherOp", "cat_3": "CatOp", "_param_constant72": "const_noop", "_param_constant73": "const_noop", "conv2d_16": "Conv2DOp", "empty_16": "unknown", "_param_constant74": "const_noop", "_param_constant75": "const_noop", "_tensor_constant32": "const_noop", "_tensor_constant33": "const_noop", "_native_batch_norm_legit_no_training_16": "BatchNormOp", "getitem_48": "GatherOp", "getitem_49": "GatherOp", "getitem_50": "GatherOp", "relu_16": "ReluOp", "_param_constant76": "const_noop", "_param_constant77": "const_noop", "conv2d_17": "Conv2DOp", "empty_17": "unknown", "_param_constant78": "const_noop", "_param_constant79": "const_noop", "_tensor_constant34": "const_noop", "_tensor_constant35": "const_noop", "_native_batch_norm_legit_no_training_17": "BatchNormOp", "getitem_51": "GatherOp", "getitem_52": "GatherOp", "getitem_53": "GatherOp", "relu_17": "ReluOp", "_param_constant80": "const_noop", "_param_constant81": "const_noop", "conv2d_18": "Conv2DOp", "output": "output_noop"}
Loading

0 comments on commit 63fcb15

Please sign in to comment.