def test_block_size_validation_gptq(input_size, expectation):
    """
    Test handling of block_size configuration for GPTQ algorithm
    """
    config = ModuleGPTQConfig.from_dict(
        {
            "algorithm": "gptq",
            "weight_dtype": "uint8",
            "block_size": 128,
            "granularity": "per_block",
        }
    )

    _model = nn.Transformer(d_model=input_size, nhead=8)
    layer = _model.encoder.layers.get_submodule("0.linear1")

    with expectation:
        gptq = GPTQ(layer, config)
        assert gptq is not None

    Test handling of block_size configuration for GPTQ algorithm
    
coremltools/test/optimize/torch/layerwise_compression/test_algorithms.py