()
| 350 | @pytest.mark.skipif(not env.has_cuda_compute(9), reason="need cuda compute >= 9.0") |
| 351 | @pytest.mark.skipif(ml_dtypes is None, reason="requires ml_dtypes to be installed") |
| 352 | def test_matmul_fp8_dequantize_offload(): |
| 353 | x_shape = (10, 32) |
| 354 | y_shape = (64, 32) |
| 355 | in_dtype = "float8_e4m3fn" |
| 356 | mod = get_relax_matmul_dequantize_module( |
| 357 | x_shape, |
| 358 | y_shape, |
| 359 | in_dtype, |
| 360 | "float16", |
| 361 | transposed_y=True, |
| 362 | scale_const=0.34786, |
| 363 | zero_point_const=0.0, |
| 364 | ) |
| 365 | |
| 366 | numpytype = "float8_e4m3fn" |
| 367 | x = np.random.uniform(low=0, high=5, size=x_shape).astype(numpytype) |
| 368 | y = np.random.uniform(low=0, high=5, size=y_shape).astype(numpytype) |
| 369 | args = (x, y) |
| 370 | |
| 371 | out = get_result_with_relax_cublas_offload(mod, args, bind_constants=True) |
| 372 | ref = build_and_run(mod, args, "llvm", legalize=True) |
| 373 | tvm.testing.assert_allclose(out, ref, rtol=1e-3, atol=1e-3) |
| 374 | |
| 375 | |
| 376 | @pytest.mark.gpu |
nothing calls this directly
no test coverage detected
searching dependent graphs…