MCPcopy Create free account
hub / github.com/apache/tvm / get_ref_data

Function get_ref_data

tests/python/contrib/test_cutlass_gemm.py:45–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43
44 @memoize("tvm.contrib.cutlass.test_group_gemm_sm90")
45 def get_ref_data():
46 assert M % num_groups == 0
47 M_per_group = M // num_groups
48 a_np = get_random_tensor((M, K), x_dtype)
49 b_np = get_random_tensor((num_groups, N, K), weight_dtype)
50 indptr_np = np.arange(1, num_groups + 1).astype("int64") * M_per_group
51 c_np = np.concatenate(
52 [a_np[i * M_per_group : (i + 1) * M_per_group] @ b_np[i].T for i in range(num_groups)],
53 axis=0,
54 )
55 return a_np, b_np, indptr_np, c_np
56
57 def to_numpy_dtype(dtype):
58 mapping = {"float8_e5m2": ml_dtypes.float8_e5m2, "float8_e4m3fn": ml_dtypes.float8_e4m3fn}

Callers 1

verify_group_gemmFunction · 0.70

Calls 4

get_random_tensorFunction · 0.85
astypeMethod · 0.45
arangeMethod · 0.45
concatenateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…