def test_global_config_palettizer(self, nbits, mode, weight_threshold, fake_compression):
        """
        Global config would compress all operations with the same config
        """
        op_config = cto.coreml.OpPalettizerConfig(
            nbits=nbits, mode=mode, weight_threshold=weight_threshold
        )
        config = cto.coreml.OptimizationConfig(global_config=op_config)
        compressor = quantization.palettize_weights(
            config=config, fake_compression=fake_compression
        )
        prog = self._get_test_program()
        compressor.apply(prog)

        if fake_compression:
            expected_ops = ["conv", "reshape", "linear", "reshape", "conv_transpose"]
        elif weight_threshold == 1000:
            expected_ops = [
                "constexpr_lut_to_dense",
                "conv",
                "reshape",
                "constexpr_lut_to_dense",
                "linear",
                "reshape",
                "constexpr_lut_to_dense",
                "conv_transpose",
            ]
        else:
            assert weight_threshold == 7000
            # linear weight size < 7000
            expected_ops = [
                "constexpr_lut_to_dense",
                "conv",
                "reshape",
                "linear",
                "reshape",
                "constexpr_lut_to_dense",
                "conv_transpose",
            ]
        assert get_op_types_in_program(prog) == expected_ops

        Global config would compress all operations with the same config
        
coremltools/test/optimize/coreml/test_passes.py