MCPcopy Index your code
hub / github.com/apache/tvm / test_conv2d_offload

Function test_conv2d_offload

tests/python/relax/test_codegen_cutlass.py:252–279  ·  view source on GitHub ↗
(data_shape, weight_shape, dtype, epilogue, residual_block)

Source from the content-addressed store, hash-verified

250 ],
251)
252def test_conv2d_offload(data_shape, weight_shape, dtype, epilogue, residual_block):
253 low, high = -1, 1
254 data = np.random.randint(low, high, size=data_shape).astype(dtype)
255 weight = np.random.randint(low, high, size=weight_shape).astype(dtype)
256 bias = np.random.randint(low, high, size=(1, 1, 1, weight_shape[0])).astype(dtype)
257
258 with_bias, activation = _epilogue_table[epilogue]
259 residual_bin_op, residual_activation = _residual_block_table[residual_block]
260
261 if with_bias:
262 args = (data, weight, bias)
263 else:
264 args = (data, weight)
265
266 mod = get_relax_conv2d_module(
267 data_shape,
268 weight_shape,
269 dtype,
270 with_bias=with_bias,
271 activation=activation,
272 residual_bin_op=residual_bin_op,
273 residual_activation=residual_activation,
274 )
275 out = get_result_with_relax_cutlass_offload(mod, *args)
276
277 ref = build_and_run(mod, args, "llvm")
278
279 tvm.testing.assert_allclose(out, ref, rtol=1e-5, atol=1e-5)
280
281
282@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 4

get_relax_conv2d_moduleFunction · 0.70
build_and_runFunction · 0.70
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…