code: def test_randint(size, seed, device, dtype):
      size = list(map(int, size.split(",")))
      torch_dtype = getattr(torch, dtype)
      numpy_dtype = getattr(np, f"u{dtype}")
      config = {"int32": PHILOX_32, "int64": PHILOX_64}[dtype]
  
      @triton.jit
      def kernel(X, N, seed):
          pid = tl.program_id(0).to(X.dtype.element_ty)
          offset = pid * BLOCK + tl.arange(0, BLOCK)
          rand = tl.randint(seed, offset)
          tl.store(X + offset, rand, mask=offset < N)
  
      # triton result
      x = torch.empty(size, dtype=torch_dtype, device=device)
      N = x.numel()
      grid = (triton.cdiv(N, BLOCK),)
      kernel[grid](x, N, seed)
      out_tri = x.cpu().numpy().astype(numpy_dtype).flatten().tolist()
      # reference result
      gen = CustomPhilox4x(seed, config=config)
      out_ref = [gen.random_raw()[0] for _ in out_tri]
      assert out_tri == out_ref
  
imports: import numpy
  import pytest
  import scipy.stats
  import torch
  import triton
  import triton.language
label_desc: Use image node_id 1 for calling a global function with example usage: test_randint(size, seed, device, dtype) without return types