code: def test_unsupported_gqa_configs(
      head_size: int, n_heads_q: int, n_heads_kv: int, n_shards: int
  ):
      """
      GQA has stricter requirements. We must be able to evenly shard or distribute the KV heads.
  
      Test cases are to test the following preconditions specifically:
          1. n_heads_q % n_heads_kv == 0
          2. We must be able to evenly distribute KV heads
          3. We must be able to evely split KV heads
      """
      param = fill_with_head_ids(head_size, n_heads_q, n_heads_kv)
  
      for shard_rank in range(n_shards):
          with pytest.raises(ValueError):
              shard_qkv_param(
                  param,
                  shard_rank,
                  n_shards,
                  head_size,
                  n_heads_q,
                  n_heads_kv,
              )
  
file_path: DeepSpeed/tests/unit/inference/v2/model_implementations/sharding/test_qkv_sharding.py
imports: from typing import Optional
  import pytest
  import torch
  from deepspeed.accelerator import get_accelerator
  from deepspeed.inference.v2.model_implementations.sharding import *
label_desc: Use image node_id 8 for calling a global function with example usage: test_unsupported_gqa_configs(head_size, n_heads_q, n_heads_kv, n_shards) without return types