def generate_benchmark_configs(is_varlen: bool, packing: Optional[Literal["kv", "qkv"]]):
    """
    generates a small number of configs that cover the parameter space well
    """
    
    # define all parameter options as lists
    batch_sizes = [1, 64]
    if packing == "qkv":
        hq_values = hk_values = [2, 8]
        sq_values = sk_values = [256, 8192]
    else:
        if is_varlen: # make sure the seqlen is greater than the batchsize so that subsequences are greater than 0
            hq_values = [16, 32] # test mqa/gqa
            hk_values = [8, 16]
            sq_values = [128, 512]
            sk_values = [512, 2024]
        else:
            hq_values = [64, 128] # test mqa/gqa
            hk_values = [16, 64]
            sq_values = [4, 4096]
            sk_values = [4096, 16384] # test large k values for inference perf
    d_head_values = [64, 128]
    causal_values = [True, False] # most models usual causal True
    dropout_values = [0.0, 0.1]
    
    # generate all fn_configs without inputs
    input_configs = []
    
    # one big loop to generate configs
    for batch in batch_sizes:
        for hq in hq_values:
            for hk in hk_values:
                for sq in sq_values:
                    for sk in sk_values:
                        for d_head in d_head_values:
                            for causal in causal_values:
                                for dropout in dropout_values:
                                    # filter configs
                                    input_config = (batch, hq, hk, sq, sk, d_head, causal, dropout)

                                    # skip if memory usage would be too high
                                    if estimate_memory(input_config) > 8 * 1024 * 1024 * 1024:  # 8 GB limit
                                        continue

                                    # we need hq to be a multiple of hk
                                    if hq % hk != 0:
                                        continue

                                    # for qkvpacked functions, q and k must have same dimensions
                                    if packing == "qkv" and (sq != sk or hq != hk):
                                        continue
                                    
                                    input_configs.append(input_config)
    
    return input_configs

    generates a small number of configs that cover the parameter space well
    
flash_attn/flash_attn_triton_amd/bench.py