code: def test_triton_varargs_kernel():
      @triton.jit
      def sumN(
          output_ptr, scaling_ptr, *inputs, BLOCK_SIZE: tl.constexpr
      ):
          offset = tl.arange(0, BLOCK_SIZE)
          output = tl.zeros([BLOCK_SIZE], tl.float32)
          scaling: "VAR_ARGS_ARRAY"  # type: ignore # noqa: F821
          for i in range(len(scaling)):
              scaling[i] = tl.load(scaling_ptr + i)
  
          for i in range(2):
              for j in range(len(inputs)):
                  output = (
                      output + tl.load(inputs[j] + offset) * scaling[j]
                  )
          tl.store(output_ptr + offset, output)
  
      BLOCK_SIZE = 32
      NUM_INPUTS = 2
      torch.manual_seed(0)
      inputs = [
          torch.randn([BLOCK_SIZE], dtype=torch.float32, device="cuda")
          for _ in range(NUM_INPUTS)
      ]
      output = torch.randn(
          [BLOCK_SIZE], dtype=torch.float32, device="cuda"
      )
      scaling = torch.randn(
          [NUM_INPUTS, 1], dtype=torch.float32, device="cuda"
      )
      sumN_unrolled = unroll_varargs(sumN, N=NUM_INPUTS)
      sumN_unrolled[(1,)](output, scaling, *inputs, BLOCK_SIZE=32)
      assert torch.allclose(
          (2 * torch.stack(inputs) * scaling).sum(0), output
      )
  
imports: import logging
  import sys
  import pytest
  import torch
  import xformers
label_desc: Use image node_id 1 for calling a global function with example usage: test_triton_varargs_kernel() without return types